File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/core/useSpeechRecognition Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ export interface UseSpeechRecognitionOptions extends ConfigurableWindow {
2929 * @default 'en-US'
3030 */
3131 lang ?: MaybeRefOrGetter < string >
32+ /**
33+ * A number representing the maximum returned alternatives for each result.
34+ *
35+ * @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/maxAlternatives
36+ * @default 1
37+ */
38+ maxAlternatives ?: number
3239}
3340
3441/**
@@ -42,6 +49,7 @@ export function useSpeechRecognition(options: UseSpeechRecognitionOptions = {})
4249 const {
4350 interimResults = true ,
4451 continuous = true ,
52+ maxAlternatives = 1 ,
4553 window = defaultWindow ,
4654 } = options
4755
@@ -74,6 +82,7 @@ export function useSpeechRecognition(options: UseSpeechRecognitionOptions = {})
7482 recognition . continuous = continuous
7583 recognition . interimResults = interimResults
7684 recognition . lang = toValue ( lang )
85+ recognition . maxAlternatives = maxAlternatives
7786
7887 recognition . onstart = ( ) => {
7988 isFinal . value = false
You can’t perform that action at this time.
0 commit comments