@gmessier/nitro-speech 0.3.3 → 0.4.1
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/LICENSE +21 -0
- package/README.md +176 -148
- package/android/build.gradle +0 -1
- package/android/src/main/cpp/cpp-adapter.cpp +5 -1
- package/android/src/main/java/com/margelo/nitro/nitrospeech/HybridNitroSpeech.kt +2 -0
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/AutoStopper.kt +82 -18
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/HybridRecognizer.kt +118 -30
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/Logger.kt +16 -0
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/RecognitionListenerSession.kt +35 -24
- package/ios/{BufferUtil.swift → Audio/AudioBufferConverter.swift} +3 -34
- package/ios/Audio/AudioLevelTracker.swift +60 -0
- package/ios/Coordinator.swift +105 -0
- package/ios/Engines/AnalyzerEngine.swift +241 -0
- package/ios/Engines/DictationRuntime.swift +67 -0
- package/ios/Engines/RecognizerEngine.swift +315 -0
- package/ios/Engines/SFSpeechEngine.swift +119 -0
- package/ios/Engines/SpeechRuntime.swift +58 -0
- package/ios/Engines/TranscriberRuntimeProtocol.swift +21 -0
- package/ios/HybridNitroSpeech.swift +1 -10
- package/ios/HybridRecognizer.swift +142 -191
- package/ios/LocaleManager.swift +73 -0
- package/ios/{AppStateObserver.swift → Shared/AppStateObserver.swift} +1 -2
- package/ios/Shared/AutoStopper.swift +147 -0
- package/ios/Shared/HapticImpact.swift +24 -0
- package/ios/Shared/Log.swift +41 -0
- package/ios/Shared/Permissions.swift +59 -0
- package/ios/Shared/Utils.swift +58 -0
- package/lib/NitroSpeech.d.ts +2 -0
- package/lib/NitroSpeech.js +2 -0
- package/lib/Recognizer/RecognizerRef.d.ts +7 -0
- package/lib/Recognizer/RecognizerRef.js +16 -0
- package/lib/Recognizer/SpeechRecognizer.d.ts +8 -0
- package/lib/Recognizer/SpeechRecognizer.js +9 -0
- package/lib/Recognizer/methods.d.ts +9 -0
- package/lib/Recognizer/methods.js +33 -0
- package/lib/Recognizer/types.d.ts +6 -0
- package/lib/Recognizer/types.js +1 -0
- package/lib/Recognizer/useRecognizer.d.ts +16 -0
- package/lib/Recognizer/useRecognizer.js +71 -0
- package/lib/Recognizer/useRecognizerIsActive.d.ts +25 -0
- package/lib/Recognizer/useRecognizerIsActive.js +40 -0
- package/lib/Recognizer/useVoiceInputVolume.d.ts +25 -0
- package/lib/Recognizer/useVoiceInputVolume.js +52 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/specs/NitroSpeech.nitro.d.ts +8 -0
- package/lib/specs/NitroSpeech.nitro.js +1 -0
- package/lib/specs/Recognizer.nitro.d.ts +97 -0
- package/lib/specs/Recognizer.nitro.js +1 -0
- package/lib/specs/SpeechRecognitionConfig.d.ts +162 -0
- package/lib/specs/SpeechRecognitionConfig.js +1 -0
- package/lib/specs/VolumeChangeEvent.d.ts +31 -0
- package/lib/specs/VolumeChangeEvent.js +1 -0
- package/nitro.json +0 -4
- package/nitrogen/generated/android/NitroSpeech+autolinking.cmake +2 -2
- package/nitrogen/generated/android/NitroSpeechOnLoad.cpp +4 -2
- package/nitrogen/generated/android/c++/JFunc_void_VolumeChangeEvent.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_std__string_.hpp +14 -14
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.cpp +73 -19
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.hpp +8 -4
- package/nitrogen/generated/android/c++/JIosPreset.hpp +58 -0
- package/nitrogen/generated/android/c++/JMutableSpeechRecognitionConfig.hpp +79 -0
- package/nitrogen/generated/android/c++/{JSpeechToTextParams.hpp → JSpeechRecognitionConfig.hpp} +48 -30
- package/nitrogen/generated/android/c++/JVolumeChangeEvent.hpp +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/Func_void_VolumeChangeEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HybridRecognizerSpec.kt +22 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/IosPreset.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/MutableSpeechRecognitionConfig.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/SpeechRecognitionConfig.kt +121 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/VolumeChangeEvent.kt +61 -0
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Bridge.cpp +46 -30
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Bridge.hpp +211 -69
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Umbrella.hpp +13 -3
- package/nitrogen/generated/ios/c++/HybridRecognizerSpecSwift.hpp +49 -9
- package/nitrogen/generated/ios/swift/Func_void_VolumeChangeEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec.swift +7 -3
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec_cxx.swift +78 -18
- package/nitrogen/generated/ios/swift/IosPreset.swift +40 -0
- package/nitrogen/generated/ios/swift/MutableSpeechRecognitionConfig.swift +118 -0
- package/nitrogen/generated/ios/swift/{SpeechToTextParams.swift → SpeechRecognitionConfig.swift} +108 -43
- package/nitrogen/generated/ios/swift/VolumeChangeEvent.swift +52 -0
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.cpp +5 -1
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.hpp +18 -7
- package/nitrogen/generated/shared/c++/IosPreset.hpp +76 -0
- package/nitrogen/generated/shared/c++/MutableSpeechRecognitionConfig.hpp +105 -0
- package/nitrogen/generated/shared/c++/{SpeechToTextParams.hpp → SpeechRecognitionConfig.hpp} +39 -20
- package/nitrogen/generated/shared/c++/VolumeChangeEvent.hpp +91 -0
- package/package.json +15 -16
- package/src/NitroSpeech.ts +5 -0
- package/src/Recognizer/RecognizerRef.ts +27 -0
- package/src/Recognizer/SpeechRecognizer.ts +10 -0
- package/src/Recognizer/methods.ts +45 -0
- package/src/Recognizer/types.ts +34 -0
- package/src/Recognizer/useRecognizer.ts +87 -0
- package/src/Recognizer/useRecognizerIsActive.ts +49 -0
- package/src/Recognizer/useVoiceInputVolume.ts +65 -0
- package/src/index.ts +13 -182
- package/src/specs/NitroSpeech.nitro.ts +2 -163
- package/src/specs/Recognizer.nitro.ts +113 -0
- package/src/specs/SpeechRecognitionConfig.ts +167 -0
- package/src/specs/VolumeChangeEvent.ts +31 -0
- package/android/proguard-rules.pro +0 -1
- package/ios/AnylyzerTranscriber.swift +0 -331
- package/ios/AutoStopper.swift +0 -69
- package/ios/HapticImpact.swift +0 -32
- package/ios/LegacySpeechRecognizer.swift +0 -161
- package/lib/commonjs/index.js +0 -145
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/specs/NitroSpeech.nitro.js +0 -6
- package/lib/commonjs/specs/NitroSpeech.nitro.js.map +0 -1
- package/lib/module/index.js +0 -138
- package/lib/module/index.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/specs/NitroSpeech.nitro.js +0 -4
- package/lib/module/specs/NitroSpeech.nitro.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/typescript/index.d.ts +0 -50
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/specs/NitroSpeech.nitro.d.ts +0 -162
- package/lib/typescript/specs/NitroSpeech.nitro.d.ts.map +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/SpeechToTextParams.kt +0 -68
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMutableSpeechRecognitionConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MutableSpeechRecognitionConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include "HapticFeedbackStyle.hpp"
|
|
14
|
+
#include "JHapticFeedbackStyle.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitrospeech {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "MutableSpeechRecognitionConfig" and the the Kotlin data class "MutableSpeechRecognitionConfig".
|
|
23
|
+
*/
|
|
24
|
+
struct JMutableSpeechRecognitionConfig final: public jni::JavaClass<JMutableSpeechRecognitionConfig> {
|
|
25
|
+
public:
|
|
26
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrospeech/MutableSpeechRecognitionConfig;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MutableSpeechRecognitionConfig by copying all values to C++.
|
|
31
|
+
*/
|
|
32
|
+
[[maybe_unused]]
|
|
33
|
+
[[nodiscard]]
|
|
34
|
+
MutableSpeechRecognitionConfig toCpp() const {
|
|
35
|
+
static const auto clazz = javaClassStatic();
|
|
36
|
+
static const auto fieldAutoFinishRecognitionMs = clazz->getField<jni::JDouble>("autoFinishRecognitionMs");
|
|
37
|
+
jni::local_ref<jni::JDouble> autoFinishRecognitionMs = this->getFieldValue(fieldAutoFinishRecognitionMs);
|
|
38
|
+
static const auto fieldAutoFinishProgressIntervalMs = clazz->getField<jni::JDouble>("autoFinishProgressIntervalMs");
|
|
39
|
+
jni::local_ref<jni::JDouble> autoFinishProgressIntervalMs = this->getFieldValue(fieldAutoFinishProgressIntervalMs);
|
|
40
|
+
static const auto fieldResetAutoFinishVoiceSensitivity = clazz->getField<jni::JDouble>("resetAutoFinishVoiceSensitivity");
|
|
41
|
+
jni::local_ref<jni::JDouble> resetAutoFinishVoiceSensitivity = this->getFieldValue(fieldResetAutoFinishVoiceSensitivity);
|
|
42
|
+
static const auto fieldDisableRepeatingFilter = clazz->getField<jni::JBoolean>("disableRepeatingFilter");
|
|
43
|
+
jni::local_ref<jni::JBoolean> disableRepeatingFilter = this->getFieldValue(fieldDisableRepeatingFilter);
|
|
44
|
+
static const auto fieldStartHapticFeedbackStyle = clazz->getField<JHapticFeedbackStyle>("startHapticFeedbackStyle");
|
|
45
|
+
jni::local_ref<JHapticFeedbackStyle> startHapticFeedbackStyle = this->getFieldValue(fieldStartHapticFeedbackStyle);
|
|
46
|
+
static const auto fieldStopHapticFeedbackStyle = clazz->getField<JHapticFeedbackStyle>("stopHapticFeedbackStyle");
|
|
47
|
+
jni::local_ref<JHapticFeedbackStyle> stopHapticFeedbackStyle = this->getFieldValue(fieldStopHapticFeedbackStyle);
|
|
48
|
+
return MutableSpeechRecognitionConfig(
|
|
49
|
+
autoFinishRecognitionMs != nullptr ? std::make_optional(autoFinishRecognitionMs->value()) : std::nullopt,
|
|
50
|
+
autoFinishProgressIntervalMs != nullptr ? std::make_optional(autoFinishProgressIntervalMs->value()) : std::nullopt,
|
|
51
|
+
resetAutoFinishVoiceSensitivity != nullptr ? std::make_optional(resetAutoFinishVoiceSensitivity->value()) : std::nullopt,
|
|
52
|
+
disableRepeatingFilter != nullptr ? std::make_optional(static_cast<bool>(disableRepeatingFilter->value())) : std::nullopt,
|
|
53
|
+
startHapticFeedbackStyle != nullptr ? std::make_optional(startHapticFeedbackStyle->toCpp()) : std::nullopt,
|
|
54
|
+
stopHapticFeedbackStyle != nullptr ? std::make_optional(stopHapticFeedbackStyle->toCpp()) : std::nullopt
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
/**
|
|
60
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
61
|
+
*/
|
|
62
|
+
[[maybe_unused]]
|
|
63
|
+
static jni::local_ref<JMutableSpeechRecognitionConfig::javaobject> fromCpp(const MutableSpeechRecognitionConfig& value) {
|
|
64
|
+
using JSignature = JMutableSpeechRecognitionConfig(jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JHapticFeedbackStyle>, jni::alias_ref<JHapticFeedbackStyle>);
|
|
65
|
+
static const auto clazz = javaClassStatic();
|
|
66
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
67
|
+
return create(
|
|
68
|
+
clazz,
|
|
69
|
+
value.autoFinishRecognitionMs.has_value() ? jni::JDouble::valueOf(value.autoFinishRecognitionMs.value()) : nullptr,
|
|
70
|
+
value.autoFinishProgressIntervalMs.has_value() ? jni::JDouble::valueOf(value.autoFinishProgressIntervalMs.value()) : nullptr,
|
|
71
|
+
value.resetAutoFinishVoiceSensitivity.has_value() ? jni::JDouble::valueOf(value.resetAutoFinishVoiceSensitivity.value()) : nullptr,
|
|
72
|
+
value.disableRepeatingFilter.has_value() ? jni::JBoolean::valueOf(value.disableRepeatingFilter.value()) : nullptr,
|
|
73
|
+
value.startHapticFeedbackStyle.has_value() ? JHapticFeedbackStyle::fromCpp(value.startHapticFeedbackStyle.value()) : nullptr,
|
|
74
|
+
value.stopHapticFeedbackStyle.has_value() ? JHapticFeedbackStyle::fromCpp(value.stopHapticFeedbackStyle.value()) : nullptr
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace margelo::nitro::nitrospeech
|
package/nitrogen/generated/android/c++/{JSpeechToTextParams.hpp → JSpeechRecognitionConfig.hpp}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JSpeechRecognitionConfig.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "
|
|
11
|
+
#include "SpeechRecognitionConfig.hpp"
|
|
12
12
|
|
|
13
13
|
#include "HapticFeedbackStyle.hpp"
|
|
14
|
+
#include "IosPreset.hpp"
|
|
14
15
|
#include "JHapticFeedbackStyle.hpp"
|
|
16
|
+
#include "JIosPreset.hpp"
|
|
15
17
|
#include <optional>
|
|
16
18
|
#include <string>
|
|
17
19
|
#include <vector>
|
|
@@ -21,34 +23,38 @@ namespace margelo::nitro::nitrospeech {
|
|
|
21
23
|
using namespace facebook;
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
|
-
* The C++ JNI bridge between the C++ struct "
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "SpeechRecognitionConfig" and the the Kotlin data class "SpeechRecognitionConfig".
|
|
25
27
|
*/
|
|
26
|
-
struct
|
|
28
|
+
struct JSpeechRecognitionConfig final: public jni::JavaClass<JSpeechRecognitionConfig> {
|
|
27
29
|
public:
|
|
28
|
-
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrospeech/
|
|
30
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrospeech/SpeechRecognitionConfig;";
|
|
29
31
|
|
|
30
32
|
public:
|
|
31
33
|
/**
|
|
32
|
-
* Convert this Java/Kotlin-based struct to the C++ struct
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct SpeechRecognitionConfig by copying all values to C++.
|
|
33
35
|
*/
|
|
34
36
|
[[maybe_unused]]
|
|
35
37
|
[[nodiscard]]
|
|
36
|
-
|
|
38
|
+
SpeechRecognitionConfig toCpp() const {
|
|
37
39
|
static const auto clazz = javaClassStatic();
|
|
38
40
|
static const auto fieldLocale = clazz->getField<jni::JString>("locale");
|
|
39
41
|
jni::local_ref<jni::JString> locale = this->getFieldValue(fieldLocale);
|
|
42
|
+
static const auto fieldContextualStrings = clazz->getField<jni::JArrayClass<jni::JString>>("contextualStrings");
|
|
43
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> contextualStrings = this->getFieldValue(fieldContextualStrings);
|
|
44
|
+
static const auto fieldMaskOffensiveWords = clazz->getField<jni::JBoolean>("maskOffensiveWords");
|
|
45
|
+
jni::local_ref<jni::JBoolean> maskOffensiveWords = this->getFieldValue(fieldMaskOffensiveWords);
|
|
40
46
|
static const auto fieldAutoFinishRecognitionMs = clazz->getField<jni::JDouble>("autoFinishRecognitionMs");
|
|
41
47
|
jni::local_ref<jni::JDouble> autoFinishRecognitionMs = this->getFieldValue(fieldAutoFinishRecognitionMs);
|
|
48
|
+
static const auto fieldAutoFinishProgressIntervalMs = clazz->getField<jni::JDouble>("autoFinishProgressIntervalMs");
|
|
49
|
+
jni::local_ref<jni::JDouble> autoFinishProgressIntervalMs = this->getFieldValue(fieldAutoFinishProgressIntervalMs);
|
|
50
|
+
static const auto fieldResetAutoFinishVoiceSensitivity = clazz->getField<jni::JDouble>("resetAutoFinishVoiceSensitivity");
|
|
51
|
+
jni::local_ref<jni::JDouble> resetAutoFinishVoiceSensitivity = this->getFieldValue(fieldResetAutoFinishVoiceSensitivity);
|
|
42
52
|
static const auto fieldDisableRepeatingFilter = clazz->getField<jni::JBoolean>("disableRepeatingFilter");
|
|
43
53
|
jni::local_ref<jni::JBoolean> disableRepeatingFilter = this->getFieldValue(fieldDisableRepeatingFilter);
|
|
44
|
-
static const auto fieldContextualStrings = clazz->getField<jni::JArrayClass<jni::JString>>("contextualStrings");
|
|
45
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> contextualStrings = this->getFieldValue(fieldContextualStrings);
|
|
46
54
|
static const auto fieldStartHapticFeedbackStyle = clazz->getField<JHapticFeedbackStyle>("startHapticFeedbackStyle");
|
|
47
55
|
jni::local_ref<JHapticFeedbackStyle> startHapticFeedbackStyle = this->getFieldValue(fieldStartHapticFeedbackStyle);
|
|
48
56
|
static const auto fieldStopHapticFeedbackStyle = clazz->getField<JHapticFeedbackStyle>("stopHapticFeedbackStyle");
|
|
49
57
|
jni::local_ref<JHapticFeedbackStyle> stopHapticFeedbackStyle = this->getFieldValue(fieldStopHapticFeedbackStyle);
|
|
50
|
-
static const auto fieldMaskOffensiveWords = clazz->getField<jni::JBoolean>("maskOffensiveWords");
|
|
51
|
-
jni::local_ref<jni::JBoolean> maskOffensiveWords = this->getFieldValue(fieldMaskOffensiveWords);
|
|
52
58
|
static const auto fieldAndroidFormattingPreferQuality = clazz->getField<jni::JBoolean>("androidFormattingPreferQuality");
|
|
53
59
|
jni::local_ref<jni::JBoolean> androidFormattingPreferQuality = this->getFieldValue(fieldAndroidFormattingPreferQuality);
|
|
54
60
|
static const auto fieldAndroidUseWebSearchModel = clazz->getField<jni::JBoolean>("androidUseWebSearchModel");
|
|
@@ -57,27 +63,35 @@ namespace margelo::nitro::nitrospeech {
|
|
|
57
63
|
jni::local_ref<jni::JBoolean> androidDisableBatchHandling = this->getFieldValue(fieldAndroidDisableBatchHandling);
|
|
58
64
|
static const auto fieldIosAddPunctuation = clazz->getField<jni::JBoolean>("iosAddPunctuation");
|
|
59
65
|
jni::local_ref<jni::JBoolean> iosAddPunctuation = this->getFieldValue(fieldIosAddPunctuation);
|
|
60
|
-
|
|
66
|
+
static const auto fieldIosPreset = clazz->getField<JIosPreset>("iosPreset");
|
|
67
|
+
jni::local_ref<JIosPreset> iosPreset = this->getFieldValue(fieldIosPreset);
|
|
68
|
+
static const auto fieldIosAtypicalSpeech = clazz->getField<jni::JBoolean>("iosAtypicalSpeech");
|
|
69
|
+
jni::local_ref<jni::JBoolean> iosAtypicalSpeech = this->getFieldValue(fieldIosAtypicalSpeech);
|
|
70
|
+
return SpeechRecognitionConfig(
|
|
61
71
|
locale != nullptr ? std::make_optional(locale->toStdString()) : std::nullopt,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
contextualStrings != nullptr ? std::make_optional([&]() {
|
|
65
|
-
size_t __size = contextualStrings->size();
|
|
72
|
+
contextualStrings != nullptr ? std::make_optional([&](auto&& __input) {
|
|
73
|
+
size_t __size = __input->size();
|
|
66
74
|
std::vector<std::string> __vector;
|
|
67
75
|
__vector.reserve(__size);
|
|
68
76
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
69
|
-
auto __element =
|
|
77
|
+
auto __element = __input->getElement(__i);
|
|
70
78
|
__vector.push_back(__element->toStdString());
|
|
71
79
|
}
|
|
72
80
|
return __vector;
|
|
73
|
-
}()) : std::nullopt,
|
|
81
|
+
}(contextualStrings)) : std::nullopt,
|
|
82
|
+
maskOffensiveWords != nullptr ? std::make_optional(static_cast<bool>(maskOffensiveWords->value())) : std::nullopt,
|
|
83
|
+
autoFinishRecognitionMs != nullptr ? std::make_optional(autoFinishRecognitionMs->value()) : std::nullopt,
|
|
84
|
+
autoFinishProgressIntervalMs != nullptr ? std::make_optional(autoFinishProgressIntervalMs->value()) : std::nullopt,
|
|
85
|
+
resetAutoFinishVoiceSensitivity != nullptr ? std::make_optional(resetAutoFinishVoiceSensitivity->value()) : std::nullopt,
|
|
86
|
+
disableRepeatingFilter != nullptr ? std::make_optional(static_cast<bool>(disableRepeatingFilter->value())) : std::nullopt,
|
|
74
87
|
startHapticFeedbackStyle != nullptr ? std::make_optional(startHapticFeedbackStyle->toCpp()) : std::nullopt,
|
|
75
88
|
stopHapticFeedbackStyle != nullptr ? std::make_optional(stopHapticFeedbackStyle->toCpp()) : std::nullopt,
|
|
76
|
-
maskOffensiveWords != nullptr ? std::make_optional(static_cast<bool>(maskOffensiveWords->value())) : std::nullopt,
|
|
77
89
|
androidFormattingPreferQuality != nullptr ? std::make_optional(static_cast<bool>(androidFormattingPreferQuality->value())) : std::nullopt,
|
|
78
90
|
androidUseWebSearchModel != nullptr ? std::make_optional(static_cast<bool>(androidUseWebSearchModel->value())) : std::nullopt,
|
|
79
91
|
androidDisableBatchHandling != nullptr ? std::make_optional(static_cast<bool>(androidDisableBatchHandling->value())) : std::nullopt,
|
|
80
|
-
iosAddPunctuation != nullptr ? std::make_optional(static_cast<bool>(iosAddPunctuation->value())) : std::nullopt
|
|
92
|
+
iosAddPunctuation != nullptr ? std::make_optional(static_cast<bool>(iosAddPunctuation->value())) : std::nullopt,
|
|
93
|
+
iosPreset != nullptr ? std::make_optional(iosPreset->toCpp()) : std::nullopt,
|
|
94
|
+
iosAtypicalSpeech != nullptr ? std::make_optional(static_cast<bool>(iosAtypicalSpeech->value())) : std::nullopt
|
|
81
95
|
);
|
|
82
96
|
}
|
|
83
97
|
|
|
@@ -86,32 +100,36 @@ namespace margelo::nitro::nitrospeech {
|
|
|
86
100
|
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
87
101
|
*/
|
|
88
102
|
[[maybe_unused]]
|
|
89
|
-
static jni::local_ref<
|
|
90
|
-
using JSignature =
|
|
103
|
+
static jni::local_ref<JSpeechRecognitionConfig::javaobject> fromCpp(const SpeechRecognitionConfig& value) {
|
|
104
|
+
using JSignature = JSpeechRecognitionConfig(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<jni::JString>>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JHapticFeedbackStyle>, jni::alias_ref<JHapticFeedbackStyle>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JIosPreset>, jni::alias_ref<jni::JBoolean>);
|
|
91
105
|
static const auto clazz = javaClassStatic();
|
|
92
106
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
93
107
|
return create(
|
|
94
108
|
clazz,
|
|
95
109
|
value.locale.has_value() ? jni::make_jstring(value.locale.value()) : nullptr,
|
|
96
|
-
value.
|
|
97
|
-
|
|
98
|
-
value.contextualStrings.has_value() ? [&]() {
|
|
99
|
-
size_t __size = value.contextualStrings.value().size();
|
|
110
|
+
value.contextualStrings.has_value() ? [&](auto&& __input) {
|
|
111
|
+
size_t __size = __input.size();
|
|
100
112
|
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
101
113
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
102
|
-
const auto& __element =
|
|
114
|
+
const auto& __element = __input[__i];
|
|
103
115
|
auto __elementJni = jni::make_jstring(__element);
|
|
104
116
|
__array->setElement(__i, *__elementJni);
|
|
105
117
|
}
|
|
106
118
|
return __array;
|
|
107
|
-
}() : nullptr,
|
|
119
|
+
}(value.contextualStrings.value()) : nullptr,
|
|
120
|
+
value.maskOffensiveWords.has_value() ? jni::JBoolean::valueOf(value.maskOffensiveWords.value()) : nullptr,
|
|
121
|
+
value.autoFinishRecognitionMs.has_value() ? jni::JDouble::valueOf(value.autoFinishRecognitionMs.value()) : nullptr,
|
|
122
|
+
value.autoFinishProgressIntervalMs.has_value() ? jni::JDouble::valueOf(value.autoFinishProgressIntervalMs.value()) : nullptr,
|
|
123
|
+
value.resetAutoFinishVoiceSensitivity.has_value() ? jni::JDouble::valueOf(value.resetAutoFinishVoiceSensitivity.value()) : nullptr,
|
|
124
|
+
value.disableRepeatingFilter.has_value() ? jni::JBoolean::valueOf(value.disableRepeatingFilter.value()) : nullptr,
|
|
108
125
|
value.startHapticFeedbackStyle.has_value() ? JHapticFeedbackStyle::fromCpp(value.startHapticFeedbackStyle.value()) : nullptr,
|
|
109
126
|
value.stopHapticFeedbackStyle.has_value() ? JHapticFeedbackStyle::fromCpp(value.stopHapticFeedbackStyle.value()) : nullptr,
|
|
110
|
-
value.maskOffensiveWords.has_value() ? jni::JBoolean::valueOf(value.maskOffensiveWords.value()) : nullptr,
|
|
111
127
|
value.androidFormattingPreferQuality.has_value() ? jni::JBoolean::valueOf(value.androidFormattingPreferQuality.value()) : nullptr,
|
|
112
128
|
value.androidUseWebSearchModel.has_value() ? jni::JBoolean::valueOf(value.androidUseWebSearchModel.value()) : nullptr,
|
|
113
129
|
value.androidDisableBatchHandling.has_value() ? jni::JBoolean::valueOf(value.androidDisableBatchHandling.value()) : nullptr,
|
|
114
|
-
value.iosAddPunctuation.has_value() ? jni::JBoolean::valueOf(value.iosAddPunctuation.value()) : nullptr
|
|
130
|
+
value.iosAddPunctuation.has_value() ? jni::JBoolean::valueOf(value.iosAddPunctuation.value()) : nullptr,
|
|
131
|
+
value.iosPreset.has_value() ? JIosPreset::fromCpp(value.iosPreset.value()) : nullptr,
|
|
132
|
+
value.iosAtypicalSpeech.has_value() ? jni::JBoolean::valueOf(value.iosAtypicalSpeech.value()) : nullptr
|
|
115
133
|
);
|
|
116
134
|
}
|
|
117
135
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVolumeChangeEvent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "VolumeChangeEvent.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitrospeech {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "VolumeChangeEvent" and the the Kotlin data class "VolumeChangeEvent".
|
|
21
|
+
*/
|
|
22
|
+
struct JVolumeChangeEvent final: public jni::JavaClass<JVolumeChangeEvent> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrospeech/VolumeChangeEvent;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct VolumeChangeEvent by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
VolumeChangeEvent toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldSmoothedVolume = clazz->getField<double>("smoothedVolume");
|
|
35
|
+
double smoothedVolume = this->getFieldValue(fieldSmoothedVolume);
|
|
36
|
+
static const auto fieldRawVolume = clazz->getField<double>("rawVolume");
|
|
37
|
+
double rawVolume = this->getFieldValue(fieldRawVolume);
|
|
38
|
+
static const auto fieldDb = clazz->getField<jni::JDouble>("db");
|
|
39
|
+
jni::local_ref<jni::JDouble> db = this->getFieldValue(fieldDb);
|
|
40
|
+
return VolumeChangeEvent(
|
|
41
|
+
smoothedVolume,
|
|
42
|
+
rawVolume,
|
|
43
|
+
db != nullptr ? std::make_optional(db->value()) : std::nullopt
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
50
|
+
*/
|
|
51
|
+
[[maybe_unused]]
|
|
52
|
+
static jni::local_ref<JVolumeChangeEvent::javaobject> fromCpp(const VolumeChangeEvent& value) {
|
|
53
|
+
using JSignature = JVolumeChangeEvent(double, double, jni::alias_ref<jni::JDouble>);
|
|
54
|
+
static const auto clazz = javaClassStatic();
|
|
55
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
56
|
+
return create(
|
|
57
|
+
clazz,
|
|
58
|
+
value.smoothedVolume,
|
|
59
|
+
value.rawVolume,
|
|
60
|
+
value.db.has_value() ? jni::JDouble::valueOf(value.db.value()) : nullptr
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::nitrospeech
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_VolumeChangeEvent.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrospeech
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represents the JavaScript callback `(event: struct) => void`.
|
|
18
|
+
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
+
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
+
*/
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
+
fun interface Func_void_VolumeChangeEvent: (VolumeChangeEvent) -> Unit {
|
|
25
|
+
/**
|
|
26
|
+
* Call the given JS callback.
|
|
27
|
+
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
+
*/
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
override fun invoke(event: VolumeChangeEvent): Unit
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents the JavaScript callback `(event: struct) => void`.
|
|
36
|
+
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
+
* The callback might be coming from JS.
|
|
38
|
+
*/
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
@Suppress(
|
|
42
|
+
"KotlinJniMissingFunction", "unused",
|
|
43
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
+
)
|
|
46
|
+
class Func_void_VolumeChangeEvent_cxx: Func_void_VolumeChangeEvent {
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
49
|
+
private val mHybridData: HybridData
|
|
50
|
+
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
private constructor(hybridData: HybridData) {
|
|
54
|
+
mHybridData = hybridData
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
override fun invoke(event: VolumeChangeEvent): Unit
|
|
60
|
+
= invoke_cxx(event)
|
|
61
|
+
|
|
62
|
+
@FastNative
|
|
63
|
+
private external fun invoke_cxx(event: VolumeChangeEvent): Unit
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Represents the JavaScript callback `(event: struct) => void`.
|
|
68
|
+
* This is implemented in Java/Kotlin, via a `(VolumeChangeEvent) -> Unit`.
|
|
69
|
+
* The callback is always coming from native.
|
|
70
|
+
*/
|
|
71
|
+
@DoNotStrip
|
|
72
|
+
@Keep
|
|
73
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
+
class Func_void_VolumeChangeEvent_java(private val function: (VolumeChangeEvent) -> Unit): Func_void_VolumeChangeEvent {
|
|
75
|
+
@DoNotStrip
|
|
76
|
+
@Keep
|
|
77
|
+
override fun invoke(event: VolumeChangeEvent): Unit {
|
|
78
|
+
return this.function(event)
|
|
79
|
+
}
|
|
80
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/HybridRecognizerSpec.kt
CHANGED
|
@@ -10,6 +10,7 @@ package com.margelo.nitro.nitrospeech
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.jni.HybridData
|
|
12
12
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Promise
|
|
13
14
|
import com.margelo.nitro.core.HybridObject
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -109,13 +110,13 @@ abstract class HybridRecognizerSpec: HybridObject() {
|
|
|
109
110
|
onPermissionDenied = value?.let { it }
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
abstract var onVolumeChange: ((
|
|
113
|
+
abstract var onVolumeChange: ((event: VolumeChangeEvent) -> Unit)?
|
|
113
114
|
|
|
114
|
-
private var onVolumeChange_cxx:
|
|
115
|
+
private var onVolumeChange_cxx: Func_void_VolumeChangeEvent?
|
|
115
116
|
@Keep
|
|
116
117
|
@DoNotStrip
|
|
117
118
|
get() {
|
|
118
|
-
return onVolumeChange?.let {
|
|
119
|
+
return onVolumeChange?.let { Func_void_VolumeChangeEvent_java(it) }
|
|
119
120
|
}
|
|
120
121
|
@Keep
|
|
121
122
|
@DoNotStrip
|
|
@@ -126,23 +127,39 @@ abstract class HybridRecognizerSpec: HybridObject() {
|
|
|
126
127
|
// Methods
|
|
127
128
|
@DoNotStrip
|
|
128
129
|
@Keep
|
|
129
|
-
abstract fun
|
|
130
|
+
abstract fun prewarm(defaultParams: SpeechRecognitionConfig?): Promise<Unit>
|
|
131
|
+
|
|
132
|
+
@DoNotStrip
|
|
133
|
+
@Keep
|
|
134
|
+
abstract fun startListening(params: SpeechRecognitionConfig?): Unit
|
|
130
135
|
|
|
131
136
|
@DoNotStrip
|
|
132
137
|
@Keep
|
|
133
138
|
abstract fun stopListening(): Unit
|
|
134
139
|
|
|
140
|
+
@DoNotStrip
|
|
141
|
+
@Keep
|
|
142
|
+
abstract fun resetAutoFinishTime(): Unit
|
|
143
|
+
|
|
135
144
|
@DoNotStrip
|
|
136
145
|
@Keep
|
|
137
146
|
abstract fun addAutoFinishTime(additionalTimeMs: Double?): Unit
|
|
138
147
|
|
|
139
148
|
@DoNotStrip
|
|
140
149
|
@Keep
|
|
141
|
-
abstract fun
|
|
150
|
+
abstract fun updateConfig(newConfig: MutableSpeechRecognitionConfig?, resetAutoFinishTime: Boolean?): Unit
|
|
142
151
|
|
|
143
152
|
@DoNotStrip
|
|
144
153
|
@Keep
|
|
145
154
|
abstract fun getIsActive(): Boolean
|
|
155
|
+
|
|
156
|
+
@DoNotStrip
|
|
157
|
+
@Keep
|
|
158
|
+
abstract fun getVoiceInputVolume(): VolumeChangeEvent
|
|
159
|
+
|
|
160
|
+
@DoNotStrip
|
|
161
|
+
@Keep
|
|
162
|
+
abstract fun getSupportedLocalesIOS(): Array<String>
|
|
146
163
|
|
|
147
164
|
// Default implementation of `HybridObject.toString()`
|
|
148
165
|
override fun toString(): String {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IosPreset.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrospeech
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "IosPreset".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class IosPreset(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
SHORTFORM(0),
|
|
20
|
+
GENERAL(1);
|
|
21
|
+
|
|
22
|
+
companion object
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MutableSpeechRecognitionConfig.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrospeech
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "MutableSpeechRecognitionConfig".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class MutableSpeechRecognitionConfig(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val autoFinishRecognitionMs: Double?,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val autoFinishProgressIntervalMs: Double?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val resetAutoFinishVoiceSensitivity: Double?,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val disableRepeatingFilter: Boolean?,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val startHapticFeedbackStyle: HapticFeedbackStyle?,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val stopHapticFeedbackStyle: HapticFeedbackStyle?
|
|
39
|
+
) {
|
|
40
|
+
/* primary constructor */
|
|
41
|
+
|
|
42
|
+
override fun equals(other: Any?): Boolean {
|
|
43
|
+
if (this === other) return true
|
|
44
|
+
if (other !is MutableSpeechRecognitionConfig) return false
|
|
45
|
+
return Objects.deepEquals(this.autoFinishRecognitionMs, other.autoFinishRecognitionMs)
|
|
46
|
+
&& Objects.deepEquals(this.autoFinishProgressIntervalMs, other.autoFinishProgressIntervalMs)
|
|
47
|
+
&& Objects.deepEquals(this.resetAutoFinishVoiceSensitivity, other.resetAutoFinishVoiceSensitivity)
|
|
48
|
+
&& Objects.deepEquals(this.disableRepeatingFilter, other.disableRepeatingFilter)
|
|
49
|
+
&& Objects.deepEquals(this.startHapticFeedbackStyle, other.startHapticFeedbackStyle)
|
|
50
|
+
&& Objects.deepEquals(this.stopHapticFeedbackStyle, other.stopHapticFeedbackStyle)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun hashCode(): Int {
|
|
54
|
+
return arrayOf(
|
|
55
|
+
autoFinishRecognitionMs,
|
|
56
|
+
autoFinishProgressIntervalMs,
|
|
57
|
+
resetAutoFinishVoiceSensitivity,
|
|
58
|
+
disableRepeatingFilter,
|
|
59
|
+
startHapticFeedbackStyle,
|
|
60
|
+
stopHapticFeedbackStyle
|
|
61
|
+
).contentDeepHashCode()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
companion object {
|
|
65
|
+
/**
|
|
66
|
+
* Constructor called from C++
|
|
67
|
+
*/
|
|
68
|
+
@DoNotStrip
|
|
69
|
+
@Keep
|
|
70
|
+
@Suppress("unused")
|
|
71
|
+
@JvmStatic
|
|
72
|
+
private fun fromCpp(autoFinishRecognitionMs: Double?, autoFinishProgressIntervalMs: Double?, resetAutoFinishVoiceSensitivity: Double?, disableRepeatingFilter: Boolean?, startHapticFeedbackStyle: HapticFeedbackStyle?, stopHapticFeedbackStyle: HapticFeedbackStyle?): MutableSpeechRecognitionConfig {
|
|
73
|
+
return MutableSpeechRecognitionConfig(autoFinishRecognitionMs, autoFinishProgressIntervalMs, resetAutoFinishVoiceSensitivity, disableRepeatingFilter, startHapticFeedbackStyle, stopHapticFeedbackStyle)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|