@iternio/react-native-auto-play 0.4.5 → 0.4.6
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/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +89 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +12 -4
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +20 -276
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/ThreadUtil.kt +13 -6
- package/ios/hybrid/HybridAutoPlay.swift +47 -2
- package/ios/utils/VoiceInputManager.swift +40 -141
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -2
- package/lib/specs/AutoPlay.nitro.d.ts +29 -0
- package/nitro.json +0 -10
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +0 -2
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +0 -18
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +43 -0
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.hpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +17 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +16 -41
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +126 -201
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +0 -11
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.mm +0 -8
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.swift +0 -12
- package/nitrogen/generated/ios/c++/HybridAutoPlaySpecSwift.hpp +34 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +5 -5
- package/nitrogen/generated/ios/swift/{Func_void_VoiceInputResult.swift → Func_void_std__shared_ptr_ArrayBuffer_.swift} +10 -10
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +4 -0
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +82 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.hpp +5 -0
- package/package.json +1 -1
- package/src/index.ts +1 -3
- package/src/specs/AutoPlay.nitro.ts +37 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoice.kt +0 -95
- package/ios/hybrid/HybridVoice.swift +0 -63
- package/lib/HybridAutoPlay.d.ts +0 -2
- package/lib/HybridAutoPlay.js +0 -2
- package/lib/hooks/useIsAutoPlayFocused.d.ts +0 -7
- package/lib/hooks/useIsAutoPlayFocused.js +0 -20
- package/lib/hybrid/HybridVoice.d.ts +0 -12
- package/lib/hybrid/HybridVoice.js +0 -13
- package/lib/hybrid.d.ts +0 -2
- package/lib/hybrid.js +0 -2
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.js +0 -1
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +0 -1
- package/lib/specs/Voice.nitro.d.ts +0 -51
- package/lib/specs/Voice.nitro.js +0 -1
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +0 -23
- package/lib/templates/AutomotivePermissionRequestTemplate.js +0 -18
- package/lib/types/Glyphmap.d.ts +0 -4105
- package/lib/types/Glyphmap.js +0 -4105
- package/lib/types/Voice.d.ts +0 -15
- package/lib/types/Voice.js +0 -1
- package/nitrogen/generated/android/c++/JFunc_void_VoiceInputChunk.hpp +0 -81
- package/nitrogen/generated/android/c++/JHybridVoiceSpec.cpp +0 -104
- package/nitrogen/generated/android/c++/JHybridVoiceSpec.hpp +0 -66
- package/nitrogen/generated/android/c++/JVoiceInputChunk.hpp +0 -64
- package/nitrogen/generated/android/c++/JVoiceInputResult.hpp +0 -64
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VoiceInputChunk.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoiceSpec.kt +0 -72
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputChunk.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputResult.kt +0 -41
- package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.hpp +0 -116
- package/nitrogen/generated/ios/swift/Func_void_VoiceInputChunk.swift +0 -46
- package/nitrogen/generated/ios/swift/HybridVoiceSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridVoiceSpec_cxx.swift +0 -227
- package/nitrogen/generated/ios/swift/VoiceInputChunk.swift +0 -60
- package/nitrogen/generated/ios/swift/VoiceInputResult.swift +0 -60
- package/nitrogen/generated/shared/c++/HybridVoiceSpec.cpp +0 -24
- package/nitrogen/generated/shared/c++/HybridVoiceSpec.hpp +0 -73
- package/nitrogen/generated/shared/c++/VoiceInputChunk.hpp +0 -89
- package/nitrogen/generated/shared/c++/VoiceInputResult.hpp +0 -89
- package/src/hybrid/HybridVoice.ts +0 -30
- package/src/specs/Voice.nitro.ts +0 -58
- package/src/types/Voice.ts +0 -17
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// VoiceInputChunk.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
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#include <string>
|
|
34
|
-
#include <optional>
|
|
35
|
-
#include <NitroModules/ArrayBuffer.hpp>
|
|
36
|
-
|
|
37
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A struct which can be represented as a JavaScript object (VoiceInputChunk).
|
|
41
|
-
*/
|
|
42
|
-
struct VoiceInputChunk final {
|
|
43
|
-
public:
|
|
44
|
-
std::optional<std::string> partial SWIFT_PRIVATE;
|
|
45
|
-
std::optional<std::shared_ptr<ArrayBuffer>> audio SWIFT_PRIVATE;
|
|
46
|
-
|
|
47
|
-
public:
|
|
48
|
-
VoiceInputChunk() = default;
|
|
49
|
-
explicit VoiceInputChunk(std::optional<std::string> partial, std::optional<std::shared_ptr<ArrayBuffer>> audio): partial(partial), audio(audio) {}
|
|
50
|
-
|
|
51
|
-
public:
|
|
52
|
-
friend bool operator==(const VoiceInputChunk& lhs, const VoiceInputChunk& rhs) = default;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
56
|
-
|
|
57
|
-
namespace margelo::nitro {
|
|
58
|
-
|
|
59
|
-
// C++ VoiceInputChunk <> JS VoiceInputChunk (object)
|
|
60
|
-
template <>
|
|
61
|
-
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputChunk> final {
|
|
62
|
-
static inline margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputChunk fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
-
return margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputChunk(
|
|
65
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "partial"))),
|
|
66
|
-
JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "audio")))
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputChunk& arg) {
|
|
70
|
-
jsi::Object obj(runtime);
|
|
71
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "partial"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.partial));
|
|
72
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "audio"), JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::toJSI(runtime, arg.audio));
|
|
73
|
-
return obj;
|
|
74
|
-
}
|
|
75
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
76
|
-
if (!value.isObject()) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
jsi::Object obj = value.getObject(runtime);
|
|
80
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "partial")))) return false;
|
|
84
|
-
if (!JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "audio")))) return false;
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
} // namespace margelo::nitro
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// VoiceInputResult.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
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#include <string>
|
|
34
|
-
#include <optional>
|
|
35
|
-
#include <NitroModules/ArrayBuffer.hpp>
|
|
36
|
-
|
|
37
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A struct which can be represented as a JavaScript object (VoiceInputResult).
|
|
41
|
-
*/
|
|
42
|
-
struct VoiceInputResult final {
|
|
43
|
-
public:
|
|
44
|
-
std::optional<std::string> transcription SWIFT_PRIVATE;
|
|
45
|
-
std::optional<std::shared_ptr<ArrayBuffer>> audio SWIFT_PRIVATE;
|
|
46
|
-
|
|
47
|
-
public:
|
|
48
|
-
VoiceInputResult() = default;
|
|
49
|
-
explicit VoiceInputResult(std::optional<std::string> transcription, std::optional<std::shared_ptr<ArrayBuffer>> audio): transcription(transcription), audio(audio) {}
|
|
50
|
-
|
|
51
|
-
public:
|
|
52
|
-
friend bool operator==(const VoiceInputResult& lhs, const VoiceInputResult& rhs) = default;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
56
|
-
|
|
57
|
-
namespace margelo::nitro {
|
|
58
|
-
|
|
59
|
-
// C++ VoiceInputResult <> JS VoiceInputResult (object)
|
|
60
|
-
template <>
|
|
61
|
-
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputResult> final {
|
|
62
|
-
static inline margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
-
return margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputResult(
|
|
65
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transcription"))),
|
|
66
|
-
JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "audio")))
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::VoiceInputResult& arg) {
|
|
70
|
-
jsi::Object obj(runtime);
|
|
71
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "transcription"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.transcription));
|
|
72
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "audio"), JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::toJSI(runtime, arg.audio));
|
|
73
|
-
return obj;
|
|
74
|
-
}
|
|
75
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
76
|
-
if (!value.isObject()) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
jsi::Object obj = value.getObject(runtime);
|
|
80
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transcription")))) return false;
|
|
84
|
-
if (!JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "audio")))) return false;
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
} // namespace margelo::nitro
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
-
import type { Voice } from '../specs/Voice.nitro';
|
|
3
|
-
import type { VoiceInputOptions, VoiceInputResult } from '../types/Voice';
|
|
4
|
-
|
|
5
|
-
const _native = NitroModules.createHybridObject<Voice>('Voice');
|
|
6
|
-
|
|
7
|
-
type StartVoiceInput = {
|
|
8
|
-
(options: VoiceInputOptions & Required<Pick<VoiceInputOptions, 'onChunk'>>): Promise<void>;
|
|
9
|
-
(options?: Omit<VoiceInputOptions, 'onChunk'>): Promise<VoiceInputResult>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const startVoiceInput: StartVoiceInput = (async (options?: VoiceInputOptions) => {
|
|
13
|
-
const { onChunk, silenceThresholdMs, maxDurationMs, listeningText, preferSpeechToText } =
|
|
14
|
-
options ?? {};
|
|
15
|
-
const result = await _native.startVoiceInput(
|
|
16
|
-
silenceThresholdMs,
|
|
17
|
-
maxDurationMs,
|
|
18
|
-
listeningText,
|
|
19
|
-
preferSpeechToText,
|
|
20
|
-
onChunk
|
|
21
|
-
);
|
|
22
|
-
return onChunk !== undefined ? undefined : result;
|
|
23
|
-
}) as unknown as StartVoiceInput;
|
|
24
|
-
|
|
25
|
-
export const HybridVoice = {
|
|
26
|
-
hasVoiceInputPermission: () => _native.hasVoiceInputPermission(),
|
|
27
|
-
requestVoiceInputPermission: () => _native.requestVoiceInputPermission(),
|
|
28
|
-
startVoiceInput,
|
|
29
|
-
stopVoiceInput: () => _native.stopVoiceInput(),
|
|
30
|
-
};
|
package/src/specs/Voice.nitro.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
import type { VoiceInputChunk, VoiceInputResult } from '../types/Voice';
|
|
3
|
-
|
|
4
|
-
export interface Voice extends HybridObject<{ android: 'kotlin'; ios: 'swift' }> {
|
|
5
|
-
/**
|
|
6
|
-
* Returns true if all permissions required for voice input are granted.
|
|
7
|
-
* On iOS: checks both microphone and speech recognition authorization.
|
|
8
|
-
* On Android: checks RECORD_AUDIO permission.
|
|
9
|
-
*/
|
|
10
|
-
hasVoiceInputPermission(): boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Request all permissions required for voice input.
|
|
14
|
-
* On iOS: requests microphone permission then speech recognition authorization.
|
|
15
|
-
* On Android: requests RECORD_AUDIO via car context when connected, otherwise
|
|
16
|
-
* via the React Native application context.
|
|
17
|
-
* Returns true only if all required permissions were granted.
|
|
18
|
-
*/
|
|
19
|
-
requestVoiceInputPermission(): Promise<boolean>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Start an in-app voice session.
|
|
23
|
-
*
|
|
24
|
-
* When preferSpeechToText is true:
|
|
25
|
-
* iOS — streams audio buffers into SFSpeechRecognizer during recording;
|
|
26
|
-
* onChunk fires with partial transcription results; resolves with
|
|
27
|
-
* { transcription } or falls back to { audio } if unavailable.
|
|
28
|
-
* Android — checks SpeechRecognizer availability upfront; if available it
|
|
29
|
-
* owns the mic and streams partial results via onChunk; if not
|
|
30
|
-
* available falls back to PCM recording.
|
|
31
|
-
*
|
|
32
|
-
* When preferSpeechToText is false (default):
|
|
33
|
-
* Both platforms record raw PCM; onChunk fires with audio chunks;
|
|
34
|
-
* resolves with { audio }.
|
|
35
|
-
*
|
|
36
|
-
* @param silenceThresholdMs ms of silence before auto-stop (default 1500)
|
|
37
|
-
* @param maxDurationMs hard cap on recording duration (default 10000)
|
|
38
|
-
* @param listeningText iOS only — text shown on CPVoiceControlTemplate
|
|
39
|
-
* @param preferSpeechToText request STT transcription instead of raw PCM
|
|
40
|
-
* @param onChunk optional streaming callback; when set the
|
|
41
|
-
* promise resolves with an empty VoiceInputResult
|
|
42
|
-
*/
|
|
43
|
-
startVoiceInput(
|
|
44
|
-
silenceThresholdMs?: number,
|
|
45
|
-
maxDurationMs?: number,
|
|
46
|
-
listeningText?: string,
|
|
47
|
-
preferSpeechToText?: boolean,
|
|
48
|
-
onChunk?: (chunk: VoiceInputChunk) => void
|
|
49
|
-
): Promise<VoiceInputResult>;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Stop the active voice session early.
|
|
53
|
-
* For PCM mode: resolves startVoiceInput with audio captured so far.
|
|
54
|
-
* For STT mode: finalises the recognition request.
|
|
55
|
-
* No-op if no session is active.
|
|
56
|
-
*/
|
|
57
|
-
stopVoiceInput(): void;
|
|
58
|
-
}
|
package/src/types/Voice.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface VoiceInputChunk {
|
|
2
|
-
partial?: string;
|
|
3
|
-
audio?: ArrayBuffer;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface VoiceInputResult {
|
|
7
|
-
transcription?: string;
|
|
8
|
-
audio?: ArrayBuffer;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface VoiceInputOptions {
|
|
12
|
-
silenceThresholdMs?: number;
|
|
13
|
-
maxDurationMs?: number;
|
|
14
|
-
listeningText?: string;
|
|
15
|
-
preferSpeechToText?: boolean;
|
|
16
|
-
onChunk?: (chunk: VoiceInputChunk) => void;
|
|
17
|
-
}
|