https://github.com/revolunet/httpaudioplayer
Audio player for in-stores sonorisation that offers a simple HTTP API
https://github.com/revolunet/httpaudioplayer
api audio http player python
Last synced: about 1 year ago
JSON representation
Audio player for in-stores sonorisation that offers a simple HTTP API
- Host: GitHub
- URL: https://github.com/revolunet/httpaudioplayer
- Owner: revolunet
- License: mit
- Created: 2015-07-20T17:41:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-07-21T00:04:17.000Z (over 7 years ago)
- Last Synced: 2025-03-24T06:58:52.878Z (about 1 year ago)
- Topics: api, audio, http, player, python
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# httpaudioplayer
Minimal Python audio player for in-stores sonorisation that offers a basic HTTP API to play on-demand sounds.
It can play an infinite sound loop in background and play on-demand sounds via HTTP API.
Based on [pygame](http://pygame.org), works nicely with [raspberry PI](https://www.raspberrypi.org/).
- Play local/remote OGG files on-demand
- Play a background sound loop
- Expose sound control HTTP API on http://0.0.0.0:8082
:bulb: If you're looking for a full-featured, battle-tested music server, go checkout [MOPIDY](https://github.com/mopidy/mopidy)
## Install
- [download](https://github.com/revolunet/httpaudioplayer/archive/master.zip) the project
- `pip install -r requirements.txt`
Run with `python player.py /path/to/some/loop.ogg`
## Auto start
- add `/home/pi/httpaudioplayer/start.sh &` to `/etc/rc.local`
- use `screen -x` to get the player session
### HTTP API
serves on port 8082
- **GET `/play/http://sounds.com/example.ogg`** : download and play
- **GET `/loop/http://sounds.com/example-loop.ogg`** : download and play this sound as loop
### Notes on OSX
I had to install a 32bit python version to make pygame work for some reason.
So from OSX i start it with `python2-32 player.py`
### Todo
- support other file types
- caching/pre-heat