@gmessier/nitro-speech 0.3.2 → 0.4.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/LICENSE +21 -0
- package/README.md +165 -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 +80 -16
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/HybridRecognizer.kt +93 -20
- package/android/src/main/java/com/margelo/nitro/nitrospeech/recognizer/RecognitionListenerSession.kt +27 -15
- package/ios/{BufferUtil.swift → Audio/AudioBufferConverter.swift} +3 -34
- package/ios/Audio/AudioLevelTracker.swift +66 -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 +312 -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 +135 -192
- 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 +5 -0
- package/lib/Recognizer/RecognizerRef.js +13 -0
- package/lib/Recognizer/SpeechRecognizer.d.ts +8 -0
- package/lib/Recognizer/SpeechRecognizer.js +9 -0
- package/lib/Recognizer/methods.d.ts +8 -0
- package/lib/Recognizer/methods.js +29 -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/useVoiceInputVolume.d.ts +25 -0
- package/lib/Recognizer/useVoiceInputVolume.js +52 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +6 -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 +95 -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 +2 -6
- package/nitrogen/generated/android/NitroSpeech+autolinking.cmake +2 -2
- package/nitrogen/generated/android/NitroSpeechOnLoad.cpp +5 -3
- 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 +68 -19
- package/nitrogen/generated/android/c++/JHybridRecognizerSpec.hpp +7 -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 +18 -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 +203 -70
- package/nitrogen/generated/ios/NitroSpeech-Swift-Cxx-Umbrella.hpp +13 -3
- package/nitrogen/generated/ios/NitroSpeechAutolinking.swift +2 -2
- package/nitrogen/generated/ios/c++/HybridRecognizerSpecSwift.hpp +41 -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 +6 -3
- package/nitrogen/generated/ios/swift/HybridRecognizerSpec_cxx.swift +66 -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 +4 -1
- package/nitrogen/generated/shared/c++/HybridRecognizerSpec.hpp +17 -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 +23 -0
- package/src/Recognizer/SpeechRecognizer.ts +10 -0
- package/src/Recognizer/methods.ts +40 -0
- package/src/Recognizer/types.ts +33 -0
- package/src/Recognizer/useRecognizer.ts +85 -0
- package/src/Recognizer/useVoiceInputVolume.ts +65 -0
- package/src/index.ts +6 -182
- package/src/specs/NitroSpeech.nitro.ts +2 -163
- package/src/specs/Recognizer.nitro.ts +110 -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
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrospeech/SpeechRecognitionConfig.kt
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SpeechRecognitionConfig.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 "SpeechRecognitionConfig".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class SpeechRecognitionConfig(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val locale: String?,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val contextualStrings: Array<String>?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val maskOffensiveWords: Boolean?,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val autoFinishRecognitionMs: Double?,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val autoFinishProgressIntervalMs: Double?,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val resetAutoFinishVoiceSensitivity: Double?,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
val disableRepeatingFilter: Boolean?,
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
val startHapticFeedbackStyle: HapticFeedbackStyle?,
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
val stopHapticFeedbackStyle: HapticFeedbackStyle?,
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
val androidFormattingPreferQuality: Boolean?,
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
val androidUseWebSearchModel: Boolean?,
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
@Keep
|
|
56
|
+
val androidDisableBatchHandling: Boolean?,
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
val iosAddPunctuation: Boolean?,
|
|
60
|
+
@DoNotStrip
|
|
61
|
+
@Keep
|
|
62
|
+
val iosPreset: IosPreset?,
|
|
63
|
+
@DoNotStrip
|
|
64
|
+
@Keep
|
|
65
|
+
val iosAtypicalSpeech: Boolean?
|
|
66
|
+
) {
|
|
67
|
+
/* primary constructor */
|
|
68
|
+
|
|
69
|
+
override fun equals(other: Any?): Boolean {
|
|
70
|
+
if (this === other) return true
|
|
71
|
+
if (other !is SpeechRecognitionConfig) return false
|
|
72
|
+
return Objects.deepEquals(this.locale, other.locale)
|
|
73
|
+
&& Objects.deepEquals(this.contextualStrings, other.contextualStrings)
|
|
74
|
+
&& Objects.deepEquals(this.maskOffensiveWords, other.maskOffensiveWords)
|
|
75
|
+
&& Objects.deepEquals(this.autoFinishRecognitionMs, other.autoFinishRecognitionMs)
|
|
76
|
+
&& Objects.deepEquals(this.autoFinishProgressIntervalMs, other.autoFinishProgressIntervalMs)
|
|
77
|
+
&& Objects.deepEquals(this.resetAutoFinishVoiceSensitivity, other.resetAutoFinishVoiceSensitivity)
|
|
78
|
+
&& Objects.deepEquals(this.disableRepeatingFilter, other.disableRepeatingFilter)
|
|
79
|
+
&& Objects.deepEquals(this.startHapticFeedbackStyle, other.startHapticFeedbackStyle)
|
|
80
|
+
&& Objects.deepEquals(this.stopHapticFeedbackStyle, other.stopHapticFeedbackStyle)
|
|
81
|
+
&& Objects.deepEquals(this.androidFormattingPreferQuality, other.androidFormattingPreferQuality)
|
|
82
|
+
&& Objects.deepEquals(this.androidUseWebSearchModel, other.androidUseWebSearchModel)
|
|
83
|
+
&& Objects.deepEquals(this.androidDisableBatchHandling, other.androidDisableBatchHandling)
|
|
84
|
+
&& Objects.deepEquals(this.iosAddPunctuation, other.iosAddPunctuation)
|
|
85
|
+
&& Objects.deepEquals(this.iosPreset, other.iosPreset)
|
|
86
|
+
&& Objects.deepEquals(this.iosAtypicalSpeech, other.iosAtypicalSpeech)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
override fun hashCode(): Int {
|
|
90
|
+
return arrayOf(
|
|
91
|
+
locale,
|
|
92
|
+
contextualStrings,
|
|
93
|
+
maskOffensiveWords,
|
|
94
|
+
autoFinishRecognitionMs,
|
|
95
|
+
autoFinishProgressIntervalMs,
|
|
96
|
+
resetAutoFinishVoiceSensitivity,
|
|
97
|
+
disableRepeatingFilter,
|
|
98
|
+
startHapticFeedbackStyle,
|
|
99
|
+
stopHapticFeedbackStyle,
|
|
100
|
+
androidFormattingPreferQuality,
|
|
101
|
+
androidUseWebSearchModel,
|
|
102
|
+
androidDisableBatchHandling,
|
|
103
|
+
iosAddPunctuation,
|
|
104
|
+
iosPreset,
|
|
105
|
+
iosAtypicalSpeech
|
|
106
|
+
).contentDeepHashCode()
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
companion object {
|
|
110
|
+
/**
|
|
111
|
+
* Constructor called from C++
|
|
112
|
+
*/
|
|
113
|
+
@DoNotStrip
|
|
114
|
+
@Keep
|
|
115
|
+
@Suppress("unused")
|
|
116
|
+
@JvmStatic
|
|
117
|
+
private fun fromCpp(locale: String?, contextualStrings: Array<String>?, maskOffensiveWords: Boolean?, autoFinishRecognitionMs: Double?, autoFinishProgressIntervalMs: Double?, resetAutoFinishVoiceSensitivity: Double?, disableRepeatingFilter: Boolean?, startHapticFeedbackStyle: HapticFeedbackStyle?, stopHapticFeedbackStyle: HapticFeedbackStyle?, androidFormattingPreferQuality: Boolean?, androidUseWebSearchModel: Boolean?, androidDisableBatchHandling: Boolean?, iosAddPunctuation: Boolean?, iosPreset: IosPreset?, iosAtypicalSpeech: Boolean?): SpeechRecognitionConfig {
|
|
118
|
+
return SpeechRecognitionConfig(locale, contextualStrings, maskOffensiveWords, autoFinishRecognitionMs, autoFinishProgressIntervalMs, resetAutoFinishVoiceSensitivity, disableRepeatingFilter, startHapticFeedbackStyle, stopHapticFeedbackStyle, androidFormattingPreferQuality, androidUseWebSearchModel, androidDisableBatchHandling, iosAddPunctuation, iosPreset, iosAtypicalSpeech)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// 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.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "VolumeChangeEvent".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class VolumeChangeEvent(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val smoothedVolume: Double,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val rawVolume: Double,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val db: Double?
|
|
30
|
+
) {
|
|
31
|
+
/* primary constructor */
|
|
32
|
+
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is VolumeChangeEvent) return false
|
|
36
|
+
return Objects.deepEquals(this.smoothedVolume, other.smoothedVolume)
|
|
37
|
+
&& Objects.deepEquals(this.rawVolume, other.rawVolume)
|
|
38
|
+
&& Objects.deepEquals(this.db, other.db)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf(
|
|
43
|
+
smoothedVolume,
|
|
44
|
+
rawVolume,
|
|
45
|
+
db
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
companion object {
|
|
50
|
+
/**
|
|
51
|
+
* Constructor called from C++
|
|
52
|
+
*/
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
@Suppress("unused")
|
|
56
|
+
@JvmStatic
|
|
57
|
+
private fun fromCpp(smoothedVolume: Double, rawVolume: Double, db: Double?): VolumeChangeEvent {
|
|
58
|
+
return VolumeChangeEvent(smoothedVolume, rawVolume, db)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -15,6 +15,38 @@
|
|
|
15
15
|
|
|
16
16
|
namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
17
17
|
|
|
18
|
+
// pragma MARK: std::shared_ptr<HybridRecognizerSpec>
|
|
19
|
+
std::shared_ptr<HybridRecognizerSpec> create_std__shared_ptr_HybridRecognizerSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
20
|
+
NitroSpeech::HybridRecognizerSpec_cxx swiftPart = NitroSpeech::HybridRecognizerSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
21
|
+
return std::make_shared<margelo::nitro::nitrospeech::HybridRecognizerSpecSwift>(swiftPart);
|
|
22
|
+
}
|
|
23
|
+
void* NON_NULL get_std__shared_ptr_HybridRecognizerSpec_(std__shared_ptr_HybridRecognizerSpec_ cppType) {
|
|
24
|
+
std::shared_ptr<margelo::nitro::nitrospeech::HybridRecognizerSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrospeech::HybridRecognizerSpecSwift>(cppType);
|
|
25
|
+
#ifdef NITRO_DEBUG
|
|
26
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
27
|
+
throw std::runtime_error("Class \"HybridRecognizerSpec\" is not implemented in Swift!");
|
|
28
|
+
}
|
|
29
|
+
#endif
|
|
30
|
+
NitroSpeech::HybridRecognizerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
31
|
+
return swiftPart.toUnsafe();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// pragma MARK: std::shared_ptr<HybridNitroSpeechSpec>
|
|
35
|
+
std::shared_ptr<HybridNitroSpeechSpec> create_std__shared_ptr_HybridNitroSpeechSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
36
|
+
NitroSpeech::HybridNitroSpeechSpec_cxx swiftPart = NitroSpeech::HybridNitroSpeechSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
37
|
+
return std::make_shared<margelo::nitro::nitrospeech::HybridNitroSpeechSpecSwift>(swiftPart);
|
|
38
|
+
}
|
|
39
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroSpeechSpec_(std__shared_ptr_HybridNitroSpeechSpec_ cppType) {
|
|
40
|
+
std::shared_ptr<margelo::nitro::nitrospeech::HybridNitroSpeechSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrospeech::HybridNitroSpeechSpecSwift>(cppType);
|
|
41
|
+
#ifdef NITRO_DEBUG
|
|
42
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
43
|
+
throw std::runtime_error("Class \"HybridNitroSpeechSpec\" is not implemented in Swift!");
|
|
44
|
+
}
|
|
45
|
+
#endif
|
|
46
|
+
NitroSpeech::HybridNitroSpeechSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
47
|
+
return swiftPart.toUnsafe();
|
|
48
|
+
}
|
|
49
|
+
|
|
18
50
|
// pragma MARK: std::function<void()>
|
|
19
51
|
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
20
52
|
auto swiftClosure = NitroSpeech::Func_void::fromUnsafe(swiftClosureWrapper);
|
|
@@ -23,6 +55,14 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
23
55
|
};
|
|
24
56
|
}
|
|
25
57
|
|
|
58
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
59
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
60
|
+
auto swiftClosure = NitroSpeech::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
61
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
62
|
+
swiftClosure.call(error);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
26
66
|
// pragma MARK: std::function<void(const std::vector<std::string>& /* resultBatches */)>
|
|
27
67
|
Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
28
68
|
auto swiftClosure = NitroSpeech::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper);
|
|
@@ -47,36 +87,12 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
47
87
|
};
|
|
48
88
|
}
|
|
49
89
|
|
|
50
|
-
// pragma MARK: std::
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return std::
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
std::shared_ptr<margelo::nitro::nitrospeech::HybridRecognizerSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrospeech::HybridRecognizerSpecSwift>(cppType);
|
|
57
|
-
#ifdef NITRO_DEBUG
|
|
58
|
-
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
59
|
-
throw std::runtime_error("Class \"HybridRecognizerSpec\" is not implemented in Swift!");
|
|
60
|
-
}
|
|
61
|
-
#endif
|
|
62
|
-
NitroSpeech::HybridRecognizerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
63
|
-
return swiftPart.toUnsafe();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// pragma MARK: std::shared_ptr<HybridNitroSpeechSpec>
|
|
67
|
-
std::shared_ptr<HybridNitroSpeechSpec> create_std__shared_ptr_HybridNitroSpeechSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
68
|
-
NitroSpeech::HybridNitroSpeechSpec_cxx swiftPart = NitroSpeech::HybridNitroSpeechSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
69
|
-
return std::make_shared<margelo::nitro::nitrospeech::HybridNitroSpeechSpecSwift>(swiftPart);
|
|
70
|
-
}
|
|
71
|
-
void* NON_NULL get_std__shared_ptr_HybridNitroSpeechSpec_(std__shared_ptr_HybridNitroSpeechSpec_ cppType) {
|
|
72
|
-
std::shared_ptr<margelo::nitro::nitrospeech::HybridNitroSpeechSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrospeech::HybridNitroSpeechSpecSwift>(cppType);
|
|
73
|
-
#ifdef NITRO_DEBUG
|
|
74
|
-
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
75
|
-
throw std::runtime_error("Class \"HybridNitroSpeechSpec\" is not implemented in Swift!");
|
|
76
|
-
}
|
|
77
|
-
#endif
|
|
78
|
-
NitroSpeech::HybridNitroSpeechSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
79
|
-
return swiftPart.toUnsafe();
|
|
90
|
+
// pragma MARK: std::function<void(const VolumeChangeEvent& /* event */)>
|
|
91
|
+
Func_void_VolumeChangeEvent create_Func_void_VolumeChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
92
|
+
auto swiftClosure = NitroSpeech::Func_void_VolumeChangeEvent::fromUnsafe(swiftClosureWrapper);
|
|
93
|
+
return [swiftClosure = std::move(swiftClosure)](const VolumeChangeEvent& event) mutable -> void {
|
|
94
|
+
swiftClosure.call(event);
|
|
95
|
+
};
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
} // namespace margelo::nitro::nitrospeech::bridge::swift
|
|
@@ -14,6 +14,14 @@ namespace margelo::nitro::nitrospeech { enum class HapticFeedbackStyle; }
|
|
|
14
14
|
namespace margelo::nitro::nitrospeech { class HybridNitroSpeechSpec; }
|
|
15
15
|
// Forward declaration of `HybridRecognizerSpec` to properly resolve imports.
|
|
16
16
|
namespace margelo::nitro::nitrospeech { class HybridRecognizerSpec; }
|
|
17
|
+
// Forward declaration of `IosPreset` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitrospeech { enum class IosPreset; }
|
|
19
|
+
// Forward declaration of `MutableSpeechRecognitionConfig` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::nitrospeech { struct MutableSpeechRecognitionConfig; }
|
|
21
|
+
// Forward declaration of `SpeechRecognitionConfig` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitrospeech { struct SpeechRecognitionConfig; }
|
|
23
|
+
// Forward declaration of `VolumeChangeEvent` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitrospeech { struct VolumeChangeEvent; }
|
|
17
25
|
|
|
18
26
|
// Forward declarations of Swift defined types
|
|
19
27
|
// Forward declaration of `HybridNitroSpeechSpec_cxx` to properly resolve imports.
|
|
@@ -25,6 +33,12 @@ namespace NitroSpeech { class HybridRecognizerSpec_cxx; }
|
|
|
25
33
|
#include "HapticFeedbackStyle.hpp"
|
|
26
34
|
#include "HybridNitroSpeechSpec.hpp"
|
|
27
35
|
#include "HybridRecognizerSpec.hpp"
|
|
36
|
+
#include "IosPreset.hpp"
|
|
37
|
+
#include "MutableSpeechRecognitionConfig.hpp"
|
|
38
|
+
#include "SpeechRecognitionConfig.hpp"
|
|
39
|
+
#include "VolumeChangeEvent.hpp"
|
|
40
|
+
#include <NitroModules/Promise.hpp>
|
|
41
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
28
42
|
#include <NitroModules/Result.hpp>
|
|
29
43
|
#include <exception>
|
|
30
44
|
#include <functional>
|
|
@@ -39,6 +53,86 @@ namespace NitroSpeech { class HybridRecognizerSpec_cxx; }
|
|
|
39
53
|
*/
|
|
40
54
|
namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
41
55
|
|
|
56
|
+
// pragma MARK: std::shared_ptr<HybridRecognizerSpec>
|
|
57
|
+
/**
|
|
58
|
+
* Specialized version of `std::shared_ptr<HybridRecognizerSpec>`.
|
|
59
|
+
*/
|
|
60
|
+
using std__shared_ptr_HybridRecognizerSpec_ = std::shared_ptr<HybridRecognizerSpec>;
|
|
61
|
+
std::shared_ptr<HybridRecognizerSpec> create_std__shared_ptr_HybridRecognizerSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
62
|
+
void* NON_NULL get_std__shared_ptr_HybridRecognizerSpec_(std__shared_ptr_HybridRecognizerSpec_ cppType);
|
|
63
|
+
|
|
64
|
+
// pragma MARK: std::weak_ptr<HybridRecognizerSpec>
|
|
65
|
+
using std__weak_ptr_HybridRecognizerSpec_ = std::weak_ptr<HybridRecognizerSpec>;
|
|
66
|
+
inline std__weak_ptr_HybridRecognizerSpec_ weakify_std__shared_ptr_HybridRecognizerSpec_(const std::shared_ptr<HybridRecognizerSpec>& strong) noexcept { return strong; }
|
|
67
|
+
|
|
68
|
+
// pragma MARK: std::shared_ptr<HybridNitroSpeechSpec>
|
|
69
|
+
/**
|
|
70
|
+
* Specialized version of `std::shared_ptr<HybridNitroSpeechSpec>`.
|
|
71
|
+
*/
|
|
72
|
+
using std__shared_ptr_HybridNitroSpeechSpec_ = std::shared_ptr<HybridNitroSpeechSpec>;
|
|
73
|
+
std::shared_ptr<HybridNitroSpeechSpec> create_std__shared_ptr_HybridNitroSpeechSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
74
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroSpeechSpec_(std__shared_ptr_HybridNitroSpeechSpec_ cppType);
|
|
75
|
+
|
|
76
|
+
// pragma MARK: std::weak_ptr<HybridNitroSpeechSpec>
|
|
77
|
+
using std__weak_ptr_HybridNitroSpeechSpec_ = std::weak_ptr<HybridNitroSpeechSpec>;
|
|
78
|
+
inline std__weak_ptr_HybridNitroSpeechSpec_ weakify_std__shared_ptr_HybridNitroSpeechSpec_(const std::shared_ptr<HybridNitroSpeechSpec>& strong) noexcept { return strong; }
|
|
79
|
+
|
|
80
|
+
// pragma MARK: std::shared_ptr<Promise<void>>
|
|
81
|
+
/**
|
|
82
|
+
* Specialized version of `std::shared_ptr<Promise<void>>`.
|
|
83
|
+
*/
|
|
84
|
+
using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
|
|
85
|
+
inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
|
|
86
|
+
return Promise<void>::create();
|
|
87
|
+
}
|
|
88
|
+
inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
|
|
89
|
+
return PromiseHolder<void>(std::move(promise));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// pragma MARK: std::function<void()>
|
|
93
|
+
/**
|
|
94
|
+
* Specialized version of `std::function<void()>`.
|
|
95
|
+
*/
|
|
96
|
+
using Func_void = std::function<void()>;
|
|
97
|
+
/**
|
|
98
|
+
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
|
99
|
+
*/
|
|
100
|
+
class Func_void_Wrapper final {
|
|
101
|
+
public:
|
|
102
|
+
explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
|
|
103
|
+
inline void call() const noexcept {
|
|
104
|
+
_function->operator()();
|
|
105
|
+
}
|
|
106
|
+
private:
|
|
107
|
+
std::unique_ptr<std::function<void()>> _function;
|
|
108
|
+
} SWIFT_NONCOPYABLE;
|
|
109
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
110
|
+
inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
|
|
111
|
+
return Func_void_Wrapper(std::move(value));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
115
|
+
/**
|
|
116
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
117
|
+
*/
|
|
118
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
119
|
+
/**
|
|
120
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
121
|
+
*/
|
|
122
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
123
|
+
public:
|
|
124
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
125
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
126
|
+
_function->operator()(error);
|
|
127
|
+
}
|
|
128
|
+
private:
|
|
129
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
130
|
+
} SWIFT_NONCOPYABLE;
|
|
131
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
132
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
133
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
134
|
+
}
|
|
135
|
+
|
|
42
136
|
// pragma MARK: std::optional<std::string>
|
|
43
137
|
/**
|
|
44
138
|
* Specialized version of `std::optional<std::string>`.
|
|
@@ -54,18 +148,29 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
54
148
|
return optional.value();
|
|
55
149
|
}
|
|
56
150
|
|
|
57
|
-
// pragma MARK: std::
|
|
151
|
+
// pragma MARK: std::vector<std::string>
|
|
58
152
|
/**
|
|
59
|
-
* Specialized version of `std::
|
|
153
|
+
* Specialized version of `std::vector<std::string>`.
|
|
60
154
|
*/
|
|
61
|
-
using
|
|
62
|
-
inline std::
|
|
63
|
-
|
|
155
|
+
using std__vector_std__string_ = std::vector<std::string>;
|
|
156
|
+
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
157
|
+
std::vector<std::string> vector;
|
|
158
|
+
vector.reserve(size);
|
|
159
|
+
return vector;
|
|
64
160
|
}
|
|
65
|
-
|
|
161
|
+
|
|
162
|
+
// pragma MARK: std::optional<std::vector<std::string>>
|
|
163
|
+
/**
|
|
164
|
+
* Specialized version of `std::optional<std::vector<std::string>>`.
|
|
165
|
+
*/
|
|
166
|
+
using std__optional_std__vector_std__string__ = std::optional<std::vector<std::string>>;
|
|
167
|
+
inline std::optional<std::vector<std::string>> create_std__optional_std__vector_std__string__(const std::vector<std::string>& value) noexcept {
|
|
168
|
+
return std::optional<std::vector<std::string>>(value);
|
|
169
|
+
}
|
|
170
|
+
inline bool has_value_std__optional_std__vector_std__string__(const std::optional<std::vector<std::string>>& optional) noexcept {
|
|
66
171
|
return optional.has_value();
|
|
67
172
|
}
|
|
68
|
-
inline
|
|
173
|
+
inline std::vector<std::string> get_std__optional_std__vector_std__string__(const std::optional<std::vector<std::string>>& optional) noexcept {
|
|
69
174
|
return optional.value();
|
|
70
175
|
}
|
|
71
176
|
|
|
@@ -84,29 +189,18 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
84
189
|
return optional.value();
|
|
85
190
|
}
|
|
86
191
|
|
|
87
|
-
// pragma MARK: std::
|
|
88
|
-
/**
|
|
89
|
-
* Specialized version of `std::vector<std::string>`.
|
|
90
|
-
*/
|
|
91
|
-
using std__vector_std__string_ = std::vector<std::string>;
|
|
92
|
-
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
93
|
-
std::vector<std::string> vector;
|
|
94
|
-
vector.reserve(size);
|
|
95
|
-
return vector;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// pragma MARK: std::optional<std::vector<std::string>>
|
|
192
|
+
// pragma MARK: std::optional<double>
|
|
99
193
|
/**
|
|
100
|
-
* Specialized version of `std::optional<
|
|
194
|
+
* Specialized version of `std::optional<double>`.
|
|
101
195
|
*/
|
|
102
|
-
using
|
|
103
|
-
inline std::optional<
|
|
104
|
-
return std::optional<
|
|
196
|
+
using std__optional_double_ = std::optional<double>;
|
|
197
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
198
|
+
return std::optional<double>(value);
|
|
105
199
|
}
|
|
106
|
-
inline bool
|
|
200
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
107
201
|
return optional.has_value();
|
|
108
202
|
}
|
|
109
|
-
inline
|
|
203
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
110
204
|
return optional.value();
|
|
111
205
|
}
|
|
112
206
|
|
|
@@ -125,26 +219,49 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
125
219
|
return optional.value();
|
|
126
220
|
}
|
|
127
221
|
|
|
128
|
-
// pragma MARK: std::
|
|
222
|
+
// pragma MARK: std::optional<IosPreset>
|
|
129
223
|
/**
|
|
130
|
-
* Specialized version of `std::
|
|
224
|
+
* Specialized version of `std::optional<IosPreset>`.
|
|
131
225
|
*/
|
|
132
|
-
using
|
|
226
|
+
using std__optional_IosPreset_ = std::optional<IosPreset>;
|
|
227
|
+
inline std::optional<IosPreset> create_std__optional_IosPreset_(const IosPreset& value) noexcept {
|
|
228
|
+
return std::optional<IosPreset>(value);
|
|
229
|
+
}
|
|
230
|
+
inline bool has_value_std__optional_IosPreset_(const std::optional<IosPreset>& optional) noexcept {
|
|
231
|
+
return optional.has_value();
|
|
232
|
+
}
|
|
233
|
+
inline IosPreset get_std__optional_IosPreset_(const std::optional<IosPreset>& optional) noexcept {
|
|
234
|
+
return optional.value();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// pragma MARK: std::optional<SpeechRecognitionConfig>
|
|
133
238
|
/**
|
|
134
|
-
*
|
|
239
|
+
* Specialized version of `std::optional<SpeechRecognitionConfig>`.
|
|
135
240
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
241
|
+
using std__optional_SpeechRecognitionConfig_ = std::optional<SpeechRecognitionConfig>;
|
|
242
|
+
inline std::optional<SpeechRecognitionConfig> create_std__optional_SpeechRecognitionConfig_(const SpeechRecognitionConfig& value) noexcept {
|
|
243
|
+
return std::optional<SpeechRecognitionConfig>(value);
|
|
244
|
+
}
|
|
245
|
+
inline bool has_value_std__optional_SpeechRecognitionConfig_(const std::optional<SpeechRecognitionConfig>& optional) noexcept {
|
|
246
|
+
return optional.has_value();
|
|
247
|
+
}
|
|
248
|
+
inline SpeechRecognitionConfig get_std__optional_SpeechRecognitionConfig_(const std::optional<SpeechRecognitionConfig>& optional) noexcept {
|
|
249
|
+
return optional.value();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// pragma MARK: std::optional<MutableSpeechRecognitionConfig>
|
|
253
|
+
/**
|
|
254
|
+
* Specialized version of `std::optional<MutableSpeechRecognitionConfig>`.
|
|
255
|
+
*/
|
|
256
|
+
using std__optional_MutableSpeechRecognitionConfig_ = std::optional<MutableSpeechRecognitionConfig>;
|
|
257
|
+
inline std::optional<MutableSpeechRecognitionConfig> create_std__optional_MutableSpeechRecognitionConfig_(const MutableSpeechRecognitionConfig& value) noexcept {
|
|
258
|
+
return std::optional<MutableSpeechRecognitionConfig>(value);
|
|
259
|
+
}
|
|
260
|
+
inline bool has_value_std__optional_MutableSpeechRecognitionConfig_(const std::optional<MutableSpeechRecognitionConfig>& optional) noexcept {
|
|
261
|
+
return optional.has_value();
|
|
262
|
+
}
|
|
263
|
+
inline MutableSpeechRecognitionConfig get_std__optional_MutableSpeechRecognitionConfig_(const std::optional<MutableSpeechRecognitionConfig>& optional) noexcept {
|
|
264
|
+
return optional.value();
|
|
148
265
|
}
|
|
149
266
|
|
|
150
267
|
// pragma MARK: std::optional<std::function<void()>>
|
|
@@ -273,32 +390,51 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
273
390
|
return optional.value();
|
|
274
391
|
}
|
|
275
392
|
|
|
276
|
-
// pragma MARK: std::
|
|
393
|
+
// pragma MARK: std::function<void(const VolumeChangeEvent& /* event */)>
|
|
277
394
|
/**
|
|
278
|
-
* Specialized version of `std::
|
|
395
|
+
* Specialized version of `std::function<void(const VolumeChangeEvent&)>`.
|
|
279
396
|
*/
|
|
280
|
-
using
|
|
281
|
-
|
|
282
|
-
|
|
397
|
+
using Func_void_VolumeChangeEvent = std::function<void(const VolumeChangeEvent& /* event */)>;
|
|
398
|
+
/**
|
|
399
|
+
* Wrapper class for a `std::function<void(const VolumeChangeEvent& / * event * /)>`, this can be used from Swift.
|
|
400
|
+
*/
|
|
401
|
+
class Func_void_VolumeChangeEvent_Wrapper final {
|
|
402
|
+
public:
|
|
403
|
+
explicit Func_void_VolumeChangeEvent_Wrapper(std::function<void(const VolumeChangeEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const VolumeChangeEvent& /* event */)>>(std::move(func))) {}
|
|
404
|
+
inline void call(VolumeChangeEvent event) const noexcept {
|
|
405
|
+
_function->operator()(event);
|
|
406
|
+
}
|
|
407
|
+
private:
|
|
408
|
+
std::unique_ptr<std::function<void(const VolumeChangeEvent& /* event */)>> _function;
|
|
409
|
+
} SWIFT_NONCOPYABLE;
|
|
410
|
+
Func_void_VolumeChangeEvent create_Func_void_VolumeChangeEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
411
|
+
inline Func_void_VolumeChangeEvent_Wrapper wrap_Func_void_VolumeChangeEvent(Func_void_VolumeChangeEvent value) noexcept {
|
|
412
|
+
return Func_void_VolumeChangeEvent_Wrapper(std::move(value));
|
|
283
413
|
}
|
|
284
|
-
|
|
414
|
+
|
|
415
|
+
// pragma MARK: std::optional<std::function<void(const VolumeChangeEvent& /* event */)>>
|
|
416
|
+
/**
|
|
417
|
+
* Specialized version of `std::optional<std::function<void(const VolumeChangeEvent& / * event * /)>>`.
|
|
418
|
+
*/
|
|
419
|
+
using std__optional_std__function_void_const_VolumeChangeEvent_____event______ = std::optional<std::function<void(const VolumeChangeEvent& /* event */)>>;
|
|
420
|
+
inline std::optional<std::function<void(const VolumeChangeEvent& /* event */)>> create_std__optional_std__function_void_const_VolumeChangeEvent_____event______(const std::function<void(const VolumeChangeEvent& /* event */)>& value) noexcept {
|
|
421
|
+
return std::optional<std::function<void(const VolumeChangeEvent& /* event */)>>(value);
|
|
422
|
+
}
|
|
423
|
+
inline bool has_value_std__optional_std__function_void_const_VolumeChangeEvent_____event______(const std::optional<std::function<void(const VolumeChangeEvent& /* event */)>>& optional) noexcept {
|
|
285
424
|
return optional.has_value();
|
|
286
425
|
}
|
|
287
|
-
inline std::function<void(
|
|
426
|
+
inline std::function<void(const VolumeChangeEvent& /* event */)> get_std__optional_std__function_void_const_VolumeChangeEvent_____event______(const std::optional<std::function<void(const VolumeChangeEvent& /* event */)>>& optional) noexcept {
|
|
288
427
|
return optional.value();
|
|
289
428
|
}
|
|
290
429
|
|
|
291
|
-
// pragma MARK: std::shared_ptr<
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
// pragma MARK: std::weak_ptr<HybridRecognizerSpec>
|
|
300
|
-
using std__weak_ptr_HybridRecognizerSpec_ = std::weak_ptr<HybridRecognizerSpec>;
|
|
301
|
-
inline std__weak_ptr_HybridRecognizerSpec_ weakify_std__shared_ptr_HybridRecognizerSpec_(const std::shared_ptr<HybridRecognizerSpec>& strong) noexcept { return strong; }
|
|
430
|
+
// pragma MARK: Result<std::shared_ptr<Promise<void>>>
|
|
431
|
+
using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
|
|
432
|
+
inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
|
|
433
|
+
return Result<std::shared_ptr<Promise<void>>>::withValue(value);
|
|
434
|
+
}
|
|
435
|
+
inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept {
|
|
436
|
+
return Result<std::shared_ptr<Promise<void>>>::withError(error);
|
|
437
|
+
}
|
|
302
438
|
|
|
303
439
|
// pragma MARK: Result<void>
|
|
304
440
|
using Result_void_ = Result<void>;
|
|
@@ -318,16 +454,13 @@ namespace margelo::nitro::nitrospeech::bridge::swift {
|
|
|
318
454
|
return Result<bool>::withError(error);
|
|
319
455
|
}
|
|
320
456
|
|
|
321
|
-
// pragma MARK: std::
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// pragma MARK: std::weak_ptr<HybridNitroSpeechSpec>
|
|
330
|
-
using std__weak_ptr_HybridNitroSpeechSpec_ = std::weak_ptr<HybridNitroSpeechSpec>;
|
|
331
|
-
inline std__weak_ptr_HybridNitroSpeechSpec_ weakify_std__shared_ptr_HybridNitroSpeechSpec_(const std::shared_ptr<HybridNitroSpeechSpec>& strong) noexcept { return strong; }
|
|
457
|
+
// pragma MARK: Result<std::vector<std::string>>
|
|
458
|
+
using Result_std__vector_std__string__ = Result<std::vector<std::string>>;
|
|
459
|
+
inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::vector<std::string>& value) noexcept {
|
|
460
|
+
return Result<std::vector<std::string>>::withValue(value);
|
|
461
|
+
}
|
|
462
|
+
inline Result_std__vector_std__string__ create_Result_std__vector_std__string__(const std::exception_ptr& error) noexcept {
|
|
463
|
+
return Result<std::vector<std::string>>::withError(error);
|
|
464
|
+
}
|
|
332
465
|
|
|
333
466
|
} // namespace margelo::nitro::nitrospeech::bridge::swift
|
|
@@ -14,14 +14,24 @@ namespace margelo::nitro::nitrospeech { enum class HapticFeedbackStyle; }
|
|
|
14
14
|
namespace margelo::nitro::nitrospeech { class HybridNitroSpeechSpec; }
|
|
15
15
|
// Forward declaration of `HybridRecognizerSpec` to properly resolve imports.
|
|
16
16
|
namespace margelo::nitro::nitrospeech { class HybridRecognizerSpec; }
|
|
17
|
-
// Forward declaration of `
|
|
18
|
-
namespace margelo::nitro::nitrospeech {
|
|
17
|
+
// Forward declaration of `IosPreset` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitrospeech { enum class IosPreset; }
|
|
19
|
+
// Forward declaration of `MutableSpeechRecognitionConfig` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::nitrospeech { struct MutableSpeechRecognitionConfig; }
|
|
21
|
+
// Forward declaration of `SpeechRecognitionConfig` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitrospeech { struct SpeechRecognitionConfig; }
|
|
23
|
+
// Forward declaration of `VolumeChangeEvent` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitrospeech { struct VolumeChangeEvent; }
|
|
19
25
|
|
|
20
26
|
// Include C++ defined types
|
|
21
27
|
#include "HapticFeedbackStyle.hpp"
|
|
22
28
|
#include "HybridNitroSpeechSpec.hpp"
|
|
23
29
|
#include "HybridRecognizerSpec.hpp"
|
|
24
|
-
#include "
|
|
30
|
+
#include "IosPreset.hpp"
|
|
31
|
+
#include "MutableSpeechRecognitionConfig.hpp"
|
|
32
|
+
#include "SpeechRecognitionConfig.hpp"
|
|
33
|
+
#include "VolumeChangeEvent.hpp"
|
|
34
|
+
#include <NitroModules/Promise.hpp>
|
|
25
35
|
#include <NitroModules/Result.hpp>
|
|
26
36
|
#include <exception>
|
|
27
37
|
#include <functional>
|