@gmessier/nitro-speech 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/nitrogen/generated/android/NitroSpeech+autolinking.cmake +1 -1
- package/nitrogen/generated/android/NitroSpeech+autolinking.gradle +1 -1
- package/nitrogen/generated/android/NitroSpeechOnLoad.cpp +32 -22
- package/nitrogen/generated/android/NitroSpeechOnLoad.hpp +14 -5
- package/nitrogen/generated/android/c++/JFunc_void.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_std__string_.hpp +1 -1
- package/nitrogen/generated/android/c++/JHapticFeedbackStyle.hpp +5 -6
- package/nitrogen/generated/android/c++/JHybridNitroSpeechSpec.cpp +23 -22
- package/nitrogen/generated/android/c++/JHybridNitroSpeechSpec.hpp +20 -22
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.cpp +39 -38
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.hpp +20 -22
- package/nitrogen/generated/android/c++/JSpeechToTextParams.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/Func_void.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/Func_void_double.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/Func_void_std__string.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/Func_void_std__vector_std__string_.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HapticFeedbackStyle.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HybridNitroSpeechSpec.kt +16 -19
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HybridRecognizerSpec.kt +16 -19
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/NitroSpeechOnLoad.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/SpeechToTextParams.kt +2 -2
- package/nitrogen/generated/ios/NitroSpeech+autolinking.rb +2 -2
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Bridge.hpp +11 -11
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/NitroSpeechAutolinking.mm +1 -1
- package/nitrogen/generated/ios/NitroSpeechAutolinking.swift +9 -8
- package/nitrogen/generated/ios/c++/HybridNitroSpeechSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNitroSpeechSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/c++/HybridRecognizerSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridRecognizerSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_double.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +1 -2
- package/nitrogen/generated/ios/swift/HapticFeedbackStyle.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridNitroSpeechSpec.swift +3 -4
- package/nitrogen/generated/ios/swift/HybridNitroSpeechSpec_cxx.swift +10 -3
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec.swift +3 -4
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec_cxx.swift +17 -3
- package/nitrogen/generated/ios/swift/SpeechToTextParams.swift +86 -218
- package/nitrogen/generated/shared/c++/HapticFeedbackStyle.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroSpeechSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroSpeechSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/SpeechToTextParams.hpp +43 -35
- package/package.json +6 -3
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// SpeechToTextParams.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
import Foundation
|
|
9
8
|
import NitroModules
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -95,252 +94,121 @@ public extension SpeechToTextParams {
|
|
|
95
94
|
}())
|
|
96
95
|
}
|
|
97
96
|
|
|
97
|
+
@inline(__always)
|
|
98
98
|
var locale: String? {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
}()
|
|
109
|
-
}
|
|
110
|
-
@inline(__always)
|
|
111
|
-
set {
|
|
112
|
-
self.__locale = { () -> bridge.std__optional_std__string_ in
|
|
113
|
-
if let __unwrappedValue = newValue {
|
|
114
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
115
|
-
} else {
|
|
116
|
-
return .init()
|
|
117
|
-
}
|
|
118
|
-
}()
|
|
119
|
-
}
|
|
99
|
+
return { () -> String? in
|
|
100
|
+
if bridge.has_value_std__optional_std__string_(self.__locale) {
|
|
101
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__locale)
|
|
102
|
+
return String(__unwrapped)
|
|
103
|
+
} else {
|
|
104
|
+
return nil
|
|
105
|
+
}
|
|
106
|
+
}()
|
|
120
107
|
}
|
|
121
108
|
|
|
109
|
+
@inline(__always)
|
|
122
110
|
var autoFinishRecognitionMs: Double? {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
132
|
-
} else {
|
|
133
|
-
return .init()
|
|
134
|
-
}
|
|
135
|
-
}()
|
|
136
|
-
}
|
|
111
|
+
return { () -> Double? in
|
|
112
|
+
if bridge.has_value_std__optional_double_(self.__autoFinishRecognitionMs) {
|
|
113
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__autoFinishRecognitionMs)
|
|
114
|
+
return __unwrapped
|
|
115
|
+
} else {
|
|
116
|
+
return nil
|
|
117
|
+
}
|
|
118
|
+
}()
|
|
137
119
|
}
|
|
138
120
|
|
|
121
|
+
@inline(__always)
|
|
139
122
|
var disableRepeatingFilter: Bool? {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
}()
|
|
150
|
-
}
|
|
151
|
-
@inline(__always)
|
|
152
|
-
set {
|
|
153
|
-
self.__disableRepeatingFilter = { () -> bridge.std__optional_bool_ in
|
|
154
|
-
if let __unwrappedValue = newValue {
|
|
155
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
156
|
-
} else {
|
|
157
|
-
return .init()
|
|
158
|
-
}
|
|
159
|
-
}()
|
|
160
|
-
}
|
|
123
|
+
return { () -> Bool? in
|
|
124
|
+
if bridge.has_value_std__optional_bool_(self.__disableRepeatingFilter) {
|
|
125
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__disableRepeatingFilter)
|
|
126
|
+
return __unwrapped
|
|
127
|
+
} else {
|
|
128
|
+
return nil
|
|
129
|
+
}
|
|
130
|
+
}()
|
|
161
131
|
}
|
|
162
132
|
|
|
133
|
+
@inline(__always)
|
|
163
134
|
var contextualStrings: [String]? {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
}()
|
|
174
|
-
}
|
|
175
|
-
@inline(__always)
|
|
176
|
-
set {
|
|
177
|
-
self.__contextualStrings = { () -> bridge.std__optional_std__vector_std__string__ in
|
|
178
|
-
if let __unwrappedValue = newValue {
|
|
179
|
-
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
180
|
-
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
181
|
-
for __item in __unwrappedValue {
|
|
182
|
-
__vector.push_back(std.string(__item))
|
|
183
|
-
}
|
|
184
|
-
return __vector
|
|
185
|
-
}())
|
|
186
|
-
} else {
|
|
187
|
-
return .init()
|
|
188
|
-
}
|
|
189
|
-
}()
|
|
190
|
-
}
|
|
135
|
+
return { () -> [String]? in
|
|
136
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__contextualStrings) {
|
|
137
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__contextualStrings)
|
|
138
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
139
|
+
} else {
|
|
140
|
+
return nil
|
|
141
|
+
}
|
|
142
|
+
}()
|
|
191
143
|
}
|
|
192
144
|
|
|
145
|
+
@inline(__always)
|
|
193
146
|
var startHapticFeedbackStyle: HapticFeedbackStyle? {
|
|
194
|
-
|
|
195
|
-
get {
|
|
196
|
-
return self.__startHapticFeedbackStyle.value
|
|
197
|
-
}
|
|
198
|
-
@inline(__always)
|
|
199
|
-
set {
|
|
200
|
-
self.__startHapticFeedbackStyle = { () -> bridge.std__optional_HapticFeedbackStyle_ in
|
|
201
|
-
if let __unwrappedValue = newValue {
|
|
202
|
-
return bridge.create_std__optional_HapticFeedbackStyle_(__unwrappedValue)
|
|
203
|
-
} else {
|
|
204
|
-
return .init()
|
|
205
|
-
}
|
|
206
|
-
}()
|
|
207
|
-
}
|
|
147
|
+
return self.__startHapticFeedbackStyle.value
|
|
208
148
|
}
|
|
209
149
|
|
|
150
|
+
@inline(__always)
|
|
210
151
|
var stopHapticFeedbackStyle: HapticFeedbackStyle? {
|
|
211
|
-
|
|
212
|
-
get {
|
|
213
|
-
return self.__stopHapticFeedbackStyle.value
|
|
214
|
-
}
|
|
215
|
-
@inline(__always)
|
|
216
|
-
set {
|
|
217
|
-
self.__stopHapticFeedbackStyle = { () -> bridge.std__optional_HapticFeedbackStyle_ in
|
|
218
|
-
if let __unwrappedValue = newValue {
|
|
219
|
-
return bridge.create_std__optional_HapticFeedbackStyle_(__unwrappedValue)
|
|
220
|
-
} else {
|
|
221
|
-
return .init()
|
|
222
|
-
}
|
|
223
|
-
}()
|
|
224
|
-
}
|
|
152
|
+
return self.__stopHapticFeedbackStyle.value
|
|
225
153
|
}
|
|
226
154
|
|
|
155
|
+
@inline(__always)
|
|
227
156
|
var maskOffensiveWords: Bool? {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
}()
|
|
238
|
-
}
|
|
239
|
-
@inline(__always)
|
|
240
|
-
set {
|
|
241
|
-
self.__maskOffensiveWords = { () -> bridge.std__optional_bool_ in
|
|
242
|
-
if let __unwrappedValue = newValue {
|
|
243
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
244
|
-
} else {
|
|
245
|
-
return .init()
|
|
246
|
-
}
|
|
247
|
-
}()
|
|
248
|
-
}
|
|
157
|
+
return { () -> Bool? in
|
|
158
|
+
if bridge.has_value_std__optional_bool_(self.__maskOffensiveWords) {
|
|
159
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__maskOffensiveWords)
|
|
160
|
+
return __unwrapped
|
|
161
|
+
} else {
|
|
162
|
+
return nil
|
|
163
|
+
}
|
|
164
|
+
}()
|
|
249
165
|
}
|
|
250
166
|
|
|
167
|
+
@inline(__always)
|
|
251
168
|
var androidFormattingPreferQuality: Bool? {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
}()
|
|
262
|
-
}
|
|
263
|
-
@inline(__always)
|
|
264
|
-
set {
|
|
265
|
-
self.__androidFormattingPreferQuality = { () -> bridge.std__optional_bool_ in
|
|
266
|
-
if let __unwrappedValue = newValue {
|
|
267
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
268
|
-
} else {
|
|
269
|
-
return .init()
|
|
270
|
-
}
|
|
271
|
-
}()
|
|
272
|
-
}
|
|
169
|
+
return { () -> Bool? in
|
|
170
|
+
if bridge.has_value_std__optional_bool_(self.__androidFormattingPreferQuality) {
|
|
171
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__androidFormattingPreferQuality)
|
|
172
|
+
return __unwrapped
|
|
173
|
+
} else {
|
|
174
|
+
return nil
|
|
175
|
+
}
|
|
176
|
+
}()
|
|
273
177
|
}
|
|
274
178
|
|
|
179
|
+
@inline(__always)
|
|
275
180
|
var androidUseWebSearchModel: Bool? {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
}()
|
|
286
|
-
}
|
|
287
|
-
@inline(__always)
|
|
288
|
-
set {
|
|
289
|
-
self.__androidUseWebSearchModel = { () -> bridge.std__optional_bool_ in
|
|
290
|
-
if let __unwrappedValue = newValue {
|
|
291
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
292
|
-
} else {
|
|
293
|
-
return .init()
|
|
294
|
-
}
|
|
295
|
-
}()
|
|
296
|
-
}
|
|
181
|
+
return { () -> Bool? in
|
|
182
|
+
if bridge.has_value_std__optional_bool_(self.__androidUseWebSearchModel) {
|
|
183
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__androidUseWebSearchModel)
|
|
184
|
+
return __unwrapped
|
|
185
|
+
} else {
|
|
186
|
+
return nil
|
|
187
|
+
}
|
|
188
|
+
}()
|
|
297
189
|
}
|
|
298
190
|
|
|
191
|
+
@inline(__always)
|
|
299
192
|
var androidDisableBatchHandling: Bool? {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
}()
|
|
310
|
-
}
|
|
311
|
-
@inline(__always)
|
|
312
|
-
set {
|
|
313
|
-
self.__androidDisableBatchHandling = { () -> bridge.std__optional_bool_ in
|
|
314
|
-
if let __unwrappedValue = newValue {
|
|
315
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
316
|
-
} else {
|
|
317
|
-
return .init()
|
|
318
|
-
}
|
|
319
|
-
}()
|
|
320
|
-
}
|
|
193
|
+
return { () -> Bool? in
|
|
194
|
+
if bridge.has_value_std__optional_bool_(self.__androidDisableBatchHandling) {
|
|
195
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__androidDisableBatchHandling)
|
|
196
|
+
return __unwrapped
|
|
197
|
+
} else {
|
|
198
|
+
return nil
|
|
199
|
+
}
|
|
200
|
+
}()
|
|
321
201
|
}
|
|
322
202
|
|
|
203
|
+
@inline(__always)
|
|
323
204
|
var iosAddPunctuation: Bool? {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
}()
|
|
334
|
-
}
|
|
335
|
-
@inline(__always)
|
|
336
|
-
set {
|
|
337
|
-
self.__iosAddPunctuation = { () -> bridge.std__optional_bool_ in
|
|
338
|
-
if let __unwrappedValue = newValue {
|
|
339
|
-
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
340
|
-
} else {
|
|
341
|
-
return .init()
|
|
342
|
-
}
|
|
343
|
-
}()
|
|
344
|
-
}
|
|
205
|
+
return { () -> Bool? in
|
|
206
|
+
if bridge.has_value_std__optional_bool_(self.__iosAddPunctuation) {
|
|
207
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__iosAddPunctuation)
|
|
208
|
+
return __unwrapped
|
|
209
|
+
} else {
|
|
210
|
+
return nil
|
|
211
|
+
}
|
|
212
|
+
}()
|
|
345
213
|
}
|
|
346
214
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNitroSpeechSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridNitroSpeechSpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridRecognizerSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridRecognizerSpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// SpeechToTextParams.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
// Forward declaration of `HapticFeedbackStyle` to properly resolve imports.
|
|
27
32
|
namespace margelo::nitro::nitrospeech { enum class HapticFeedbackStyle; }
|
|
@@ -36,7 +41,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
36
41
|
/**
|
|
37
42
|
* A struct which can be represented as a JavaScript object (SpeechToTextParams).
|
|
38
43
|
*/
|
|
39
|
-
struct SpeechToTextParams {
|
|
44
|
+
struct SpeechToTextParams final {
|
|
40
45
|
public:
|
|
41
46
|
std::optional<std::string> locale SWIFT_PRIVATE;
|
|
42
47
|
std::optional<double> autoFinishRecognitionMs SWIFT_PRIVATE;
|
|
@@ -53,6 +58,9 @@ namespace margelo::nitro::nitrospeech {
|
|
|
53
58
|
public:
|
|
54
59
|
SpeechToTextParams() = default;
|
|
55
60
|
explicit SpeechToTextParams(std::optional<std::string> locale, std::optional<double> autoFinishRecognitionMs, std::optional<bool> disableRepeatingFilter, std::optional<std::vector<std::string>> contextualStrings, std::optional<HapticFeedbackStyle> startHapticFeedbackStyle, std::optional<HapticFeedbackStyle> stopHapticFeedbackStyle, std::optional<bool> maskOffensiveWords, std::optional<bool> androidFormattingPreferQuality, std::optional<bool> androidUseWebSearchModel, std::optional<bool> androidDisableBatchHandling, std::optional<bool> iosAddPunctuation): locale(locale), autoFinishRecognitionMs(autoFinishRecognitionMs), disableRepeatingFilter(disableRepeatingFilter), contextualStrings(contextualStrings), startHapticFeedbackStyle(startHapticFeedbackStyle), stopHapticFeedbackStyle(stopHapticFeedbackStyle), maskOffensiveWords(maskOffensiveWords), androidFormattingPreferQuality(androidFormattingPreferQuality), androidUseWebSearchModel(androidUseWebSearchModel), androidDisableBatchHandling(androidDisableBatchHandling), iosAddPunctuation(iosAddPunctuation) {}
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
friend bool operator==(const SpeechToTextParams& lhs, const SpeechToTextParams& rhs) = default;
|
|
56
64
|
};
|
|
57
65
|
|
|
58
66
|
} // namespace margelo::nitro::nitrospeech
|
|
@@ -65,32 +73,32 @@ namespace margelo::nitro {
|
|
|
65
73
|
static inline margelo::nitro::nitrospeech::SpeechToTextParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
74
|
jsi::Object obj = arg.asObject(runtime);
|
|
67
75
|
return margelo::nitro::nitrospeech::SpeechToTextParams(
|
|
68
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "locale")),
|
|
69
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "autoFinishRecognitionMs")),
|
|
70
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "disableRepeatingFilter")),
|
|
71
|
-
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "contextualStrings")),
|
|
72
|
-
JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::fromJSI(runtime, obj.getProperty(runtime, "startHapticFeedbackStyle")),
|
|
73
|
-
JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::fromJSI(runtime, obj.getProperty(runtime, "stopHapticFeedbackStyle")),
|
|
74
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "maskOffensiveWords")),
|
|
75
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "androidFormattingPreferQuality")),
|
|
76
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "androidUseWebSearchModel")),
|
|
77
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "androidDisableBatchHandling")),
|
|
78
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "iosAddPunctuation"))
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locale"))),
|
|
77
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoFinishRecognitionMs"))),
|
|
78
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "disableRepeatingFilter"))),
|
|
79
|
+
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contextualStrings"))),
|
|
80
|
+
JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startHapticFeedbackStyle"))),
|
|
81
|
+
JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "stopHapticFeedbackStyle"))),
|
|
82
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskOffensiveWords"))),
|
|
83
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidFormattingPreferQuality"))),
|
|
84
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidUseWebSearchModel"))),
|
|
85
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidDisableBatchHandling"))),
|
|
86
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "iosAddPunctuation")))
|
|
79
87
|
);
|
|
80
88
|
}
|
|
81
89
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrospeech::SpeechToTextParams& arg) {
|
|
82
90
|
jsi::Object obj(runtime);
|
|
83
|
-
obj.setProperty(runtime, "locale", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.locale));
|
|
84
|
-
obj.setProperty(runtime, "autoFinishRecognitionMs", JSIConverter<std::optional<double>>::toJSI(runtime, arg.autoFinishRecognitionMs));
|
|
85
|
-
obj.setProperty(runtime, "disableRepeatingFilter", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.disableRepeatingFilter));
|
|
86
|
-
obj.setProperty(runtime, "contextualStrings", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.contextualStrings));
|
|
87
|
-
obj.setProperty(runtime, "startHapticFeedbackStyle", JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::toJSI(runtime, arg.startHapticFeedbackStyle));
|
|
88
|
-
obj.setProperty(runtime, "stopHapticFeedbackStyle", JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::toJSI(runtime, arg.stopHapticFeedbackStyle));
|
|
89
|
-
obj.setProperty(runtime, "maskOffensiveWords", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.maskOffensiveWords));
|
|
90
|
-
obj.setProperty(runtime, "androidFormattingPreferQuality", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidFormattingPreferQuality));
|
|
91
|
-
obj.setProperty(runtime, "androidUseWebSearchModel", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidUseWebSearchModel));
|
|
92
|
-
obj.setProperty(runtime, "androidDisableBatchHandling", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidDisableBatchHandling));
|
|
93
|
-
obj.setProperty(runtime, "iosAddPunctuation", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.iosAddPunctuation));
|
|
91
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "locale"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.locale));
|
|
92
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoFinishRecognitionMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.autoFinishRecognitionMs));
|
|
93
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "disableRepeatingFilter"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.disableRepeatingFilter));
|
|
94
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "contextualStrings"), JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.contextualStrings));
|
|
95
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "startHapticFeedbackStyle"), JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::toJSI(runtime, arg.startHapticFeedbackStyle));
|
|
96
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "stopHapticFeedbackStyle"), JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::toJSI(runtime, arg.stopHapticFeedbackStyle));
|
|
97
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maskOffensiveWords"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.maskOffensiveWords));
|
|
98
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "androidFormattingPreferQuality"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidFormattingPreferQuality));
|
|
99
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "androidUseWebSearchModel"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidUseWebSearchModel));
|
|
100
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "androidDisableBatchHandling"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidDisableBatchHandling));
|
|
101
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "iosAddPunctuation"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.iosAddPunctuation));
|
|
94
102
|
return obj;
|
|
95
103
|
}
|
|
96
104
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -101,17 +109,17 @@ namespace margelo::nitro {
|
|
|
101
109
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
102
110
|
return false;
|
|
103
111
|
}
|
|
104
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "locale"))) return false;
|
|
105
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "autoFinishRecognitionMs"))) return false;
|
|
106
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "disableRepeatingFilter"))) return false;
|
|
107
|
-
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "contextualStrings"))) return false;
|
|
108
|
-
if (!JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::canConvert(runtime, obj.getProperty(runtime, "startHapticFeedbackStyle"))) return false;
|
|
109
|
-
if (!JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::canConvert(runtime, obj.getProperty(runtime, "stopHapticFeedbackStyle"))) return false;
|
|
110
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "maskOffensiveWords"))) return false;
|
|
111
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "androidFormattingPreferQuality"))) return false;
|
|
112
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "androidUseWebSearchModel"))) return false;
|
|
113
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "androidDisableBatchHandling"))) return false;
|
|
114
|
-
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "iosAddPunctuation"))) return false;
|
|
112
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "locale")))) return false;
|
|
113
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoFinishRecognitionMs")))) return false;
|
|
114
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "disableRepeatingFilter")))) return false;
|
|
115
|
+
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contextualStrings")))) return false;
|
|
116
|
+
if (!JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startHapticFeedbackStyle")))) return false;
|
|
117
|
+
if (!JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "stopHapticFeedbackStyle")))) return false;
|
|
118
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maskOffensiveWords")))) return false;
|
|
119
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidFormattingPreferQuality")))) return false;
|
|
120
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidUseWebSearchModel")))) return false;
|
|
121
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidDisableBatchHandling")))) return false;
|
|
122
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "iosAddPunctuation")))) return false;
|
|
115
123
|
return true;
|
|
116
124
|
}
|
|
117
125
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmessier/nitro-speech",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React Native Speech Recognition Library powered by Nitro Modules",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
"recognition",
|
|
43
43
|
"speech-recognition",
|
|
44
44
|
"speech-to-text",
|
|
45
|
+
"SpeechAnalyzer",
|
|
46
|
+
"SpeechTranscriber",
|
|
47
|
+
"DictationTranscriber",
|
|
45
48
|
"stt",
|
|
46
49
|
"voice",
|
|
47
50
|
"voice-recognition",
|
|
@@ -74,11 +77,11 @@
|
|
|
74
77
|
"eslint": "^8.57.0",
|
|
75
78
|
"eslint-config-prettier": "^9.1.0",
|
|
76
79
|
"eslint-plugin-prettier": "^5.2.1",
|
|
77
|
-
"nitrogen": "*",
|
|
78
80
|
"prettier": "^3.3.3",
|
|
79
81
|
"react": "19.2.4",
|
|
80
82
|
"react-native": "0.84.1",
|
|
81
|
-
"react-native-nitro-modules": "0.
|
|
83
|
+
"react-native-nitro-modules": "0.35.0",
|
|
84
|
+
"nitrogen": "0.35.0",
|
|
82
85
|
"react-native-builder-bob": "0.37.0",
|
|
83
86
|
"typescript": "^5.8.3"
|
|
84
87
|
},
|