From 4743061d7f225607bc1dcb5d9c139a1d530df02e Mon Sep 17 00:00:00 2001 From: haixuantao Date: Sun, 10 Aug 2025 21:15:17 +0800 Subject: [PATCH] Add speech started topic --- examples/openai-realtime/whisper-template-metal.yml | 4 ++-- node-hub/dora-distil-whisper/dora_distil_whisper/main.py | 2 +- node-hub/dora-openai-websocket/src/main.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/openai-realtime/whisper-template-metal.yml b/examples/openai-realtime/whisper-template-metal.yml index 7120e540..6a438a61 100644 --- a/examples/openai-realtime/whisper-template-metal.yml +++ b/examples/openai-realtime/whisper-template-metal.yml @@ -4,7 +4,7 @@ nodes: inputs: audio: tts/audio text: stt/text - stop: stt/stop + speech_started: stt/speech_started outputs: - audio - text @@ -31,7 +31,7 @@ nodes: outputs: - text - word - - stop + - speech_started - id: llm build: pip install -e ../../node-hub/dora-qwen diff --git a/node-hub/dora-distil-whisper/dora_distil_whisper/main.py b/node-hub/dora-distil-whisper/dora_distil_whisper/main.py index 3710bf0c..3c31e291 100644 --- a/node-hub/dora-distil-whisper/dora_distil_whisper/main.py +++ b/node-hub/dora-distil-whisper/dora_distil_whisper/main.py @@ -268,7 +268,7 @@ def main(): pa.array([text]), ) node.send_output( - "stop", + "speech_started", pa.array([text]), ) cache_audio = None diff --git a/node-hub/dora-openai-websocket/src/main.rs b/node-hub/dora-openai-websocket/src/main.rs index 44a19b83..e9ab5a2e 100644 --- a/node-hub/dora-openai-websocket/src/main.rs +++ b/node-hub/dora-openai-websocket/src/main.rs @@ -367,10 +367,10 @@ async fn handle_client(fut: upgrade::UpgradeFut) -> Result<(), WebSocketError> { .into(), )); frame - } else if id.contains("stop") { + } else if id.contains("") { let serialized_data = - OpenAIRealtimeResponse::InputAudioBufferSpeechStopped { - audio_end_ms: 123, + OpenAIRealtimeResponse::InputAudioBufferSpeechStarted { + audio_start_ms: 123, item_id: "123".to_string(), }; finished = true;