Open dvonthenen opened 2 months ago
The changes enhance the Text-to-Speech (TTS) functionality by integrating WebSocket connections for real-time audio generation from text. This update includes new example implementations, callback handlers, and WebSocket clients for communication with the Deepgram API. Additionally, constants for managing WebSocket interactions have been established, and the README has been updated to provide comprehensive guidance on leveraging these new features.
Files/Directories | Change Summary |
---|---|
README.md |
Expanded to include WebSocket functionalities for TTS with links to the Speak REST Client, API, and examples. |
docs.go |
Uncommented an import line for the WebSocket API under the speak package. |
examples/.../interactive/main.go , examples/.../simple/main.go |
Developed interactive and simple TTS examples using a callback structure to handle WebSocket responses. |
pkg/client/speak/v1/websocket/constants.go , pkg/client/speak/v1/websocket/new_using_callbacks.go |
Introduced constants for WebSocket interactions and functions for creating WebSocket connections with callback handlers for TTS services. |
pkg/client/listen/v1/websocket/client_callback.go |
Modified message inspection methods to focus on listening events and improved error handling for closed sockets. |
tests/unit_test/prerecorded_test.go |
Minor cosmetic change in a constant string for formatting. |
sequenceDiagram
participant User
participant Client
participant WebSocket
participant DeepgramAPI
User->>Client: Initialize TTS library
Client->>WebSocket: Create WebSocket client
WebSocket->>DeepgramAPI: Connect to Deepgram API
User->>Client: Send text for TTS
Client->>WebSocket: Send text message
WebSocket->>DeepgramAPI: Forward text message
DeepgramAPI->>WebSocket: Return audio data
WebSocket->>Client: Receive audio data
Client->>User: Provide audio output
DeepgramAPI->>WebSocket: Send end of stream
WebSocket->>Client: Receive end of stream
Client->>User: Notify completion
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Proposed changes
Reintroduce TTS WS
Types of changes
What types of changes does your code introduce to the community Go SDK? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
NA
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Chores