Plays music from a URL or local file. Demonstrates music mode, audio downloading, and the play_audio / play_from_audio_file APIs.
- "play music"
- "play a song"
- "play some music"
- "music player"
No API key required. Uses a sample public domain track by default.
To play your own music, either:
- Change
SAMPLE_MUSIC_URLto a direct MP3 URL - Or place an MP3 file in this folder and use
play_from_audio_file("yourfile.mp3")
- Enters music mode (signals hardware/UI that audio is playing)
- Downloads MP3 from URL
- Plays the audio
- Exits music mode
- Returns to normal conversation
play_audio()— Play audio from bytesplay_from_audio_file()— Play audio from Ability foldersend_data_over_websocket()— Toggle music modemusic_mode_event— Hardware state flag
User: "Play some music" AI: "Playing some music for you." [Music plays]