beam_audio
beam_audio runs a voice turn (speech-to-text, agent, text-to-speech) and gives you the pieces for a
WebSocket protocol. It does not include a WebSocket server.
beam_audio = { path = "../riverbeam/crates/beam_audio", features = ["audio-http-stt"] }
| Feature | Effect |
|---|---|
audio-http-stt | HttpStt |
audio-whisper | Alias for audio-http-stt |
audio-decode | WebM input reports BEM-352 instead of BEM-353 |
Types
| Item | Role |
|---|---|
run_audio_turn(audio, seq, session_id, stt, tts, invoker, sink) | One turn |
SttBackend, TtsBackend, AudioInvoker, AudioSink | The traits you implement or pick |
MockStt, MockTts, HttpStt | Shipped backends |
AudioSession, SessionState, can_transition, AppendOutcome | Session state and buffering |
ControlMessage, ControlType, ServerMessage | WebSocket messages |
pcm_f32_to_wav_bytes, parse_wav_pcm_f32, resample_pcm, decode_to_pcm_16k, is_probable_webm | Audio formats |
MAX_AUDIO_CHUNK_BYTES, MAX_AUDIO_BUFFER_BYTES, MIN_UTTERANCE_BYTES, MAX_MSG_PER_SEC, HEARTBEAT_INTERVAL_SEC, HEARTBEAT_TIMEOUT_SEC | Limits |
The protocol and the turn's message order are in Realtime audio.