Skip to content

Commit e82bb71

Browse files
Replace SpeechRecognitionPhraseList with ObservableArray<SpeechRecognitionPhrase>
This CL replaces SpeechRecognitionPhraseList with ObservableArray<SpeechRecognitionPhrase>. Spec changes: WebAudio/web-speech-api#169 Bug:381349238 Change-Id: I9cb4bdafd7c74cf48a4d7f3684af644df1eff4c0
1 parent ad77aa9 commit e82bb71

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

speech-api/SpeechRecognition-phrases-manual.https.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,20 @@
6464
);
6565
};
6666

67-
recognition1.phrases = new SpeechRecognitionPhraseList([
68-
new SpeechRecognitionPhrase("test", 1.0)
69-
]);
67+
recognition1.phrases.push(new SpeechRecognitionPhrase("test", 1.0));
7068

7169
// Create the second speech recognition with a mode that supports contextual biasing.
7270
const recognition2 = new SpeechRecognition();
7371
recognition2.processLocally = true;
7472
recognition2.lang = "en-US";
7573

76-
recognition2.onerror = function(event) {
77-
// Currently WPT may not be able to detect that SODA is available and
78-
// will throw a "language-not-supported" error here.
79-
assert_unreached("Caught an error: " + event.error);
80-
};
74+
// On-device speech recognition should not throw an error.
75+
recognition2.onerror = t.unreached_func("recognition2 should not error");
8176

82-
recognition2.phrases = new SpeechRecognitionPhraseList([
83-
new SpeechRecognitionPhrase("ASIC", 1.0),
84-
new SpeechRecognitionPhrase("FPGA", 1.0)
85-
]);
77+
recognition2.phrases = [
78+
new SpeechRecognitionPhrase("ASIC", 3.0),
79+
new SpeechRecognitionPhrase("FPGA", 3.0)
80+
];
8681

8782
const recognitionPromise = new Promise((resolve) => {
8883
recognition2.onresult = (event) => {

0 commit comments

Comments
 (0)