Skip to content

websocket api#11

Merged
kingzcheung merged 15 commits intomainfrom
asr
Jan 16, 2026
Merged

websocket api#11
kingzcheung merged 15 commits intomainfrom
asr

Conversation

@kingzcheung
Copy link
Copy Markdown
Owner

@kingzcheung kingzcheung commented Jan 14, 2026

  • TTS
    • CosyVoice
    • Sambert
  • ASR
    • Fun-asr
    • Paraformer
    • Gummy
  • Docs

…troduce new WebSocket-based ASR client

- Deleted the previous `audio.rs` file containing TTS and ASR implementations.
- Removed the `client.rs` file for ASR operations.
- Updated `mod.rs` to reflect the new structure and added WebSocket client functionality.
- Introduced a new `WsClient` struct for managing WebSocket connections.
- Created a new `asr` module with a more structured approach to handle ASR operations via WebSocket.
- Added new parameter and payload structures for ASR tasks, including serialization and deserialization logic.
- Implemented a new example for ASR using WebSocket, demonstrating how to send audio data and handle responses.
- Updated the `audio` module to include TTS and ASR functionalities with appropriate error handling.
…lementation

- Deleted legacy ASR output and parameter structures from `src/operation/audio/asr/output.rs` and `src/operation/audio/asr/param.rs`.
- Introduced new WebSocket-based ASR structures in `src/operation/audio/ws/output.rs` and `src/operation/audio/ws/param.rs`.
- Updated `src/operation/audio/mod.rs` to integrate the new WebSocket ASR functionality.
- Implemented `WebsocketInference` struct for handling WebSocket connections and events.
- Added callback trait for handling WebSocket events and responses.
- Ensured backward compatibility by maintaining similar structures and methods in the new implementation.
This commit introduces a new Rust file `convert_bytes.rs` that contains a main function. The function initializes a byte array representing a JSON string and attempts to convert it to a UTF-8 string. If successful, it prints the JSON string; otherwise, it prints an error message.
@kingzcheung kingzcheung self-assigned this Jan 14, 2026
@kingzcheung kingzcheung linked an issue Jan 14, 2026 that may be closed by this pull request
- Implemented `asr_ws` and `tts_ws` methods in the Audio struct for WebSocket inference.
- Refactored WebSocket event handling in `output.rs` to streamline event processing.
- Introduced new enums for task actions and types to enhance clarity in task management.
- Created utility functions for generating ASR and TTS task parameters.
- Added example implementations for WebSocket-based ASR and TTS in `websocket_asr.rs` and `websocket_tts.rs`.
- Enhanced task parameter structures to support optional fields and improved serialization.
@kingzcheung kingzcheung merged commit 1d2d0c2 into main Jan 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Any plan for supporting ASR?

1 participant