Skip to main content

Speaker — Mute / Play WAV / Stop

WhatWhere
Route moduleos/hal/routes/music.py
POST /audio/play — play a music track or WAV pathdef audio_play(req: MusicPlayRequest)
POST /audio/stop — stop current playbackdef audio_stop()
POST /speaker/mute — mute the speaker at the ALSA level (TTS still runs but silent)def mute_speaker()
POST /speaker/unmute — restoredef unmute_speaker()
GET /audio/status — what's playing right nowdef audio_status()
# Play a local WAV (playing music via the LLM's music skill goes here too)
curl -X POST http://127.0.0.1:5001/audio/play \
-H 'Content-Type: application/json' \
-d '{"path": "/opt/hal/assets/ok.wav"}'

# Stop
curl -X POST http://127.0.0.1:5001/audio/stop

# Speaker mute / unmute — TTS keeps running, output is silenced
curl -X POST http://127.0.0.1:5001/speaker/mute
curl -X POST http://127.0.0.1:5001/speaker/unmute

/speaker/mute is the right knob if you want the device to still "think out loud" internally but not disturb the room — TTS advances, LEDs still pulse, only the audio out is muted. Use /tts/stop if you want it to actually shut up.