Show HN: Rust Client Library for Gradium.ai TTS/STT API
github.com·4d·
Discuss: Hacker News
🎬WebCodecs API
Preview
Report Post

rust-gradium

Rust client library for Gradium AI Text-to-Speech (TTS) and Speech-to-Text (STT) WebSocket APIs.

Features

  • Text-to-Speech (TTS): Stream text to synthesized audio
  • Speech-to-Text (STT): Stream audio for real-time transcription
  • Async/await with Tokio runtime
  • Automatic WebSocket ping/pong handling
  • Thread-safe bounded queues for audio/text buffering

Installation

Add to your Cargo.toml:

[dependencies]
rust-gradium = "0.1"
tokio = { version = "1.0", features = ["rt-multi-thread", "macros"] }

Quick Start

Text-to-Speech

use rust_gradium::{TtsClient, TtsConfig, TTS_ENDPOINT, DEFAULT_VOICE_ID};

#[tokio::main]
async fn main() -> Result<(), rust_gradium::Error> {
let config = TtsConfig::new(
TTS_ENDPO...

Similar Posts

Loading similar posts...