@node-webrtc-rust/bindings 0.9.19 → 0.9.21
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/index.d.ts +32 -1
- package/index.js +2 -1
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -299,10 +299,14 @@ export interface JsLanguageIdConfig {
|
|
|
299
299
|
allowlist?: Array<string>
|
|
300
300
|
minSpeechMs?: number
|
|
301
301
|
continuous?: boolean
|
|
302
|
+
timing?: string
|
|
302
303
|
lidMaxClipMs?: number
|
|
303
304
|
lidGateMaxWaitMs?: number
|
|
304
305
|
ttsExclusion?: boolean
|
|
305
306
|
}
|
|
307
|
+
export interface JsReplayConfig {
|
|
308
|
+
maxAgeMs?: number
|
|
309
|
+
}
|
|
306
310
|
export interface JsVoiceAgentConfig {
|
|
307
311
|
vad?: JsVadConfig
|
|
308
312
|
events?: JsEventsConfig
|
|
@@ -311,6 +315,7 @@ export interface JsVoiceAgentConfig {
|
|
|
311
315
|
languageId?: JsLanguageIdConfig
|
|
312
316
|
postUtteranceSilenceMs?: number
|
|
313
317
|
noiseSuppression?: JsNoiseSuppressionConfig
|
|
318
|
+
replay?: JsReplayConfig
|
|
314
319
|
}
|
|
315
320
|
export const enum JsSpeechEventType {
|
|
316
321
|
UserSpeakingStart = 'user_speaking_start',
|
|
@@ -318,6 +323,7 @@ export const enum JsSpeechEventType {
|
|
|
318
323
|
UserSpeechPartial = 'user_speech_partial',
|
|
319
324
|
UserSpeechFinal = 'user_speech_final',
|
|
320
325
|
UserLanguage = 'user_language',
|
|
326
|
+
LanguageIdSkipped = 'language_id_skipped',
|
|
321
327
|
AgentSpeakingStart = 'agent_speaking_start',
|
|
322
328
|
AgentSpeakingEnd = 'agent_speaking_end',
|
|
323
329
|
VadTriggered = 'vad_triggered',
|
|
@@ -329,7 +335,9 @@ export const enum JsSpeechEventType {
|
|
|
329
335
|
BargeIn = 'barge_in',
|
|
330
336
|
Error = 'error',
|
|
331
337
|
SttConfigUpdated = 'stt_config_updated',
|
|
332
|
-
TtsConfigUpdated = 'tts_config_updated'
|
|
338
|
+
TtsConfigUpdated = 'tts_config_updated',
|
|
339
|
+
SttHoldStarted = 'stt_hold_started',
|
|
340
|
+
SttHoldEnded = 'stt_hold_ended'
|
|
333
341
|
}
|
|
334
342
|
export interface JsSpeechEvent {
|
|
335
343
|
eventType: JsSpeechEventType
|
|
@@ -343,6 +351,23 @@ export interface JsSpeechEvent {
|
|
|
343
351
|
voice?: string
|
|
344
352
|
modelPath?: string
|
|
345
353
|
endpoint?: string
|
|
354
|
+
holdMode?: string
|
|
355
|
+
holdOutcome?: string
|
|
356
|
+
bufferedMs?: number
|
|
357
|
+
droppedMs?: number
|
|
358
|
+
reason?: string
|
|
359
|
+
speechMs?: number
|
|
360
|
+
}
|
|
361
|
+
export const enum JsSttHoldMode {
|
|
362
|
+
BufferReplay = 'buffer_replay',
|
|
363
|
+
FirstUtterance = 'first_utterance'
|
|
364
|
+
}
|
|
365
|
+
export interface JsBeginSttHoldOptions {
|
|
366
|
+
mode: JsSttHoldMode
|
|
367
|
+
maxBufferMs?: number
|
|
368
|
+
}
|
|
369
|
+
export interface JsReleaseSttHoldOptions {
|
|
370
|
+
replay: boolean
|
|
346
371
|
}
|
|
347
372
|
export interface JsUpdateTtsOptions {
|
|
348
373
|
cancelInflight?: boolean
|
|
@@ -582,6 +607,12 @@ export declare class JsVoiceAgent {
|
|
|
582
607
|
updateStt(config: JsSttConfig): Promise<void>
|
|
583
608
|
/** Apply a new TTS config before the next synthesis job. */
|
|
584
609
|
updateTts(config: JsTtsConfig, options?: JsUpdateTtsOptions | undefined | null): Promise<void>
|
|
610
|
+
/** Start a host STT hold: stop feeding/polling the current STT and buffer user PCM. */
|
|
611
|
+
beginSttHold(options: JsBeginSttHoldOptions): Promise<void>
|
|
612
|
+
/** End the hold after `update_stt`; `replay` decodes held audio through the new STT. */
|
|
613
|
+
releaseSttHold(options: JsReleaseSttHoldOptions): Promise<void>
|
|
614
|
+
/** Abort the hold: the old STT resumes and receives the buffered audio. */
|
|
615
|
+
cancelSttHold(): Promise<void>
|
|
585
616
|
/** Re-transcribe the last utterance PCM on the current STT provider (after `update_stt`). */
|
|
586
617
|
replayLastUtterance(): Promise<void>
|
|
587
618
|
}
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { JsConferenceRoom, JsConferenceServer, JsMixGraph, JsMixPlacement, JsRoomNoiseSuppression, JsMuteScope, JsRtcDataChannel, JsMediaStreamTrack, JsMediaStream, JsLocalAudioTrack, JsPeerConnection, JsRtpReceiver, JsRtpSender, JsRtpTransceiver, JsSessionAudioFormat, JsSessionRecorder, JsEventDeliveryMode, JsNoiseSuppressionProvider, JsVadSampleRate, JsSttVendor, JsTtsVendor, JsSpeechEventType, JsVoiceAgent, JsClipStatus, JsGrowingClipWriter, playClipFromPath, playClipFromBytes, playClipProgressive, getClipStatus, stopClip, takeClipFrame, preloadLanguageId, jsQuatIdentity, jsVec3Zero, version } = nativeBinding
|
|
313
|
+
const { JsConferenceRoom, JsConferenceServer, JsMixGraph, JsMixPlacement, JsRoomNoiseSuppression, JsMuteScope, JsRtcDataChannel, JsMediaStreamTrack, JsMediaStream, JsLocalAudioTrack, JsPeerConnection, JsRtpReceiver, JsRtpSender, JsRtpTransceiver, JsSessionAudioFormat, JsSessionRecorder, JsEventDeliveryMode, JsNoiseSuppressionProvider, JsVadSampleRate, JsSttVendor, JsTtsVendor, JsSpeechEventType, JsSttHoldMode, JsVoiceAgent, JsClipStatus, JsGrowingClipWriter, playClipFromPath, playClipFromBytes, playClipProgressive, getClipStatus, stopClip, takeClipFrame, preloadLanguageId, jsQuatIdentity, jsVec3Zero, version } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.JsConferenceRoom = JsConferenceRoom
|
|
316
316
|
module.exports.JsConferenceServer = JsConferenceServer
|
|
@@ -334,6 +334,7 @@ module.exports.JsVadSampleRate = JsVadSampleRate
|
|
|
334
334
|
module.exports.JsSttVendor = JsSttVendor
|
|
335
335
|
module.exports.JsTtsVendor = JsTtsVendor
|
|
336
336
|
module.exports.JsSpeechEventType = JsSpeechEventType
|
|
337
|
+
module.exports.JsSttHoldMode = JsSttHoldMode
|
|
337
338
|
module.exports.JsVoiceAgent = JsVoiceAgent
|
|
338
339
|
module.exports.JsClipStatus = JsClipStatus
|
|
339
340
|
module.exports.JsGrowingClipWriter = JsGrowingClipWriter
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-webrtc-rust/bindings",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.21",
|
|
4
4
|
"description": "NAPI-RS native bindings for node-webrtc-rust — WebRTC peer connections, data channels, and conference audio mixing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"@napi-rs/cli": "^2.18.0"
|
|
59
59
|
},
|
|
60
60
|
"optionalDependencies": {
|
|
61
|
-
"@node-webrtc-rust/bindings-win32-x64-msvc": "0.9.
|
|
62
|
-
"@node-webrtc-rust/bindings-darwin-x64": "0.9.
|
|
63
|
-
"@node-webrtc-rust/bindings-linux-x64-gnu": "0.9.
|
|
64
|
-
"@node-webrtc-rust/bindings-darwin-arm64": "0.9.
|
|
65
|
-
"@node-webrtc-rust/bindings-linux-arm64-gnu": "0.9.
|
|
66
|
-
"@node-webrtc-rust/bindings-linux-x64-musl": "0.9.
|
|
61
|
+
"@node-webrtc-rust/bindings-win32-x64-msvc": "0.9.21",
|
|
62
|
+
"@node-webrtc-rust/bindings-darwin-x64": "0.9.21",
|
|
63
|
+
"@node-webrtc-rust/bindings-linux-x64-gnu": "0.9.21",
|
|
64
|
+
"@node-webrtc-rust/bindings-darwin-arm64": "0.9.21",
|
|
65
|
+
"@node-webrtc-rust/bindings-linux-arm64-gnu": "0.9.21",
|
|
66
|
+
"@node-webrtc-rust/bindings-linux-x64-musl": "0.9.21"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=18"
|