Skip to content

homemade-alexa/audio_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Server

A minimal FastAPI server responsible for playing WAV audio via aplay. Runs on a host with a connected speaker (Raspberry Pi / any Linux with ALSA). Called by the Homemade Alexa Server after a TTS response is generated.

Requirements

  • Python 3
  • aplay (from the alsa-utils package)
  • Configured ALSA audio output

Installation and usage

pip install -r requirements.txt
./run.sh

The server starts on 0.0.0.0:1234.

Deployment

The server address is configured on the Alexa Server side in config.toml:

[audio_server]
url = "http://YOUR_AUDIO_SERVER_IP:1234"

Endpoints

Method Path Description
POST /api/play Body: raw WAV bytes; starts playback via aplay; returns immediately with {"status": "playing"}
POST /api/abort Stops current playback (SIGKILL on aplay); returns {"status": "aborted"} or {"status": "nothing_playing"}

Behavior

  • Playback runs in a separate thread — the server responds immediately without blocking subsequent requests.
  • Calling /api/play while playback is already in progress kills the current aplay process before starting a new one.
  • /api/abort is called by the Alexa Server when the ESP32 device detects a wake word during response playback.

About

Homemade Alexa audio server

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors