@gmessier/nitro-speech 0.1.2 → 0.2.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 +64 -11
- package/android/build.gradle +2 -0
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/HapticImpact.kt +11 -1
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/HybridRecognizer.kt +12 -6
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/RecognitionListenerSession.kt +73 -7
- package/ios/AnylyzerTranscriber.swift +331 -0
- package/ios/AutoStopper.swift +9 -10
- package/ios/BufferUtil.swift +80 -0
- package/ios/HapticImpact.swift +12 -3
- package/ios/HybridNitroSpeech.swift +10 -1
- package/ios/HybridRecognizer.swift +139 -167
- package/ios/LegacySpeechRecognizer.swift +161 -0
- package/lib/commonjs/index.js +54 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +52 -3
- package/lib/module/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/typescript/index.d.ts +25 -8
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/specs/NitroSpeech.nitro.d.ts +24 -12
- package/lib/typescript/specs/NitroSpeech.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHapticFeedbackStyle.hpp +3 -0
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.cpp +22 -0
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.hpp +3 -0
- package/nitrogen/generated/android/c++/JSpeechToTextParams.hpp +4 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HapticFeedbackStyle.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HybridRecognizerSpec.kt +18 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/SpeechToTextParams.kt +3 -3
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Bridge.hpp +24 -0
- package/nitrogen/generated/ios/c++/HybridRecognizerSpecSwift.hpp +15 -0
- package/nitrogen/generated/ios/swift/HapticFeedbackStyle.swift +4 -0
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec_cxx.swift +44 -0
- package/nitrogen/generated/ios/swift/SpeechToTextParams.swift +6 -6
- package/nitrogen/generated/shared/c++/HapticFeedbackStyle.hpp +4 -0
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/SpeechToTextParams.hpp +5 -5
- package/package.json +7 -7
- package/src/index.ts +59 -2
- package/src/specs/NitroSpeech.nitro.ts +25 -12
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { type HybridObject } from 'react-native-nitro-modules';
|
|
2
2
|
interface ParamsAndroid {
|
|
3
|
-
/**
|
|
4
|
-
* Default - false
|
|
5
|
-
*
|
|
6
|
-
* Min Android 13
|
|
7
|
-
*/
|
|
8
|
-
androidMaskOffensiveWords?: boolean;
|
|
9
3
|
/**
|
|
10
4
|
* Default - false
|
|
11
5
|
*
|
|
12
6
|
* Prefer quality over latency (may break autofinish timing, depends on engine)
|
|
13
7
|
*
|
|
14
|
-
*
|
|
8
|
+
* Android 13+
|
|
15
9
|
*/
|
|
16
10
|
androidFormattingPreferQuality?: boolean;
|
|
17
11
|
/**
|
|
@@ -37,11 +31,11 @@ interface ParamsIOS {
|
|
|
37
31
|
*
|
|
38
32
|
* Adds punctuation to speech recognition results
|
|
39
33
|
*
|
|
40
|
-
*
|
|
34
|
+
* iOS 16+
|
|
41
35
|
*/
|
|
42
36
|
iosAddPunctuation?: boolean;
|
|
43
37
|
}
|
|
44
|
-
type HapticFeedbackStyle = 'light' | 'medium' | 'heavy';
|
|
38
|
+
type HapticFeedbackStyle = 'light' | 'medium' | 'heavy' | 'none';
|
|
45
39
|
export interface SpeechToTextParams extends ParamsAndroid, ParamsIOS {
|
|
46
40
|
/**
|
|
47
41
|
* Default - "en-US"
|
|
@@ -64,17 +58,25 @@ export interface SpeechToTextParams extends ParamsAndroid, ParamsIOS {
|
|
|
64
58
|
*/
|
|
65
59
|
contextualStrings?: string[];
|
|
66
60
|
/**
|
|
67
|
-
* Default -
|
|
61
|
+
* Default - "medium"
|
|
68
62
|
*
|
|
69
63
|
* Haptic feedback style when microphone starts recording.
|
|
70
64
|
*/
|
|
71
65
|
startHapticFeedbackStyle?: HapticFeedbackStyle;
|
|
72
66
|
/**
|
|
73
|
-
* Default -
|
|
67
|
+
* Default - "medium"
|
|
74
68
|
*
|
|
75
69
|
* Haptic feedback style when microphone stops recording.
|
|
76
70
|
*/
|
|
77
71
|
stopHapticFeedbackStyle?: HapticFeedbackStyle;
|
|
72
|
+
/**
|
|
73
|
+
* Default - false
|
|
74
|
+
*
|
|
75
|
+
* Android 13+
|
|
76
|
+
*
|
|
77
|
+
* iOS 26+ (iOS <26: always `false`)
|
|
78
|
+
*/
|
|
79
|
+
maskOffensiveWords?: boolean;
|
|
78
80
|
}
|
|
79
81
|
export interface Recognizer extends HybridObject<{
|
|
80
82
|
ios: 'swift';
|
|
@@ -111,12 +113,16 @@ export interface Recognizer extends HybridObject<{
|
|
|
111
113
|
* @param withRefresh - if true, will refresh the auto finish progress.
|
|
112
114
|
*/
|
|
113
115
|
updateAutoFinishTime(newTimeMs: number, withRefresh?: boolean): void;
|
|
116
|
+
/**
|
|
117
|
+
* Returns true if the speech recognition is active.
|
|
118
|
+
*/
|
|
119
|
+
getIsActive(): boolean;
|
|
114
120
|
/**
|
|
115
121
|
* The speech recognition has started.
|
|
116
122
|
*/
|
|
117
123
|
onReadyForSpeech?: () => void;
|
|
118
124
|
/**
|
|
119
|
-
* Audio recording has stopped.
|
|
125
|
+
* Audio recording has stopped.
|
|
120
126
|
*/
|
|
121
127
|
onRecordingStopped?: () => void;
|
|
122
128
|
/**
|
|
@@ -139,6 +145,12 @@ export interface Recognizer extends HybridObject<{
|
|
|
139
145
|
* Permission to record audio has been denied.
|
|
140
146
|
*/
|
|
141
147
|
onPermissionDenied?: () => void;
|
|
148
|
+
/**
|
|
149
|
+
* Called with arbitrary frequency (many times per second) while audio recording is active.
|
|
150
|
+
*
|
|
151
|
+
* Voice input volume normalized to a range of 0 to 1.
|
|
152
|
+
*/
|
|
153
|
+
onVolumeChange?: (normVolume: number) => void;
|
|
142
154
|
}
|
|
143
155
|
export interface NitroSpeech extends HybridObject<{
|
|
144
156
|
ios: 'swift';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NitroSpeech.nitro.d.ts","sourceRoot":"","sources":["../../../src/specs/NitroSpeech.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,UAAU,aAAa;IACrB
|
|
1
|
+
{"version":3,"file":"NitroSpeech.nitro.d.ts","sourceRoot":"","sources":["../../../src/specs/NitroSpeech.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,UAAU,aAAa;IACrB;;;;;;OAMG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAA;IACxC;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC;AAED,UAAU,SAAS;IACjB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,KAAK,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,aAAa,EAAE,SAAS;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,mBAAmB,CAAA;IAC9C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,mBAAmB,CAAA;IAC7C;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC;IAC/C,GAAG,EAAE,OAAO,CAAA;IACZ,OAAO,EAAE,QAAQ,CAAA;CAClB,CAAC;IACA;;;;OAIG;IACH,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAChD;;;;;;OAMG;IACH,aAAa,IAAI,IAAI,CAAA;IAErB;;;;;;OAMG;IACH,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAElD;;;;;;;OAOG;IACH,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAEpE;;OAEG;IACH,WAAW,IAAI,OAAO,CAAA;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC5C;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9C;AAED,MAAM,WAAW,WAAY,SAAQ,YAAY,CAAC;IAChD,GAAG,EAAE,OAAO,CAAA;IACZ,OAAO,EAAE,QAAQ,CAAA;CAClB,CAAC;IACA,UAAU,EAAE,UAAU,CAAA;CACvB"}
|
|
@@ -44,6 +44,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
44
44
|
static const auto fieldLIGHT = clazz->getStaticField<JHapticFeedbackStyle>("LIGHT");
|
|
45
45
|
static const auto fieldMEDIUM = clazz->getStaticField<JHapticFeedbackStyle>("MEDIUM");
|
|
46
46
|
static const auto fieldHEAVY = clazz->getStaticField<JHapticFeedbackStyle>("HEAVY");
|
|
47
|
+
static const auto fieldNONE = clazz->getStaticField<JHapticFeedbackStyle>("NONE");
|
|
47
48
|
|
|
48
49
|
switch (value) {
|
|
49
50
|
case HapticFeedbackStyle::LIGHT:
|
|
@@ -52,6 +53,8 @@ namespace margelo::nitro::nitrospeech {
|
|
|
52
53
|
return clazz->getStaticFieldValue(fieldMEDIUM);
|
|
53
54
|
case HapticFeedbackStyle::HEAVY:
|
|
54
55
|
return clazz->getStaticFieldValue(fieldHEAVY);
|
|
56
|
+
case HapticFeedbackStyle::NONE:
|
|
57
|
+
return clazz->getStaticFieldValue(fieldNONE);
|
|
55
58
|
default:
|
|
56
59
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
57
60
|
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
@@ -157,6 +157,23 @@ namespace margelo::nitro::nitrospeech {
|
|
|
157
157
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onPermissionDenied */)>("setOnPermissionDenied_cxx");
|
|
158
158
|
method(_javaPart, onPermissionDenied.has_value() ? JFunc_void_cxx::fromCpp(onPermissionDenied.value()) : nullptr);
|
|
159
159
|
}
|
|
160
|
+
std::optional<std::function<void(double /* normVolume */)>> JHybridRecognizerSpec::getOnVolumeChange() {
|
|
161
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_double::javaobject>()>("getOnVolumeChange_cxx");
|
|
162
|
+
auto __result = method(_javaPart);
|
|
163
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(double /* normVolume */)> {
|
|
164
|
+
if (__result->isInstanceOf(JFunc_void_double_cxx::javaClassStatic())) [[likely]] {
|
|
165
|
+
auto downcast = jni::static_ref_cast<JFunc_void_double_cxx::javaobject>(__result);
|
|
166
|
+
return downcast->cthis()->getFunction();
|
|
167
|
+
} else {
|
|
168
|
+
auto __resultRef = jni::make_global(__result);
|
|
169
|
+
return JNICallable<JFunc_void_double, void(double)>(std::move(__resultRef));
|
|
170
|
+
}
|
|
171
|
+
}()) : std::nullopt;
|
|
172
|
+
}
|
|
173
|
+
void JHybridRecognizerSpec::setOnVolumeChange(const std::optional<std::function<void(double /* normVolume */)>>& onVolumeChange) {
|
|
174
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_double::javaobject> /* onVolumeChange */)>("setOnVolumeChange_cxx");
|
|
175
|
+
method(_javaPart, onVolumeChange.has_value() ? JFunc_void_double_cxx::fromCpp(onVolumeChange.value()) : nullptr);
|
|
176
|
+
}
|
|
160
177
|
|
|
161
178
|
// Methods
|
|
162
179
|
void JHybridRecognizerSpec::startListening(const SpeechToTextParams& params) {
|
|
@@ -175,5 +192,10 @@ namespace margelo::nitro::nitrospeech {
|
|
|
175
192
|
static const auto method = javaClassStatic()->getMethod<void(double /* newTimeMs */, jni::alias_ref<jni::JBoolean> /* withRefresh */)>("updateAutoFinishTime");
|
|
176
193
|
method(_javaPart, newTimeMs, withRefresh.has_value() ? jni::JBoolean::valueOf(withRefresh.value()) : nullptr);
|
|
177
194
|
}
|
|
195
|
+
bool JHybridRecognizerSpec::getIsActive() {
|
|
196
|
+
static const auto method = javaClassStatic()->getMethod<jboolean()>("getIsActive");
|
|
197
|
+
auto __result = method(_javaPart);
|
|
198
|
+
return static_cast<bool>(__result);
|
|
199
|
+
}
|
|
178
200
|
|
|
179
201
|
} // namespace margelo::nitro::nitrospeech
|
|
@@ -62,6 +62,8 @@ namespace margelo::nitro::nitrospeech {
|
|
|
62
62
|
void setOnError(const std::optional<std::function<void(const std::string& /* message */)>>& onError) override;
|
|
63
63
|
std::optional<std::function<void()>> getOnPermissionDenied() override;
|
|
64
64
|
void setOnPermissionDenied(const std::optional<std::function<void()>>& onPermissionDenied) override;
|
|
65
|
+
std::optional<std::function<void(double /* normVolume */)>> getOnVolumeChange() override;
|
|
66
|
+
void setOnVolumeChange(const std::optional<std::function<void(double /* normVolume */)>>& onVolumeChange) override;
|
|
65
67
|
|
|
66
68
|
public:
|
|
67
69
|
// Methods
|
|
@@ -69,6 +71,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
69
71
|
void stopListening() override;
|
|
70
72
|
void addAutoFinishTime(std::optional<double> additionalTimeMs) override;
|
|
71
73
|
void updateAutoFinishTime(double newTimeMs, std::optional<bool> withRefresh) override;
|
|
74
|
+
bool getIsActive() override;
|
|
72
75
|
|
|
73
76
|
private:
|
|
74
77
|
friend HybridBase;
|
|
@@ -47,8 +47,8 @@ namespace margelo::nitro::nitrospeech {
|
|
|
47
47
|
jni::local_ref<JHapticFeedbackStyle> startHapticFeedbackStyle = this->getFieldValue(fieldStartHapticFeedbackStyle);
|
|
48
48
|
static const auto fieldStopHapticFeedbackStyle = clazz->getField<JHapticFeedbackStyle>("stopHapticFeedbackStyle");
|
|
49
49
|
jni::local_ref<JHapticFeedbackStyle> stopHapticFeedbackStyle = this->getFieldValue(fieldStopHapticFeedbackStyle);
|
|
50
|
-
static const auto
|
|
51
|
-
jni::local_ref<jni::JBoolean>
|
|
50
|
+
static const auto fieldMaskOffensiveWords = clazz->getField<jni::JBoolean>("maskOffensiveWords");
|
|
51
|
+
jni::local_ref<jni::JBoolean> maskOffensiveWords = this->getFieldValue(fieldMaskOffensiveWords);
|
|
52
52
|
static const auto fieldAndroidFormattingPreferQuality = clazz->getField<jni::JBoolean>("androidFormattingPreferQuality");
|
|
53
53
|
jni::local_ref<jni::JBoolean> androidFormattingPreferQuality = this->getFieldValue(fieldAndroidFormattingPreferQuality);
|
|
54
54
|
static const auto fieldAndroidUseWebSearchModel = clazz->getField<jni::JBoolean>("androidUseWebSearchModel");
|
|
@@ -73,7 +73,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
73
73
|
}()) : std::nullopt,
|
|
74
74
|
startHapticFeedbackStyle != nullptr ? std::make_optional(startHapticFeedbackStyle->toCpp()) : std::nullopt,
|
|
75
75
|
stopHapticFeedbackStyle != nullptr ? std::make_optional(stopHapticFeedbackStyle->toCpp()) : std::nullopt,
|
|
76
|
-
|
|
76
|
+
maskOffensiveWords != nullptr ? std::make_optional(static_cast<bool>(maskOffensiveWords->value())) : std::nullopt,
|
|
77
77
|
androidFormattingPreferQuality != nullptr ? std::make_optional(static_cast<bool>(androidFormattingPreferQuality->value())) : std::nullopt,
|
|
78
78
|
androidUseWebSearchModel != nullptr ? std::make_optional(static_cast<bool>(androidUseWebSearchModel->value())) : std::nullopt,
|
|
79
79
|
androidDisableBatchHandling != nullptr ? std::make_optional(static_cast<bool>(androidDisableBatchHandling->value())) : std::nullopt,
|
|
@@ -107,7 +107,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
107
107
|
}() : nullptr,
|
|
108
108
|
value.startHapticFeedbackStyle.has_value() ? JHapticFeedbackStyle::fromCpp(value.startHapticFeedbackStyle.value()) : nullptr,
|
|
109
109
|
value.stopHapticFeedbackStyle.has_value() ? JHapticFeedbackStyle::fromCpp(value.stopHapticFeedbackStyle.value()) : nullptr,
|
|
110
|
-
value.
|
|
110
|
+
value.maskOffensiveWords.has_value() ? jni::JBoolean::valueOf(value.maskOffensiveWords.value()) : nullptr,
|
|
111
111
|
value.androidFormattingPreferQuality.has_value() ? jni::JBoolean::valueOf(value.androidFormattingPreferQuality.value()) : nullptr,
|
|
112
112
|
value.androidUseWebSearchModel.has_value() ? jni::JBoolean::valueOf(value.androidUseWebSearchModel.value()) : nullptr,
|
|
113
113
|
value.androidDisableBatchHandling.has_value() ? jni::JBoolean::valueOf(value.androidDisableBatchHandling.value()) : nullptr,
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HybridRecognizerSpec.kt
CHANGED
|
@@ -125,6 +125,20 @@ abstract class HybridRecognizerSpec: HybridObject() {
|
|
|
125
125
|
set(value) {
|
|
126
126
|
onPermissionDenied = value?.let { it }
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
abstract var onVolumeChange: ((normVolume: Double) -> Unit)?
|
|
130
|
+
|
|
131
|
+
private var onVolumeChange_cxx: Func_void_double?
|
|
132
|
+
@Keep
|
|
133
|
+
@DoNotStrip
|
|
134
|
+
get() {
|
|
135
|
+
return onVolumeChange?.let { Func_void_double_java(it) }
|
|
136
|
+
}
|
|
137
|
+
@Keep
|
|
138
|
+
@DoNotStrip
|
|
139
|
+
set(value) {
|
|
140
|
+
onVolumeChange = value?.let { it }
|
|
141
|
+
}
|
|
128
142
|
|
|
129
143
|
// Methods
|
|
130
144
|
@DoNotStrip
|
|
@@ -142,6 +156,10 @@ abstract class HybridRecognizerSpec: HybridObject() {
|
|
|
142
156
|
@DoNotStrip
|
|
143
157
|
@Keep
|
|
144
158
|
abstract fun updateAutoFinishTime(newTimeMs: Double, withRefresh: Boolean?): Unit
|
|
159
|
+
|
|
160
|
+
@DoNotStrip
|
|
161
|
+
@Keep
|
|
162
|
+
abstract fun getIsActive(): Boolean
|
|
145
163
|
|
|
146
164
|
private external fun initHybrid(): HybridData
|
|
147
165
|
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/SpeechToTextParams.kt
CHANGED
|
@@ -37,7 +37,7 @@ data class SpeechToTextParams(
|
|
|
37
37
|
val stopHapticFeedbackStyle: HapticFeedbackStyle?,
|
|
38
38
|
@DoNotStrip
|
|
39
39
|
@Keep
|
|
40
|
-
val
|
|
40
|
+
val maskOffensiveWords: Boolean?,
|
|
41
41
|
@DoNotStrip
|
|
42
42
|
@Keep
|
|
43
43
|
val androidFormattingPreferQuality: Boolean?,
|
|
@@ -61,8 +61,8 @@ data class SpeechToTextParams(
|
|
|
61
61
|
@Keep
|
|
62
62
|
@Suppress("unused")
|
|
63
63
|
@JvmStatic
|
|
64
|
-
private fun fromCpp(locale: String?, autoFinishRecognitionMs: Double?, disableRepeatingFilter: Boolean?, contextualStrings: Array<String>?, startHapticFeedbackStyle: HapticFeedbackStyle?, stopHapticFeedbackStyle: HapticFeedbackStyle?,
|
|
65
|
-
return SpeechToTextParams(locale, autoFinishRecognitionMs, disableRepeatingFilter, contextualStrings, startHapticFeedbackStyle, stopHapticFeedbackStyle,
|
|
64
|
+
private fun fromCpp(locale: String?, autoFinishRecognitionMs: Double?, disableRepeatingFilter: Boolean?, contextualStrings: Array<String>?, startHapticFeedbackStyle: HapticFeedbackStyle?, stopHapticFeedbackStyle: HapticFeedbackStyle?, maskOffensiveWords: Boolean?, androidFormattingPreferQuality: Boolean?, androidUseWebSearchModel: Boolean?, androidDisableBatchHandling: Boolean?, iosAddPunctuation: Boolean?): SpeechToTextParams {
|
|
65
|
+
return SpeechToTextParams(locale, autoFinishRecognitionMs, disableRepeatingFilter, contextualStrings, startHapticFeedbackStyle, stopHapticFeedbackStyle, maskOffensiveWords, androidFormattingPreferQuality, androidUseWebSearchModel, androidDisableBatchHandling, iosAddPunctuation)
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -273,6 +273,21 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
273
273
|
return *optional;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
// pragma MARK: std::optional<std::function<void(double /* normVolume */)>>
|
|
277
|
+
/**
|
|
278
|
+
* Specialized version of `std::optional<std::function<void(double / * normVolume * /)>>`.
|
|
279
|
+
*/
|
|
280
|
+
using std__optional_std__function_void_double____normVolume______ = std::optional<std::function<void(double /* normVolume */)>>;
|
|
281
|
+
inline std::optional<std::function<void(double /* normVolume */)>> create_std__optional_std__function_void_double____normVolume______(const std::function<void(double /* normVolume */)>& value) noexcept {
|
|
282
|
+
return std::optional<std::function<void(double /* normVolume */)>>(value);
|
|
283
|
+
}
|
|
284
|
+
inline bool has_value_std__optional_std__function_void_double____normVolume______(const std::optional<std::function<void(double /* normVolume */)>>& optional) noexcept {
|
|
285
|
+
return optional.has_value();
|
|
286
|
+
}
|
|
287
|
+
inline std::function<void(double /* normVolume */)> get_std__optional_std__function_void_double____normVolume______(const std::optional<std::function<void(double /* normVolume */)>>& optional) noexcept {
|
|
288
|
+
return *optional;
|
|
289
|
+
}
|
|
290
|
+
|
|
276
291
|
// pragma MARK: std::shared_ptr<HybridRecognizerSpec>
|
|
277
292
|
/**
|
|
278
293
|
* Specialized version of `std::shared_ptr<HybridRecognizerSpec>`.
|
|
@@ -294,6 +309,15 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
294
309
|
return Result<void>::withError(error);
|
|
295
310
|
}
|
|
296
311
|
|
|
312
|
+
// pragma MARK: Result<bool>
|
|
313
|
+
using Result_bool_ = Result<bool>;
|
|
314
|
+
inline Result_bool_ create_Result_bool_(bool value) noexcept {
|
|
315
|
+
return Result<bool>::withValue(std::move(value));
|
|
316
|
+
}
|
|
317
|
+
inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
|
|
318
|
+
return Result<bool>::withError(error);
|
|
319
|
+
}
|
|
320
|
+
|
|
297
321
|
// pragma MARK: std::shared_ptr<HybridNitroSpeechSpec>
|
|
298
322
|
/**
|
|
299
323
|
* Specialized version of `std::shared_ptr<HybridNitroSpeechSpec>`.
|
|
@@ -106,6 +106,13 @@ namespace margelo::nitro::nitrospeech {
|
|
|
106
106
|
inline void setOnPermissionDenied(const std::optional<std::function<void()>>& onPermissionDenied) noexcept override {
|
|
107
107
|
_swiftPart.setOnPermissionDenied(onPermissionDenied);
|
|
108
108
|
}
|
|
109
|
+
inline std::optional<std::function<void(double /* normVolume */)>> getOnVolumeChange() noexcept override {
|
|
110
|
+
auto __result = _swiftPart.getOnVolumeChange();
|
|
111
|
+
return __result;
|
|
112
|
+
}
|
|
113
|
+
inline void setOnVolumeChange(const std::optional<std::function<void(double /* normVolume */)>>& onVolumeChange) noexcept override {
|
|
114
|
+
_swiftPart.setOnVolumeChange(onVolumeChange);
|
|
115
|
+
}
|
|
109
116
|
|
|
110
117
|
public:
|
|
111
118
|
// Methods
|
|
@@ -133,6 +140,14 @@ namespace margelo::nitro::nitrospeech {
|
|
|
133
140
|
std::rethrow_exception(__result.error());
|
|
134
141
|
}
|
|
135
142
|
}
|
|
143
|
+
inline bool getIsActive() override {
|
|
144
|
+
auto __result = _swiftPart.getIsActive();
|
|
145
|
+
if (__result.hasError()) [[unlikely]] {
|
|
146
|
+
std::rethrow_exception(__result.error());
|
|
147
|
+
}
|
|
148
|
+
auto __value = std::move(__result.value());
|
|
149
|
+
return __value;
|
|
150
|
+
}
|
|
136
151
|
|
|
137
152
|
private:
|
|
138
153
|
NitroSpeech::HybridRecognizerSpec_cxx _swiftPart;
|
|
@@ -23,6 +23,8 @@ public extension HapticFeedbackStyle {
|
|
|
23
23
|
self = .medium
|
|
24
24
|
case "heavy":
|
|
25
25
|
self = .heavy
|
|
26
|
+
case "none":
|
|
27
|
+
self = .none
|
|
26
28
|
default:
|
|
27
29
|
return nil
|
|
28
30
|
}
|
|
@@ -39,6 +41,8 @@ public extension HapticFeedbackStyle {
|
|
|
39
41
|
return "medium"
|
|
40
42
|
case .heavy:
|
|
41
43
|
return "heavy"
|
|
44
|
+
case .none:
|
|
45
|
+
return "none"
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
}
|
|
@@ -17,12 +17,14 @@ public protocol HybridRecognizerSpec_protocol: HybridObject {
|
|
|
17
17
|
var onAutoFinishProgress: ((_ timeLeftMs: Double) -> Void)? { get set }
|
|
18
18
|
var onError: ((_ message: String) -> Void)? { get set }
|
|
19
19
|
var onPermissionDenied: (() -> Void)? { get set }
|
|
20
|
+
var onVolumeChange: ((_ normVolume: Double) -> Void)? { get set }
|
|
20
21
|
|
|
21
22
|
// Methods
|
|
22
23
|
func startListening(params: SpeechToTextParams) throws -> Void
|
|
23
24
|
func stopListening() throws -> Void
|
|
24
25
|
func addAutoFinishTime(additionalTimeMs: Double?) throws -> Void
|
|
25
26
|
func updateAutoFinishTime(newTimeMs: Double, withRefresh: Bool?) throws -> Void
|
|
27
|
+
func getIsActive() throws -> Bool
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
public extension HybridRecognizerSpec_protocol {
|
|
@@ -311,6 +311,38 @@ open class HybridRecognizerSpec_cxx {
|
|
|
311
311
|
}()
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
+
|
|
315
|
+
public final var onVolumeChange: bridge.std__optional_std__function_void_double____normVolume______ {
|
|
316
|
+
@inline(__always)
|
|
317
|
+
get {
|
|
318
|
+
return { () -> bridge.std__optional_std__function_void_double____normVolume______ in
|
|
319
|
+
if let __unwrappedValue = self.__implementation.onVolumeChange {
|
|
320
|
+
return bridge.create_std__optional_std__function_void_double____normVolume______({ () -> bridge.Func_void_double in
|
|
321
|
+
let __closureWrapper = Func_void_double(__unwrappedValue)
|
|
322
|
+
return bridge.create_Func_void_double(__closureWrapper.toUnsafe())
|
|
323
|
+
}())
|
|
324
|
+
} else {
|
|
325
|
+
return .init()
|
|
326
|
+
}
|
|
327
|
+
}()
|
|
328
|
+
}
|
|
329
|
+
@inline(__always)
|
|
330
|
+
set {
|
|
331
|
+
self.__implementation.onVolumeChange = { () -> ((_ normVolume: Double) -> Void)? in
|
|
332
|
+
if bridge.has_value_std__optional_std__function_void_double____normVolume______(newValue) {
|
|
333
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_double____normVolume______(newValue)
|
|
334
|
+
return { () -> (Double) -> Void in
|
|
335
|
+
let __wrappedFunction = bridge.wrap_Func_void_double(__unwrapped)
|
|
336
|
+
return { (__normVolume: Double) -> Void in
|
|
337
|
+
__wrappedFunction.call(__normVolume)
|
|
338
|
+
}
|
|
339
|
+
}()
|
|
340
|
+
} else {
|
|
341
|
+
return nil
|
|
342
|
+
}
|
|
343
|
+
}()
|
|
344
|
+
}
|
|
345
|
+
}
|
|
314
346
|
|
|
315
347
|
// Methods
|
|
316
348
|
@inline(__always)
|
|
@@ -363,4 +395,16 @@ open class HybridRecognizerSpec_cxx {
|
|
|
363
395
|
return bridge.create_Result_void_(__exceptionPtr)
|
|
364
396
|
}
|
|
365
397
|
}
|
|
398
|
+
|
|
399
|
+
@inline(__always)
|
|
400
|
+
public final func getIsActive() -> bridge.Result_bool_ {
|
|
401
|
+
do {
|
|
402
|
+
let __result = try self.__implementation.getIsActive()
|
|
403
|
+
let __resultCpp = __result
|
|
404
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
405
|
+
} catch (let __error) {
|
|
406
|
+
let __exceptionPtr = __error.toCpp()
|
|
407
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
408
|
+
}
|
|
409
|
+
}
|
|
366
410
|
}
|
|
@@ -19,7 +19,7 @@ public extension SpeechToTextParams {
|
|
|
19
19
|
/**
|
|
20
20
|
* Create a new instance of `SpeechToTextParams`.
|
|
21
21
|
*/
|
|
22
|
-
init(locale: String?, autoFinishRecognitionMs: Double?, disableRepeatingFilter: Bool?, contextualStrings: [String]?, startHapticFeedbackStyle: HapticFeedbackStyle?, stopHapticFeedbackStyle: HapticFeedbackStyle?,
|
|
22
|
+
init(locale: String?, autoFinishRecognitionMs: Double?, disableRepeatingFilter: Bool?, contextualStrings: [String]?, startHapticFeedbackStyle: HapticFeedbackStyle?, stopHapticFeedbackStyle: HapticFeedbackStyle?, maskOffensiveWords: Bool?, androidFormattingPreferQuality: Bool?, androidUseWebSearchModel: Bool?, androidDisableBatchHandling: Bool?, iosAddPunctuation: Bool?) {
|
|
23
23
|
self.init({ () -> bridge.std__optional_std__string_ in
|
|
24
24
|
if let __unwrappedValue = locale {
|
|
25
25
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
@@ -63,7 +63,7 @@ public extension SpeechToTextParams {
|
|
|
63
63
|
return .init()
|
|
64
64
|
}
|
|
65
65
|
}(), { () -> bridge.std__optional_bool_ in
|
|
66
|
-
if let __unwrappedValue =
|
|
66
|
+
if let __unwrappedValue = maskOffensiveWords {
|
|
67
67
|
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
68
68
|
} else {
|
|
69
69
|
return .init()
|
|
@@ -224,12 +224,12 @@ public extension SpeechToTextParams {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
var
|
|
227
|
+
var maskOffensiveWords: Bool? {
|
|
228
228
|
@inline(__always)
|
|
229
229
|
get {
|
|
230
230
|
return { () -> Bool? in
|
|
231
|
-
if bridge.has_value_std__optional_bool_(self.
|
|
232
|
-
let __unwrapped = bridge.get_std__optional_bool_(self.
|
|
231
|
+
if bridge.has_value_std__optional_bool_(self.__maskOffensiveWords) {
|
|
232
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__maskOffensiveWords)
|
|
233
233
|
return __unwrapped
|
|
234
234
|
} else {
|
|
235
235
|
return nil
|
|
@@ -238,7 +238,7 @@ public extension SpeechToTextParams {
|
|
|
238
238
|
}
|
|
239
239
|
@inline(__always)
|
|
240
240
|
set {
|
|
241
|
-
self.
|
|
241
|
+
self.__maskOffensiveWords = { () -> bridge.std__optional_bool_ in
|
|
242
242
|
if let __unwrappedValue = newValue {
|
|
243
243
|
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
244
244
|
} else {
|
|
@@ -32,6 +32,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
32
32
|
LIGHT SWIFT_NAME(light) = 0,
|
|
33
33
|
MEDIUM SWIFT_NAME(medium) = 1,
|
|
34
34
|
HEAVY SWIFT_NAME(heavy) = 2,
|
|
35
|
+
NONE SWIFT_NAME(none) = 3,
|
|
35
36
|
} CLOSED_ENUM;
|
|
36
37
|
|
|
37
38
|
} // namespace margelo::nitro::nitrospeech
|
|
@@ -47,6 +48,7 @@ namespace margelo::nitro {
|
|
|
47
48
|
case hashString("light"): return margelo::nitro::nitrospeech::HapticFeedbackStyle::LIGHT;
|
|
48
49
|
case hashString("medium"): return margelo::nitro::nitrospeech::HapticFeedbackStyle::MEDIUM;
|
|
49
50
|
case hashString("heavy"): return margelo::nitro::nitrospeech::HapticFeedbackStyle::HEAVY;
|
|
51
|
+
case hashString("none"): return margelo::nitro::nitrospeech::HapticFeedbackStyle::NONE;
|
|
50
52
|
default: [[unlikely]]
|
|
51
53
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum HapticFeedbackStyle - invalid value!");
|
|
52
54
|
}
|
|
@@ -56,6 +58,7 @@ namespace margelo::nitro {
|
|
|
56
58
|
case margelo::nitro::nitrospeech::HapticFeedbackStyle::LIGHT: return JSIConverter<std::string>::toJSI(runtime, "light");
|
|
57
59
|
case margelo::nitro::nitrospeech::HapticFeedbackStyle::MEDIUM: return JSIConverter<std::string>::toJSI(runtime, "medium");
|
|
58
60
|
case margelo::nitro::nitrospeech::HapticFeedbackStyle::HEAVY: return JSIConverter<std::string>::toJSI(runtime, "heavy");
|
|
61
|
+
case margelo::nitro::nitrospeech::HapticFeedbackStyle::NONE: return JSIConverter<std::string>::toJSI(runtime, "none");
|
|
59
62
|
default: [[unlikely]]
|
|
60
63
|
throw std::invalid_argument("Cannot convert HapticFeedbackStyle to JS - invalid value: "
|
|
61
64
|
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
@@ -70,6 +73,7 @@ namespace margelo::nitro {
|
|
|
70
73
|
case hashString("light"):
|
|
71
74
|
case hashString("medium"):
|
|
72
75
|
case hashString("heavy"):
|
|
76
|
+
case hashString("none"):
|
|
73
77
|
return true;
|
|
74
78
|
default:
|
|
75
79
|
return false;
|
|
@@ -26,10 +26,13 @@ namespace margelo::nitro::nitrospeech {
|
|
|
26
26
|
prototype.registerHybridSetter("onError", &HybridRecognizerSpec::setOnError);
|
|
27
27
|
prototype.registerHybridGetter("onPermissionDenied", &HybridRecognizerSpec::getOnPermissionDenied);
|
|
28
28
|
prototype.registerHybridSetter("onPermissionDenied", &HybridRecognizerSpec::setOnPermissionDenied);
|
|
29
|
+
prototype.registerHybridGetter("onVolumeChange", &HybridRecognizerSpec::getOnVolumeChange);
|
|
30
|
+
prototype.registerHybridSetter("onVolumeChange", &HybridRecognizerSpec::setOnVolumeChange);
|
|
29
31
|
prototype.registerHybridMethod("startListening", &HybridRecognizerSpec::startListening);
|
|
30
32
|
prototype.registerHybridMethod("stopListening", &HybridRecognizerSpec::stopListening);
|
|
31
33
|
prototype.registerHybridMethod("addAutoFinishTime", &HybridRecognizerSpec::addAutoFinishTime);
|
|
32
34
|
prototype.registerHybridMethod("updateAutoFinishTime", &HybridRecognizerSpec::updateAutoFinishTime);
|
|
35
|
+
prototype.registerHybridMethod("getIsActive", &HybridRecognizerSpec::getIsActive);
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -61,6 +61,8 @@ namespace margelo::nitro::nitrospeech {
|
|
|
61
61
|
virtual void setOnError(const std::optional<std::function<void(const std::string& /* message */)>>& onError) = 0;
|
|
62
62
|
virtual std::optional<std::function<void()>> getOnPermissionDenied() = 0;
|
|
63
63
|
virtual void setOnPermissionDenied(const std::optional<std::function<void()>>& onPermissionDenied) = 0;
|
|
64
|
+
virtual std::optional<std::function<void(double /* normVolume */)>> getOnVolumeChange() = 0;
|
|
65
|
+
virtual void setOnVolumeChange(const std::optional<std::function<void(double /* normVolume */)>>& onVolumeChange) = 0;
|
|
64
66
|
|
|
65
67
|
public:
|
|
66
68
|
// Methods
|
|
@@ -68,6 +70,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
68
70
|
virtual void stopListening() = 0;
|
|
69
71
|
virtual void addAutoFinishTime(std::optional<double> additionalTimeMs) = 0;
|
|
70
72
|
virtual void updateAutoFinishTime(double newTimeMs, std::optional<bool> withRefresh) = 0;
|
|
73
|
+
virtual bool getIsActive() = 0;
|
|
71
74
|
|
|
72
75
|
protected:
|
|
73
76
|
// Hybrid Setup
|
|
@@ -44,7 +44,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
44
44
|
std::optional<std::vector<std::string>> contextualStrings SWIFT_PRIVATE;
|
|
45
45
|
std::optional<HapticFeedbackStyle> startHapticFeedbackStyle SWIFT_PRIVATE;
|
|
46
46
|
std::optional<HapticFeedbackStyle> stopHapticFeedbackStyle SWIFT_PRIVATE;
|
|
47
|
-
std::optional<bool>
|
|
47
|
+
std::optional<bool> maskOffensiveWords SWIFT_PRIVATE;
|
|
48
48
|
std::optional<bool> androidFormattingPreferQuality SWIFT_PRIVATE;
|
|
49
49
|
std::optional<bool> androidUseWebSearchModel SWIFT_PRIVATE;
|
|
50
50
|
std::optional<bool> androidDisableBatchHandling SWIFT_PRIVATE;
|
|
@@ -52,7 +52,7 @@ namespace margelo::nitro::nitrospeech {
|
|
|
52
52
|
|
|
53
53
|
public:
|
|
54
54
|
SpeechToTextParams() = default;
|
|
55
|
-
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>
|
|
55
|
+
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) {}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
} // namespace margelo::nitro::nitrospeech
|
|
@@ -71,7 +71,7 @@ namespace margelo::nitro {
|
|
|
71
71
|
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "contextualStrings")),
|
|
72
72
|
JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::fromJSI(runtime, obj.getProperty(runtime, "startHapticFeedbackStyle")),
|
|
73
73
|
JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::fromJSI(runtime, obj.getProperty(runtime, "stopHapticFeedbackStyle")),
|
|
74
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
74
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "maskOffensiveWords")),
|
|
75
75
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "androidFormattingPreferQuality")),
|
|
76
76
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "androidUseWebSearchModel")),
|
|
77
77
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "androidDisableBatchHandling")),
|
|
@@ -86,7 +86,7 @@ namespace margelo::nitro {
|
|
|
86
86
|
obj.setProperty(runtime, "contextualStrings", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.contextualStrings));
|
|
87
87
|
obj.setProperty(runtime, "startHapticFeedbackStyle", JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::toJSI(runtime, arg.startHapticFeedbackStyle));
|
|
88
88
|
obj.setProperty(runtime, "stopHapticFeedbackStyle", JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::toJSI(runtime, arg.stopHapticFeedbackStyle));
|
|
89
|
-
obj.setProperty(runtime, "
|
|
89
|
+
obj.setProperty(runtime, "maskOffensiveWords", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.maskOffensiveWords));
|
|
90
90
|
obj.setProperty(runtime, "androidFormattingPreferQuality", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidFormattingPreferQuality));
|
|
91
91
|
obj.setProperty(runtime, "androidUseWebSearchModel", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidUseWebSearchModel));
|
|
92
92
|
obj.setProperty(runtime, "androidDisableBatchHandling", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidDisableBatchHandling));
|
|
@@ -107,7 +107,7 @@ namespace margelo::nitro {
|
|
|
107
107
|
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "contextualStrings"))) return false;
|
|
108
108
|
if (!JSIConverter<std::optional<margelo::nitro::nitrospeech::HapticFeedbackStyle>>::canConvert(runtime, obj.getProperty(runtime, "startHapticFeedbackStyle"))) return false;
|
|
109
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, "
|
|
110
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "maskOffensiveWords"))) return false;
|
|
111
111
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "androidFormattingPreferQuality"))) return false;
|
|
112
112
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "androidUseWebSearchModel"))) return false;
|
|
113
113
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "androidDisableBatchHandling"))) return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmessier/nitro-speech",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
"registry": "https://registry.npmjs.org/"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@react-native/eslint-config": "0.
|
|
73
|
-
"@types/react": "
|
|
72
|
+
"@react-native/eslint-config": "0.84.1",
|
|
73
|
+
"@types/react": "19.2.14",
|
|
74
74
|
"eslint": "^8.57.0",
|
|
75
75
|
"eslint-config-prettier": "^9.1.0",
|
|
76
76
|
"eslint-plugin-prettier": "^5.2.1",
|
|
77
77
|
"nitrogen": "*",
|
|
78
78
|
"prettier": "^3.3.3",
|
|
79
|
-
"react": "
|
|
80
|
-
"react-native": "
|
|
81
|
-
"react-native-nitro-modules": "
|
|
82
|
-
"react-native-builder-bob": "
|
|
79
|
+
"react": "19.2.4",
|
|
80
|
+
"react-native": "0.84.1",
|
|
81
|
+
"react-native-nitro-modules": "0.34.1",
|
|
82
|
+
"react-native-builder-bob": "0.37.0",
|
|
83
83
|
"typescript": "^5.8.3"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|