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 {
29
29
* @default 'en-US'
30
30
*/
31
31
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
32
39
}
33
40
34
41
/**
@@ -42,6 +49,7 @@ export function useSpeechRecognition(options: UseSpeechRecognitionOptions = {})
42
49
const {
43
50
interimResults = true ,
44
51
continuous = true ,
52
+ maxAlternatives = 1 ,
45
53
window = defaultWindow ,
46
54
} = options
47
55
@@ -74,6 +82,7 @@ export function useSpeechRecognition(options: UseSpeechRecognitionOptions = {})
74
82
recognition . continuous = continuous
75
83
recognition . interimResults = interimResults
76
84
recognition . lang = toValue ( lang )
85
+ recognition . maxAlternatives = maxAlternatives
77
86
78
87
recognition . onstart = ( ) => {
79
88
isFinal . value = false
You can’t perform that action at this time.
0 commit comments