-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathExpoSpeechRecognitionOptions.kt
108 lines (78 loc) · 2.12 KB
/
ExpoSpeechRecognitionOptions.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package expo.modules.speechrecognition
import android.media.AudioFormat
import android.speech.RecognizerIntent
import expo.modules.kotlin.records.Field
import expo.modules.kotlin.records.Record
class SpeechRecognitionOptions : Record {
@Field
val interimResults: Boolean? = false
@Field
val lang: String = "en-US"
@Field
val continuous: Boolean? = false
@Field
val maxAlternatives: Int? = 5
@Field
var contextualStrings: List<String>? = null
@Field
var requiresOnDeviceRecognition: Boolean? = false
@Field
var addsPunctuation: Boolean? = false
@Field
var androidIntentOptions: Map<String, Any>? = null
@Field
val androidRecognitionServicePackage: String? = null
/**
* Provide an audio source (e.g. microphone or file) to use for speech recognition.
*/
@Field
val audioSource: AudioSourceOptions? = null
@Field
val recordingOptions: RecordingOptions? = null
@Field
val androidIntent: String? = RecognizerIntent.ACTION_RECOGNIZE_SPEECH
@Field
val iosTaskHint: String? = null
@Field
val iosCategory: Map<String, Any>? = null
@Field
val volumeChangeEventOptions: VolumeChangeEventOptions? = null
}
class VolumeChangeEventOptions : Record {
@Field
val enabled: Boolean? = false
@Field
val intervalMillis: Int? = null
}
class RecordingOptions : Record {
@Field
val persist: Boolean = false
@Field
val outputDirectory: String? = null
@Field
val outputFileName: String? = null
@Field
val outputSampleRate: Int? = null
@Field
val outputEncoding: String? = null
}
class AudioSourceOptions : Record {
@Field
val uri: String = ""
@Field
val audioEncoding: Int? = AudioFormat.ENCODING_PCM_16BIT
@Field
val sampleRate: Int? = 16000
@Field
val audioChannels: Int? = 1
@Field
val chunkDelayMillis: Long? = null
}
class GetSupportedLocaleOptions : Record {
@Field
val androidRecognitionServicePackage: String? = null
}
class TriggerOfflineModelDownloadOptions : Record {
@Field
val locale: String = "en-US"
}