refactor(examples): modify examples for new V6 architecture #647
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates and improves several real-time audio transcription and streaming examples, primarily by enhancing WebSocket usage, updating code to use newer client APIs, and reorganizing example files for clarity. The changes include replacing older synchronous examples with more complete and production-ready versions, introducing a new advanced Listen V2 example, and updating method calls to match the latest client library conventions.
Transcription Examples Modernization
examples/13-transcription-live-websocket.pythat streams audio chunks from a file in real time, simulating microphone input, and uses updated event handling and media transmission methods. The example also demonstrates both synchronous and asynchronous usage patterns.examples/07-transcription-live-websocket.py.Advanced Listen V2 Example
examples/14-transcription-live-websocket-v2.py, demonstrating advanced conversational speech recognition with Listen V2, including contextual turn detection and strict requirements for audio format and streaming.examples/26-transcription-live-websocket-v2.py, which lacked audio streaming and contextual turn handling.API Method Updates Across Streaming Examples
examples/21-text-to-speech-streaming.py, previouslyexamples/11-text-to-speech-streaming.py) to use the latest client API conventions (send_text,send_flush,send_close) for both synchronous and asynchronous usage. [1] [2]examples/30-voice-agent.py, previouslyexamples/09-voice-agent.py) to use new API methods (send_settings,send_media) and updated async usage accordingly. [1] [2]