@framers/agentos 0.1.168 → 0.1.170
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/dist/orchestration/runtime/VoiceTransportAdapter.d.ts +24 -86
- package/dist/orchestration/runtime/VoiceTransportAdapter.d.ts.map +1 -1
- package/dist/orchestration/runtime/VoiceTransportAdapter.js +66 -84
- package/dist/orchestration/runtime/VoiceTransportAdapter.js.map +1 -1
- package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts.map +1 -1
- package/dist/voice-pipeline/VoicePipelineOrchestrator.js +1 -0
- package/dist/voice-pipeline/VoicePipelineOrchestrator.js.map +1 -1
- package/dist/voice-pipeline/providers/ElevenLabsStreamingTTS.d.ts +73 -0
- package/dist/voice-pipeline/providers/ElevenLabsStreamingTTS.d.ts.map +1 -0
- package/dist/voice-pipeline/providers/ElevenLabsStreamingTTS.js +241 -0
- package/dist/voice-pipeline/providers/ElevenLabsStreamingTTS.js.map +1 -0
- package/package.json +1 -1
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
*
|
|
14
14
|
* ## `getNodeInput` / `deliverNodeOutput` contract
|
|
15
15
|
*
|
|
16
|
-
* - `getNodeInput(nodeId)`
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - `deliverNodeOutput(nodeId, output)`
|
|
20
|
-
*
|
|
16
|
+
* - `getNodeInput(nodeId)` delegates to `pipeline.waitForUserTurn()` when a
|
|
17
|
+
* pipeline is available, or falls back to listening for `turn_complete` on
|
|
18
|
+
* the transport directly.
|
|
19
|
+
* - `deliverNodeOutput(nodeId, output)` delegates to `pipeline.pushToTTS()`
|
|
20
|
+
* and emits a `voice_audio` outbound GraphEvent.
|
|
21
21
|
* - Both methods throw if called before `init()`.
|
|
22
22
|
*
|
|
23
23
|
* ## Lazy initialisation
|
|
@@ -51,19 +51,6 @@ import type { GraphEvent } from '../events/GraphEvent.js';
|
|
|
51
51
|
*
|
|
52
52
|
* All fields are optional -- defaults are resolved from agent.config.json or
|
|
53
53
|
* sensible library defaults within the voice pipeline itself.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* const config: VoiceTransportConfig = {
|
|
58
|
-
* stt: 'deepgram',
|
|
59
|
-
* tts: 'elevenlabs',
|
|
60
|
-
* voice: 'rachel',
|
|
61
|
-
* bargeIn: 'hard-cut',
|
|
62
|
-
* endpointing: 'semantic',
|
|
63
|
-
* diarization: true,
|
|
64
|
-
* language: 'en-US',
|
|
65
|
-
* };
|
|
66
|
-
* ```
|
|
67
54
|
*/
|
|
68
55
|
export interface VoiceTransportConfig {
|
|
69
56
|
/** STT provider identifier (e.g. `'deepgram'`, `'openai'`). */
|
|
@@ -98,22 +85,14 @@ export interface VoiceTransportConfig {
|
|
|
98
85
|
*
|
|
99
86
|
* 1. Construct with {@link VoiceTransportConfig}, an `IStreamTransport`, and an
|
|
100
87
|
* event sink callback.
|
|
101
|
-
* 2. Call `init()` once before the graph starts running. This
|
|
102
|
-
*
|
|
103
|
-
*
|
|
88
|
+
* 2. Call `init()` once before the graph starts running. This lazily imports
|
|
89
|
+
* `VoicePipelineOrchestrator`, creates an instance, and injects the transport
|
|
90
|
+
* into `state.scratch.voiceTransport`.
|
|
104
91
|
* 3. Use `getNodeInput()` to obtain the user's transcribed speech for a node.
|
|
105
|
-
*
|
|
106
|
-
* 4. Use `deliverNodeOutput()` to send the node's response to TTS
|
|
92
|
+
* Delegates to `pipeline.waitForUserTurn()` when a pipeline is available.
|
|
93
|
+
* 4. Use `deliverNodeOutput()` to send the node's response to TTS via
|
|
94
|
+
* `pipeline.pushToTTS()`.
|
|
107
95
|
* 5. Call `dispose()` to clean up resources when the session ends.
|
|
108
|
-
*
|
|
109
|
-
* ## Error handling
|
|
110
|
-
*
|
|
111
|
-
* Both `getNodeInput()` and `deliverNodeOutput()` throw `Error` if called
|
|
112
|
-
* before `init()`. After `dispose()`, the adapter is marked as uninitialised
|
|
113
|
-
* so subsequent calls also throw.
|
|
114
|
-
*
|
|
115
|
-
* @see {@link VoiceTransportConfig} -- the config shape forwarded to the pipeline.
|
|
116
|
-
* See `VoiceNodeExecutor` for the executor that interacts with the transport.
|
|
117
96
|
*/
|
|
118
97
|
export declare class VoiceTransportAdapter {
|
|
119
98
|
private readonly config;
|
|
@@ -122,7 +101,6 @@ export declare class VoiceTransportAdapter {
|
|
|
122
101
|
/**
|
|
123
102
|
* Lazily-initialised `VoicePipelineOrchestrator` instance.
|
|
124
103
|
* Typed as `any` to avoid a hard import cycle with the voice subsystem.
|
|
125
|
-
* In a full implementation this would be `VoicePipelineOrchestrator | null`.
|
|
126
104
|
*/
|
|
127
105
|
private pipeline;
|
|
128
106
|
/**
|
|
@@ -133,11 +111,8 @@ export declare class VoiceTransportAdapter {
|
|
|
133
111
|
/**
|
|
134
112
|
* Creates a new VoiceTransportAdapter.
|
|
135
113
|
*
|
|
136
|
-
* @param config - Voice pipeline configuration knobs.
|
|
137
|
-
*
|
|
138
|
-
* @param transport - Bidirectional audio/control stream transport
|
|
139
|
-
* (`IStreamTransport`). Must be an EventEmitter that
|
|
140
|
-
* emits `turn_complete` events for `getNodeInput()`.
|
|
114
|
+
* @param config - Voice pipeline configuration knobs.
|
|
115
|
+
* @param transport - Bidirectional audio/control stream transport (`IStreamTransport`).
|
|
141
116
|
* @param eventSink - Callback receiving all `GraphEvent` values emitted by
|
|
142
117
|
* this adapter. Must not throw.
|
|
143
118
|
*/
|
|
@@ -146,73 +121,36 @@ export declare class VoiceTransportAdapter {
|
|
|
146
121
|
/**
|
|
147
122
|
* Initialise the adapter.
|
|
148
123
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* started event to signal that the voice session is live.
|
|
153
|
-
*
|
|
154
|
-
* Must be called exactly once before `getNodeInput()` or
|
|
155
|
-
* `deliverNodeOutput()`. Calling `init()` multiple times is safe but
|
|
156
|
-
* redundant -- the transport reference is simply overwritten.
|
|
157
|
-
*
|
|
158
|
-
* @param state - Mutable `GraphState` (or partial) for the current run.
|
|
159
|
-
* `state.scratch` is created lazily if absent.
|
|
124
|
+
* Lazily imports `VoicePipelineOrchestrator`, creates an instance from config,
|
|
125
|
+
* injects the transport into `state.scratch.voiceTransport`, and emits a
|
|
126
|
+
* `voice_session` started event.
|
|
160
127
|
*/
|
|
161
128
|
init(state: Partial<GraphState>): Promise<void>;
|
|
162
129
|
/**
|
|
163
130
|
* Wait for the user's next speech turn and return the transcript text.
|
|
164
131
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* it listens for a single `'turn_complete'` event from the underlying transport
|
|
168
|
-
* and resolves with the transcript text.
|
|
169
|
-
*
|
|
170
|
-
* Also emits a {@link GraphEvent} of type `voice_turn_complete` so that the
|
|
171
|
-
* runtime event bus stays in sync with the transport-level turn lifecycle.
|
|
172
|
-
*
|
|
173
|
-
* @param nodeId - The id of the graph node requesting input; used to tag the
|
|
174
|
-
* emitted event for downstream filtering.
|
|
175
|
-
* @returns Resolved transcript string from the user's speech turn.
|
|
176
|
-
* @throws {Error} If called before `init()` or after `dispose()`.
|
|
132
|
+
* Delegates to `VoicePipelineOrchestrator.waitForUserTurn()` when a pipeline
|
|
133
|
+
* is available. Falls back to listening for `turn_complete` on the transport.
|
|
177
134
|
*/
|
|
178
135
|
getNodeInput(nodeId: string): Promise<string>;
|
|
179
136
|
/**
|
|
180
137
|
* Deliver a node's text output to the TTS engine.
|
|
181
138
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* this delegates to `VoicePipelineOrchestrator.pushToTTS(output)`.
|
|
185
|
-
*
|
|
186
|
-
* Emits a {@link GraphEvent} of type `voice_audio` (direction `'outbound'`)
|
|
187
|
-
* so that the runtime event bus records the TTS delivery.
|
|
188
|
-
*
|
|
189
|
-
* @param nodeId - The id of the graph node delivering the output; tags the
|
|
190
|
-
* emitted event for downstream filtering.
|
|
191
|
-
* @param _output - Text or async token stream to synthesise as speech.
|
|
192
|
-
* The underscore prefix indicates it is not yet consumed
|
|
193
|
-
* in the v1 stub implementation.
|
|
194
|
-
* @throws {Error} If called before `init()` or after `dispose()`.
|
|
139
|
+
* Delegates to `VoicePipelineOrchestrator.pushToTTS()` when a pipeline is
|
|
140
|
+
* available, then emits a `voice_audio` outbound GraphEvent.
|
|
195
141
|
*/
|
|
196
|
-
deliverNodeOutput(nodeId: string,
|
|
142
|
+
deliverNodeOutput(nodeId: string, output: string | AsyncIterable<string>): Promise<void>;
|
|
197
143
|
/**
|
|
198
144
|
* Handle a user barge-in at the transport level.
|
|
199
145
|
*
|
|
200
|
-
*
|
|
201
|
-
* speaking while the agent is mid-utterance. Emits a `voice_barge_in` event
|
|
202
|
-
* so that graph event consumers can react (e.g. cancel pending tool calls,
|
|
203
|
-
* stop TTS playback, or reroute the graph).
|
|
204
|
-
*
|
|
205
|
-
* @see {@link VoiceInterruptError} -- the structured error used inside the graph executor.
|
|
146
|
+
* Emits a `voice_barge_in` event so that graph event consumers can react.
|
|
206
147
|
*/
|
|
207
148
|
handleBargeIn(): void;
|
|
208
149
|
/**
|
|
209
150
|
* Dispose the adapter and emit a `voice_session` ended event.
|
|
210
151
|
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* This method is idempotent -- calling it multiple times simply re-emits the
|
|
215
|
-
* ended event and re-sets the initialised flag.
|
|
152
|
+
* Stops the pipeline if one was initialised, then marks the adapter as
|
|
153
|
+
* uninitialised so subsequent calls throw.
|
|
216
154
|
*/
|
|
217
155
|
dispose(): Promise<void>;
|
|
218
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTransportAdapter.d.ts","sourceRoot":"","sources":["../../../src/orchestration/runtime/VoiceTransportAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBA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AAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCrD;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuCnD;;;;;OAKG;IACG,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB9F;;;;OAIG;IACH,aAAa,IAAI,IAAI;IAarB;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B"}
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
*
|
|
14
14
|
* ## `getNodeInput` / `deliverNodeOutput` contract
|
|
15
15
|
*
|
|
16
|
-
* - `getNodeInput(nodeId)`
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - `deliverNodeOutput(nodeId, output)`
|
|
20
|
-
*
|
|
16
|
+
* - `getNodeInput(nodeId)` delegates to `pipeline.waitForUserTurn()` when a
|
|
17
|
+
* pipeline is available, or falls back to listening for `turn_complete` on
|
|
18
|
+
* the transport directly.
|
|
19
|
+
* - `deliverNodeOutput(nodeId, output)` delegates to `pipeline.pushToTTS()`
|
|
20
|
+
* and emits a `voice_audio` outbound GraphEvent.
|
|
21
21
|
* - Both methods throw if called before `init()`.
|
|
22
22
|
*
|
|
23
23
|
* ## Lazy initialisation
|
|
@@ -53,32 +53,21 @@
|
|
|
53
53
|
*
|
|
54
54
|
* 1. Construct with {@link VoiceTransportConfig}, an `IStreamTransport`, and an
|
|
55
55
|
* event sink callback.
|
|
56
|
-
* 2. Call `init()` once before the graph starts running. This
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* 2. Call `init()` once before the graph starts running. This lazily imports
|
|
57
|
+
* `VoicePipelineOrchestrator`, creates an instance, and injects the transport
|
|
58
|
+
* into `state.scratch.voiceTransport`.
|
|
59
59
|
* 3. Use `getNodeInput()` to obtain the user's transcribed speech for a node.
|
|
60
|
-
*
|
|
61
|
-
* 4. Use `deliverNodeOutput()` to send the node's response to TTS
|
|
60
|
+
* Delegates to `pipeline.waitForUserTurn()` when a pipeline is available.
|
|
61
|
+
* 4. Use `deliverNodeOutput()` to send the node's response to TTS via
|
|
62
|
+
* `pipeline.pushToTTS()`.
|
|
62
63
|
* 5. Call `dispose()` to clean up resources when the session ends.
|
|
63
|
-
*
|
|
64
|
-
* ## Error handling
|
|
65
|
-
*
|
|
66
|
-
* Both `getNodeInput()` and `deliverNodeOutput()` throw `Error` if called
|
|
67
|
-
* before `init()`. After `dispose()`, the adapter is marked as uninitialised
|
|
68
|
-
* so subsequent calls also throw.
|
|
69
|
-
*
|
|
70
|
-
* @see {@link VoiceTransportConfig} -- the config shape forwarded to the pipeline.
|
|
71
|
-
* See `VoiceNodeExecutor` for the executor that interacts with the transport.
|
|
72
64
|
*/
|
|
73
65
|
export class VoiceTransportAdapter {
|
|
74
66
|
/**
|
|
75
67
|
* Creates a new VoiceTransportAdapter.
|
|
76
68
|
*
|
|
77
|
-
* @param config - Voice pipeline configuration knobs.
|
|
78
|
-
*
|
|
79
|
-
* @param transport - Bidirectional audio/control stream transport
|
|
80
|
-
* (`IStreamTransport`). Must be an EventEmitter that
|
|
81
|
-
* emits `turn_complete` events for `getNodeInput()`.
|
|
69
|
+
* @param config - Voice pipeline configuration knobs.
|
|
70
|
+
* @param transport - Bidirectional audio/control stream transport (`IStreamTransport`).
|
|
82
71
|
* @param eventSink - Callback receiving all `GraphEvent` values emitted by
|
|
83
72
|
* this adapter. Must not throw.
|
|
84
73
|
*/
|
|
@@ -90,9 +79,8 @@ export class VoiceTransportAdapter {
|
|
|
90
79
|
/**
|
|
91
80
|
* Lazily-initialised `VoicePipelineOrchestrator` instance.
|
|
92
81
|
* Typed as `any` to avoid a hard import cycle with the voice subsystem.
|
|
93
|
-
* In a full implementation this would be `VoicePipelineOrchestrator | null`.
|
|
94
82
|
*/
|
|
95
|
-
this.pipeline = null;
|
|
83
|
+
this.pipeline = null;
|
|
96
84
|
/**
|
|
97
85
|
* Tracks whether `init()` has been called successfully.
|
|
98
86
|
* Set to `false` by `dispose()` to prevent use-after-teardown.
|
|
@@ -105,24 +93,30 @@ export class VoiceTransportAdapter {
|
|
|
105
93
|
/**
|
|
106
94
|
* Initialise the adapter.
|
|
107
95
|
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* started event to signal that the voice session is live.
|
|
112
|
-
*
|
|
113
|
-
* Must be called exactly once before `getNodeInput()` or
|
|
114
|
-
* `deliverNodeOutput()`. Calling `init()` multiple times is safe but
|
|
115
|
-
* redundant -- the transport reference is simply overwritten.
|
|
116
|
-
*
|
|
117
|
-
* @param state - Mutable `GraphState` (or partial) for the current run.
|
|
118
|
-
* `state.scratch` is created lazily if absent.
|
|
96
|
+
* Lazily imports `VoicePipelineOrchestrator`, creates an instance from config,
|
|
97
|
+
* injects the transport into `state.scratch.voiceTransport`, and emits a
|
|
98
|
+
* `voice_session` started event.
|
|
119
99
|
*/
|
|
120
100
|
async init(state) {
|
|
121
101
|
var _a;
|
|
122
|
-
// Lazily create the scratch bag if the caller passed a partial state
|
|
123
|
-
// without a pre-existing scratch object.
|
|
124
102
|
const scratch = ((_a = state).scratch ?? (_a.scratch = {}));
|
|
125
103
|
scratch.voiceTransport = this.transport;
|
|
104
|
+
// Lazily import to avoid hard dependency cycle with the voice subsystem
|
|
105
|
+
try {
|
|
106
|
+
const { VoicePipelineOrchestrator } = await import('../../voice-pipeline/VoicePipelineOrchestrator.js');
|
|
107
|
+
this.pipeline = new VoicePipelineOrchestrator({
|
|
108
|
+
stt: this.config.stt ?? 'deepgram',
|
|
109
|
+
tts: this.config.tts ?? 'elevenlabs',
|
|
110
|
+
endpointing: this.config.endpointing,
|
|
111
|
+
bargeIn: this.config.bargeIn,
|
|
112
|
+
voice: this.config.voice,
|
|
113
|
+
language: this.config.language,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// Pipeline unavailable — fall back to transport-only mode
|
|
118
|
+
this.pipeline = null;
|
|
119
|
+
}
|
|
126
120
|
this.initialized = true;
|
|
127
121
|
this.eventSink({
|
|
128
122
|
type: 'voice_session',
|
|
@@ -130,33 +124,35 @@ export class VoiceTransportAdapter {
|
|
|
130
124
|
action: 'started',
|
|
131
125
|
});
|
|
132
126
|
}
|
|
127
|
+
// -------------------------------------------------------------------------
|
|
128
|
+
// Node I/O
|
|
129
|
+
// -------------------------------------------------------------------------
|
|
133
130
|
/**
|
|
134
131
|
* Wait for the user's next speech turn and return the transcript text.
|
|
135
132
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* it listens for a single `'turn_complete'` event from the underlying transport
|
|
139
|
-
* and resolves with the transcript text.
|
|
140
|
-
*
|
|
141
|
-
* Also emits a {@link GraphEvent} of type `voice_turn_complete` so that the
|
|
142
|
-
* runtime event bus stays in sync with the transport-level turn lifecycle.
|
|
143
|
-
*
|
|
144
|
-
* @param nodeId - The id of the graph node requesting input; used to tag the
|
|
145
|
-
* emitted event for downstream filtering.
|
|
146
|
-
* @returns Resolved transcript string from the user's speech turn.
|
|
147
|
-
* @throws {Error} If called before `init()` or after `dispose()`.
|
|
133
|
+
* Delegates to `VoicePipelineOrchestrator.waitForUserTurn()` when a pipeline
|
|
134
|
+
* is available. Falls back to listening for `turn_complete` on the transport.
|
|
148
135
|
*/
|
|
149
136
|
async getNodeInput(nodeId) {
|
|
150
137
|
if (!this.initialized) {
|
|
151
138
|
throw new Error('VoiceTransportAdapter not initialized');
|
|
152
139
|
}
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
140
|
+
// Delegate to pipeline if available
|
|
141
|
+
if (this.pipeline?.waitForUserTurn) {
|
|
142
|
+
const turnEvent = await this.pipeline.waitForUserTurn();
|
|
143
|
+
const transcript = turnEvent?.transcript ?? '';
|
|
144
|
+
this.eventSink({
|
|
145
|
+
type: 'voice_turn_complete',
|
|
146
|
+
nodeId,
|
|
147
|
+
transcript,
|
|
148
|
+
turnIndex: 0,
|
|
149
|
+
endpointReason: turnEvent?.reason ?? 'unknown',
|
|
150
|
+
});
|
|
151
|
+
return transcript;
|
|
152
|
+
}
|
|
153
|
+
// Fallback: listen on transport directly
|
|
156
154
|
return new Promise((resolve) => {
|
|
157
155
|
this.transport.once('turn_complete', (evt) => {
|
|
158
|
-
// Accept both `transcript` and `text` fields for compatibility
|
|
159
|
-
// with different transport implementations.
|
|
160
156
|
const transcript = evt?.transcript ?? evt?.text ?? '';
|
|
161
157
|
this.eventSink({
|
|
162
158
|
type: 'voice_turn_complete',
|
|
@@ -172,27 +168,17 @@ export class VoiceTransportAdapter {
|
|
|
172
168
|
/**
|
|
173
169
|
* Deliver a node's text output to the TTS engine.
|
|
174
170
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* this delegates to `VoicePipelineOrchestrator.pushToTTS(output)`.
|
|
178
|
-
*
|
|
179
|
-
* Emits a {@link GraphEvent} of type `voice_audio` (direction `'outbound'`)
|
|
180
|
-
* so that the runtime event bus records the TTS delivery.
|
|
181
|
-
*
|
|
182
|
-
* @param nodeId - The id of the graph node delivering the output; tags the
|
|
183
|
-
* emitted event for downstream filtering.
|
|
184
|
-
* @param _output - Text or async token stream to synthesise as speech.
|
|
185
|
-
* The underscore prefix indicates it is not yet consumed
|
|
186
|
-
* in the v1 stub implementation.
|
|
187
|
-
* @throws {Error} If called before `init()` or after `dispose()`.
|
|
171
|
+
* Delegates to `VoicePipelineOrchestrator.pushToTTS()` when a pipeline is
|
|
172
|
+
* available, then emits a `voice_audio` outbound GraphEvent.
|
|
188
173
|
*/
|
|
189
|
-
async deliverNodeOutput(nodeId,
|
|
174
|
+
async deliverNodeOutput(nodeId, output) {
|
|
190
175
|
if (!this.initialized) {
|
|
191
176
|
throw new Error('VoiceTransportAdapter not initialized');
|
|
192
177
|
}
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
178
|
+
// Delegate to pipeline TTS if available
|
|
179
|
+
if (this.pipeline?.pushToTTS) {
|
|
180
|
+
await this.pipeline.pushToTTS(output);
|
|
181
|
+
}
|
|
196
182
|
this.eventSink({
|
|
197
183
|
type: 'voice_audio',
|
|
198
184
|
nodeId,
|
|
@@ -207,12 +193,7 @@ export class VoiceTransportAdapter {
|
|
|
207
193
|
/**
|
|
208
194
|
* Handle a user barge-in at the transport level.
|
|
209
195
|
*
|
|
210
|
-
*
|
|
211
|
-
* speaking while the agent is mid-utterance. Emits a `voice_barge_in` event
|
|
212
|
-
* so that graph event consumers can react (e.g. cancel pending tool calls,
|
|
213
|
-
* stop TTS playback, or reroute the graph).
|
|
214
|
-
*
|
|
215
|
-
* @see {@link VoiceInterruptError} -- the structured error used inside the graph executor.
|
|
196
|
+
* Emits a `voice_barge_in` event so that graph event consumers can react.
|
|
216
197
|
*/
|
|
217
198
|
handleBargeIn() {
|
|
218
199
|
this.eventSink({
|
|
@@ -228,13 +209,13 @@ export class VoiceTransportAdapter {
|
|
|
228
209
|
/**
|
|
229
210
|
* Dispose the adapter and emit a `voice_session` ended event.
|
|
230
211
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* This method is idempotent -- calling it multiple times simply re-emits the
|
|
235
|
-
* ended event and re-sets the initialised flag.
|
|
212
|
+
* Stops the pipeline if one was initialised, then marks the adapter as
|
|
213
|
+
* uninitialised so subsequent calls throw.
|
|
236
214
|
*/
|
|
237
215
|
async dispose() {
|
|
216
|
+
if (this.pipeline?.stopSession) {
|
|
217
|
+
await this.pipeline.stopSession('adapter-disposed');
|
|
218
|
+
}
|
|
238
219
|
this.eventSink({
|
|
239
220
|
type: 'voice_session',
|
|
240
221
|
nodeId: '__transport__',
|
|
@@ -242,6 +223,7 @@ export class VoiceTransportAdapter {
|
|
|
242
223
|
exitReason: 'transport-disposed',
|
|
243
224
|
});
|
|
244
225
|
this.initialized = false;
|
|
226
|
+
this.pipeline = null;
|
|
245
227
|
}
|
|
246
228
|
}
|
|
247
229
|
//# sourceMappingURL=VoiceTransportAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTransportAdapter.js","sourceRoot":"","sources":["../../../src/orchestration/runtime/VoiceTransportAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;
|
|
1
|
+
{"version":3,"file":"VoiceTransportAdapter.js","sourceRoot":"","sources":["../../../src/orchestration/runtime/VoiceTransportAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAiDH,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,qBAAqB;IAahC;;;;;;;OAOG;IACH,YACmB,MAA4B,EAC5B,SAAc,EAAE,mBAAmB;IACnC,SAAsC;QAFtC,WAAM,GAAN,MAAM,CAAsB;QAC5B,cAAS,GAAT,SAAS,CAAK;QACd,cAAS,GAAT,SAAS,CAA6B;QAvBzD;;;WAGG;QACK,aAAQ,GAAe,IAAI,CAAC;QAEpC;;;WAGG;QACK,gBAAW,GAAG,KAAK,CAAC;IAczB,CAAC;IAEJ,4EAA4E;IAC5E,YAAY;IACZ,4EAA4E;IAE5E;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,KAA0B;;QACnC,MAAM,OAAO,GAAG,OAAE,KAAa,EAAC,OAAO,QAAP,OAAO,GAAK,EAAE,EAAC,CAAC;QAChD,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QAExC,wEAAwE;QACxE,IAAI,CAAC;YACH,MAAM,EAAE,yBAAyB,EAAE,GAAG,MAAM,MAAM,CAChD,mDAAmD,CACpD,CAAC;YACF,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAyB,CAAC;gBAC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5E,WAAW;IACX,4EAA4E;IAE5E;;;;;OAKG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;YAC/B,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,eAAe;YACvB,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,oBAAoB;SACjC,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePipelineOrchestrator.d.ts","sourceRoot":"","sources":["../../src/voice-pipeline/VoicePipelineOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,KAAK,EAGV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,aAAa,EAIb,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,YAAY,CAAC;AAMpB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,2CAA2C;IAC3C,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAMD;;;;;;;;;;;;;;GAcG;AACH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I,CAAC;IA4BjD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,eAAe,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAQnD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BpE;;;;;;;;;OASG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,iBAAiB;IAuDzB;;;;;;;;;OASG;IACH,OAAO,CAAC,mBAAmB;IAiC3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,YAAY;IAyDpB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,eAAe;IAoBvB;;;;;;;;OAQG;IACH,OAAO,CAAC,SAAS;IAYjB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAgBtB;;;OAGG;IACH,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -165,6 +165,7 @@ export class VoicePipelineOrchestrator extends EventEmitter {
|
|
|
165
165
|
const ttsSession = await tts.startSession({
|
|
166
166
|
voice: this.config.voice,
|
|
167
167
|
format: this.config.format,
|
|
168
|
+
providerOptions: this.config.ttsOptions,
|
|
168
169
|
});
|
|
169
170
|
// Store references for use by wiring helpers and teardown
|
|
170
171
|
this._sttSession = sttSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePipelineOrchestrator.js","sourceRoot":"","sources":["../../src/voice-pipeline/VoicePipelineOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAwDzC,+EAA+E;AAC/E,eAAe;AAC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,GAAG,EAAE;oBACrB,MAAM,EAAE,KAAK;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC;IAED;;;OAGG;IACK,cAAc;QACpB,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC;YACjC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"VoicePipelineOrchestrator.js","sourceRoot":"","sources":["../../src/voice-pipeline/VoicePipelineOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAwDzC,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,yBAA0B,SAAQ,YAAY;IA4CzD,6EAA6E;IAC7E,iBAAiB;IACjB,6EAA6E;IAE7E;;;;;;;;;OASG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,6EAA6E;IAC7E,cAAc;IACd,6EAA6E;IAE7E;;;;;;;OAOG;IACH,YAA6B,MAA2B;QACtD,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAqB;QAzExD,6EAA6E;QAC7E,gBAAgB;QAChB,6EAA6E;QAE7E,gGAAgG;QACxF,WAAM,GAAkB,MAAM,CAAC;QAEvC,oFAAoF;QAC5E,gBAAW,GAA+B,IAAI,CAAC;QAEvD,oFAAoF;QAC5E,gBAAW,GAA+B,IAAI,CAAC;QAEvD,qFAAqF;QAC7E,sBAAiB,GAA6B,IAAI,CAAC;QAE3D,wGAAwG;QAChG,oBAAe,GAA2B,IAAI,CAA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C,MAAM,CAAC;QACzB,kDAAkD;QAClD,IAAI,IAAI,KAAK,KAAK;YAAE,OAAO;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,6EAA6E;IAC7E,iBAAiB;IACjB,6EAA6E;IAE7E;;;;;;;;;OASG;IACK,cAAc;QACpB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,KAAM,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,GAAG,EAAE;YACpC,oEAAoE;YACpE,mEAAmE;YACnE,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBAChC,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC;oBACnC,IAAI,EAAE,YAAY;oBAClB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,MAAM,EAAE,KAAK;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC;IAED;;;OAGG;IACK,cAAc;QACpB,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC;YACjC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module voice-pipeline/providers/ElevenLabsStreamingTTS
|
|
3
|
+
*
|
|
4
|
+
* Streaming text-to-speech adapter that connects to ElevenLabs' WebSocket API
|
|
5
|
+
* and implements the {@link IStreamingTTS} / {@link StreamingTTSSession} interfaces
|
|
6
|
+
* required by {@link VoicePipelineOrchestrator}.
|
|
7
|
+
*
|
|
8
|
+
* ## ElevenLabs WebSocket Protocol
|
|
9
|
+
*
|
|
10
|
+
* - **Endpoint:** `wss://api.elevenlabs.io/v1/text-to-speech/{voiceId}/stream-input`
|
|
11
|
+
* - **Authentication:** `xi-api-key` query parameter
|
|
12
|
+
* - **Inbound (client → ElevenLabs):** JSON text chunks `{ text: "...", ... }`
|
|
13
|
+
* - **Outbound (ElevenLabs → client):** JSON with base64-encoded audio `{ audio: "...", ... }`
|
|
14
|
+
* - **Flush:** Send `{ text: "" }` to signal end-of-input and flush remaining audio
|
|
15
|
+
*
|
|
16
|
+
* ## Audio Output
|
|
17
|
+
*
|
|
18
|
+
* ElevenLabs returns audio as base64-encoded MP3 chunks. Each chunk is decoded
|
|
19
|
+
* and wrapped in an {@link EncodedAudioChunk} with format `'mp3'` before being
|
|
20
|
+
* emitted as an `'audio'` event.
|
|
21
|
+
*
|
|
22
|
+
* @see https://elevenlabs.io/docs/api-reference/websockets
|
|
23
|
+
*/
|
|
24
|
+
import type { IStreamingTTS, StreamingTTSSession, StreamingTTSConfig } from '../types.js';
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for the {@link ElevenLabsStreamingTTS} provider.
|
|
27
|
+
*/
|
|
28
|
+
export interface ElevenLabsStreamingTTSConfig {
|
|
29
|
+
/** ElevenLabs API key. */
|
|
30
|
+
apiKey: string;
|
|
31
|
+
/**
|
|
32
|
+
* Base URL for the ElevenLabs API (HTTP, not WS — the WS URL is derived).
|
|
33
|
+
* @default 'https://api.elevenlabs.io/v1'
|
|
34
|
+
*/
|
|
35
|
+
baseUrl?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Default voice ID for synthesis.
|
|
38
|
+
* @default 'EXAVITQu4vr4xnSDxMaL' (Sarah)
|
|
39
|
+
*/
|
|
40
|
+
voiceId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* ElevenLabs model ID.
|
|
43
|
+
* @default 'eleven_multilingual_v2'
|
|
44
|
+
*/
|
|
45
|
+
model?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Streaming TTS provider that creates ElevenLabs WebSocket sessions.
|
|
49
|
+
* Implements {@link IStreamingTTS} for use with {@link VoicePipelineOrchestrator}.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const tts = new ElevenLabsStreamingTTS({
|
|
54
|
+
* apiKey: process.env.ELEVENLABS_API_KEY!,
|
|
55
|
+
* voiceId: 'EXAVITQu4vr4xnSDxMaL',
|
|
56
|
+
* });
|
|
57
|
+
* const session = await tts.startSession({ voice: 'pNInz6obpgDQGcFmaJgB' });
|
|
58
|
+
* session.on('audio', (chunk) => transport.sendAudio(chunk));
|
|
59
|
+
* session.pushTokens('Hello there!');
|
|
60
|
+
* await session.flush();
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare class ElevenLabsStreamingTTS implements IStreamingTTS {
|
|
64
|
+
private readonly config;
|
|
65
|
+
readonly providerId = "elevenlabs-streaming";
|
|
66
|
+
constructor(config: ElevenLabsStreamingTTSConfig);
|
|
67
|
+
/**
|
|
68
|
+
* Create a new streaming TTS session connected to ElevenLabs.
|
|
69
|
+
* The session opens a WebSocket and is ready to receive text tokens.
|
|
70
|
+
*/
|
|
71
|
+
startSession(config?: StreamingTTSConfig): Promise<StreamingTTSSession>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=ElevenLabsStreamingTTS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElevenLabsStreamingTTS.d.ts","sourceRoot":"","sources":["../../../src/voice-pipeline/providers/ElevenLabsStreamingTTS.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8OD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAG9C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,UAAU,0BAA0B;gBAEhB,MAAM,EAAE,4BAA4B;IAEjE;;;OAGG;IACG,YAAY,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAK9E"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module voice-pipeline/providers/ElevenLabsStreamingTTS
|
|
3
|
+
*
|
|
4
|
+
* Streaming text-to-speech adapter that connects to ElevenLabs' WebSocket API
|
|
5
|
+
* and implements the {@link IStreamingTTS} / {@link StreamingTTSSession} interfaces
|
|
6
|
+
* required by {@link VoicePipelineOrchestrator}.
|
|
7
|
+
*
|
|
8
|
+
* ## ElevenLabs WebSocket Protocol
|
|
9
|
+
*
|
|
10
|
+
* - **Endpoint:** `wss://api.elevenlabs.io/v1/text-to-speech/{voiceId}/stream-input`
|
|
11
|
+
* - **Authentication:** `xi-api-key` query parameter
|
|
12
|
+
* - **Inbound (client → ElevenLabs):** JSON text chunks `{ text: "...", ... }`
|
|
13
|
+
* - **Outbound (ElevenLabs → client):** JSON with base64-encoded audio `{ audio: "...", ... }`
|
|
14
|
+
* - **Flush:** Send `{ text: "" }` to signal end-of-input and flush remaining audio
|
|
15
|
+
*
|
|
16
|
+
* ## Audio Output
|
|
17
|
+
*
|
|
18
|
+
* ElevenLabs returns audio as base64-encoded MP3 chunks. Each chunk is decoded
|
|
19
|
+
* and wrapped in an {@link EncodedAudioChunk} with format `'mp3'` before being
|
|
20
|
+
* emitted as an `'audio'` event.
|
|
21
|
+
*
|
|
22
|
+
* @see https://elevenlabs.io/docs/api-reference/websockets
|
|
23
|
+
*/
|
|
24
|
+
import { EventEmitter } from 'node:events';
|
|
25
|
+
import WebSocket from 'ws';
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Session Implementation
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
/**
|
|
30
|
+
* A live streaming TTS session connected to ElevenLabs via WebSocket.
|
|
31
|
+
* Emits `audio`, `flush_complete`, `error`, and `close` events as required
|
|
32
|
+
* by the voice pipeline orchestrator.
|
|
33
|
+
*/
|
|
34
|
+
class ElevenLabsStreamingTTSSession extends EventEmitter {
|
|
35
|
+
constructor(config, sessionConfig) {
|
|
36
|
+
super();
|
|
37
|
+
this.config = config;
|
|
38
|
+
this.sessionConfig = sessionConfig;
|
|
39
|
+
this.ws = null;
|
|
40
|
+
this.closed = false;
|
|
41
|
+
this.pendingFlush = false;
|
|
42
|
+
this.accumulatedText = '';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Open the WebSocket connection to ElevenLabs streaming endpoint.
|
|
46
|
+
* Sends the initial BOS (beginning of stream) message with generation config.
|
|
47
|
+
*/
|
|
48
|
+
async connect() {
|
|
49
|
+
const voiceId = this.sessionConfig.voice ?? this.config.voiceId ?? 'EXAVITQu4vr4xnSDxMaL';
|
|
50
|
+
const model = this.config.model ?? 'eleven_multilingual_v2';
|
|
51
|
+
// Convert HTTPS base URL to WSS
|
|
52
|
+
const httpBase = this.config.baseUrl ?? 'https://api.elevenlabs.io/v1';
|
|
53
|
+
const wsBase = httpBase.replace(/^https?:\/\//, 'wss://');
|
|
54
|
+
const params = new URLSearchParams({
|
|
55
|
+
model_id: model,
|
|
56
|
+
output_format: 'mp3_44100_128',
|
|
57
|
+
});
|
|
58
|
+
const url = `${wsBase}/text-to-speech/${voiceId}/stream-input?${params.toString()}`;
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
this.ws = new WebSocket(url, {
|
|
61
|
+
headers: {
|
|
62
|
+
'xi-api-key': this.config.apiKey,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
this.ws.on('open', () => {
|
|
66
|
+
// Send BOS (beginning of stream) message with generation settings
|
|
67
|
+
const opts = this.sessionConfig?.providerOptions ?? {};
|
|
68
|
+
this.ws.send(JSON.stringify({
|
|
69
|
+
text: ' ', // Initial space triggers the stream
|
|
70
|
+
voice_settings: {
|
|
71
|
+
stability: opts.stability ?? 0.5,
|
|
72
|
+
similarity_boost: opts.similarityBoost ?? 0.75,
|
|
73
|
+
style: opts.style ?? 0.0,
|
|
74
|
+
use_speaker_boost: opts.useSpeakerBoost ?? true,
|
|
75
|
+
},
|
|
76
|
+
generation_config: {
|
|
77
|
+
chunk_length_schedule: [120, 160, 250, 290],
|
|
78
|
+
...(opts.speed != null ? { speed: opts.speed } : {}),
|
|
79
|
+
},
|
|
80
|
+
}));
|
|
81
|
+
resolve();
|
|
82
|
+
});
|
|
83
|
+
this.ws.on('error', (err) => {
|
|
84
|
+
this.emit('error', err);
|
|
85
|
+
reject(err);
|
|
86
|
+
});
|
|
87
|
+
this.ws.on('message', (data) => {
|
|
88
|
+
this._handleMessage(typeof data === 'string' ? data : data.toString('utf-8'));
|
|
89
|
+
});
|
|
90
|
+
this.ws.on('close', () => {
|
|
91
|
+
this.closed = true;
|
|
92
|
+
this.emit('close');
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Push text tokens into the TTS stream.
|
|
98
|
+
* ElevenLabs expects text to be sent as JSON messages. Text is accumulated
|
|
99
|
+
* and sent in chunks to allow the synthesis engine to produce natural-sounding
|
|
100
|
+
* speech with proper prosody across sentence boundaries.
|
|
101
|
+
*/
|
|
102
|
+
pushTokens(tokens) {
|
|
103
|
+
if (this.closed || !this.ws || this.ws.readyState !== WebSocket.OPEN)
|
|
104
|
+
return;
|
|
105
|
+
this.accumulatedText += tokens;
|
|
106
|
+
// Send text to ElevenLabs as it arrives — the server handles buffering
|
|
107
|
+
// and chunking for optimal synthesis quality
|
|
108
|
+
this.ws.send(JSON.stringify({ text: tokens }));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Signal end-of-text and flush remaining audio from the synthesis buffer.
|
|
112
|
+
* ElevenLabs requires an empty text message to signal EOS (end of stream).
|
|
113
|
+
* Resolves when all audio has been received (the server sends an isFinal message).
|
|
114
|
+
*/
|
|
115
|
+
async flush() {
|
|
116
|
+
if (this.closed || !this.ws || this.ws.readyState !== WebSocket.OPEN)
|
|
117
|
+
return;
|
|
118
|
+
this.pendingFlush = true;
|
|
119
|
+
// Send EOS (end of stream) — empty string signals the end of input
|
|
120
|
+
this.ws.send(JSON.stringify({ text: '' }));
|
|
121
|
+
// Wait for the final audio chunk or timeout
|
|
122
|
+
return new Promise((resolve) => {
|
|
123
|
+
const onFlush = () => {
|
|
124
|
+
this.removeListener('_internal_flush', onFlush);
|
|
125
|
+
clearTimeout(timeout);
|
|
126
|
+
resolve();
|
|
127
|
+
};
|
|
128
|
+
// Safety timeout: resolve after 5s even if no final message arrives
|
|
129
|
+
const timeout = setTimeout(() => {
|
|
130
|
+
this.removeListener('_internal_flush', onFlush);
|
|
131
|
+
this.pendingFlush = false;
|
|
132
|
+
this.emit('flush_complete');
|
|
133
|
+
resolve();
|
|
134
|
+
}, 5000);
|
|
135
|
+
this.on('_internal_flush', onFlush);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Cancel the current synthesis and discard any pending audio.
|
|
140
|
+
* Closes the WebSocket — a new session must be created for more synthesis.
|
|
141
|
+
*/
|
|
142
|
+
cancel() {
|
|
143
|
+
this.pendingFlush = false;
|
|
144
|
+
this.accumulatedText = '';
|
|
145
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
146
|
+
// Send a close signal
|
|
147
|
+
this.ws.close(1000, 'cancelled');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Close the WebSocket connection and clean up.
|
|
152
|
+
*/
|
|
153
|
+
close() {
|
|
154
|
+
if (this.closed)
|
|
155
|
+
return;
|
|
156
|
+
this.closed = true;
|
|
157
|
+
if (this.ws) {
|
|
158
|
+
if (this.ws.readyState === WebSocket.OPEN) {
|
|
159
|
+
this.ws.close(1000, 'session closed');
|
|
160
|
+
}
|
|
161
|
+
this.ws = null;
|
|
162
|
+
}
|
|
163
|
+
this.emit('close');
|
|
164
|
+
}
|
|
165
|
+
// -------------------------------------------------------------------------
|
|
166
|
+
// Private
|
|
167
|
+
// -------------------------------------------------------------------------
|
|
168
|
+
/**
|
|
169
|
+
* Parse and dispatch an ElevenLabs WebSocket message.
|
|
170
|
+
* Audio chunks arrive as base64-encoded MP3 data that we decode and emit.
|
|
171
|
+
*/
|
|
172
|
+
_handleMessage(raw) {
|
|
173
|
+
let msg;
|
|
174
|
+
try {
|
|
175
|
+
msg = JSON.parse(raw);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return; // Malformed JSON — skip
|
|
179
|
+
}
|
|
180
|
+
// Audio chunk received
|
|
181
|
+
if (msg.audio) {
|
|
182
|
+
const audioBuffer = Buffer.from(msg.audio, 'base64');
|
|
183
|
+
// Estimate duration from MP3 byte count (128kbps MP3)
|
|
184
|
+
const durationMs = Math.round((audioBuffer.byteLength / ElevenLabsStreamingTTSSession.BYTES_PER_SEC_MP3) * 1000);
|
|
185
|
+
const chunk = {
|
|
186
|
+
audio: audioBuffer,
|
|
187
|
+
format: 'mp3',
|
|
188
|
+
sampleRate: 44100,
|
|
189
|
+
durationMs,
|
|
190
|
+
text: this.accumulatedText,
|
|
191
|
+
};
|
|
192
|
+
this.emit('audio', chunk);
|
|
193
|
+
}
|
|
194
|
+
// Final message — all audio has been sent
|
|
195
|
+
if (msg.isFinal) {
|
|
196
|
+
this.accumulatedText = '';
|
|
197
|
+
if (this.pendingFlush) {
|
|
198
|
+
this.pendingFlush = false;
|
|
199
|
+
this.emit('_internal_flush');
|
|
200
|
+
this.emit('flush_complete');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** Estimated bytes per second for duration calculation. MP3 at 128kbps = ~16000 bytes/sec. */
|
|
206
|
+
ElevenLabsStreamingTTSSession.BYTES_PER_SEC_MP3 = 16000;
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
// Provider (Factory)
|
|
209
|
+
// ---------------------------------------------------------------------------
|
|
210
|
+
/**
|
|
211
|
+
* Streaming TTS provider that creates ElevenLabs WebSocket sessions.
|
|
212
|
+
* Implements {@link IStreamingTTS} for use with {@link VoicePipelineOrchestrator}.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* const tts = new ElevenLabsStreamingTTS({
|
|
217
|
+
* apiKey: process.env.ELEVENLABS_API_KEY!,
|
|
218
|
+
* voiceId: 'EXAVITQu4vr4xnSDxMaL',
|
|
219
|
+
* });
|
|
220
|
+
* const session = await tts.startSession({ voice: 'pNInz6obpgDQGcFmaJgB' });
|
|
221
|
+
* session.on('audio', (chunk) => transport.sendAudio(chunk));
|
|
222
|
+
* session.pushTokens('Hello there!');
|
|
223
|
+
* await session.flush();
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
export class ElevenLabsStreamingTTS {
|
|
227
|
+
constructor(config) {
|
|
228
|
+
this.config = config;
|
|
229
|
+
this.providerId = 'elevenlabs-streaming';
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Create a new streaming TTS session connected to ElevenLabs.
|
|
233
|
+
* The session opens a WebSocket and is ready to receive text tokens.
|
|
234
|
+
*/
|
|
235
|
+
async startSession(config) {
|
|
236
|
+
const session = new ElevenLabsStreamingTTSSession(this.config, config ?? {});
|
|
237
|
+
await session.connect();
|
|
238
|
+
return session;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=ElevenLabsStreamingTTS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElevenLabsStreamingTTS.js","sourceRoot":"","sources":["../../../src/voice-pipeline/providers/ElevenLabsStreamingTTS.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,SAAS,MAAM,IAAI,CAAC;AAqD3B,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,6BAA8B,SAAQ,YAAY;IAStD,YACmB,MAAoC,EACpC,aAAiC;QAElD,KAAK,EAAE,CAAC;QAHS,WAAM,GAAN,MAAM,CAA8B;QACpC,kBAAa,GAAb,aAAa,CAAoB;QAV5C,OAAE,GAAqB,IAAI,CAAC;QAC5B,WAAM,GAAG,KAAK,CAAC;QACf,iBAAY,GAAG,KAAK,CAAC;QACrB,oBAAe,GAAG,EAAE,CAAC;IAU7B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,sBAAsB,CAAC;QAC1F,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,wBAAwB,CAAC;QAE5D,gCAAgC;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,8BAA8B,CAAC;QACvE,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QAE1D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;YACjC,QAAQ,EAAE,KAAK;YACf,aAAa,EAAE,eAAe;SAC/B,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG,GAAG,MAAM,mBAAmB,OAAO,iBAAiB,MAAM,CAAC,QAAQ,EAA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