refactor: formaliza formatos de áudio e alinhamento PCM
This commit is contained in:
@@ -733,3 +733,14 @@ test("barge-in resets player before new TTS response", () => {
|
||||
assert.equal(finished, false);
|
||||
assert.equal(resetCount, 1);
|
||||
});
|
||||
|
||||
|
||||
test("session.ready configures output before starting microphone capture", () => {
|
||||
const { controller } = makeController();
|
||||
const operations = [];
|
||||
const format = { encoding: "pcm_s16le", sample_rate: 24000, channels: 1 };
|
||||
controller.player = { configure: (received) => operations.push(received) };
|
||||
controller.startListening = () => operations.push("listen");
|
||||
controller.handleGatewayEvent({ type: "session.ready", output_audio: format });
|
||||
assert.deepEqual(operations, [format, "listen"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user