这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
default
只读特性在
SpeechSynthesisVoice
interface returns a
布尔
indicating whether the voice is the default voice for the current app (
true
), or not (
false
)。
注意 : For some devices, it might be the default voice for the voice's language. The spec is not very clear on which it should be, so some implementations may differ.
var amIDefault = speechSynthesisVoiceInstance.default;
A
布尔
.
for(i = 0; i < voices.length ; i++) {
var option = document.createElement('option');
option.textContent = voices[i].name + ' (' + voices[i].lang + ')';
if(voices[i].default) {
option.textContent += ' -- DEFAULT';
}
option.setAttribute('data-lang', voices[i].lang);
option.setAttribute('data-name', voices[i].name);
voiceSelect.appendChild(option);
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 语音 API
The definition of 'default' in that specification. |
草案 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
default
|
Chrome 33 | Edge 14 | Firefox 49 | IE No | Opera 21 | Safari 7 | WebView Android 4.4.3 | Chrome Android 33 |
Firefox Android
62
|
Opera Android No | Safari iOS 7 | Samsung Internet Android 3.0 |
完整支持
不支持
实验。期望将来行为有所改变。
用户必须明确启用此特征。
SpeechSynthesisVoice
default
lang
localService
名称
voiceURI