Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnvinyard/audiorepl
https://github.com/johnvinyard/audiorepl
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnvinyard/audiorepl
- Owner: JohnVinyard
- Created: 2016-02-06T15:33:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-06T20:14:25.000Z (almost 9 years ago)
- Last Synced: 2023-04-07T14:21:09.433Z (over 1 year ago)
- Language: C
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AudioRepl
`audiorepl` is a python module written to play audio interactively in the repl, but could be embedded in any program that needs to play audio.## Interactive Repl Session
```python
>>> import audiorepl
>>> import numpy as np
>>> player = audiorepl.AudioPlayer()
>>> player.start_audio_engine()
>>> samples = np.random.random_sample(44100 * 2)
>>> player.play(samples) # you should hear two seconds of white noise
>>> player.stop_audio_engine()
```## Embedded in a Program as a Context Manager
```python
import audiorepl
import numpy as npsamples = np.random.random_sample(44100 * 2)
with audiorepl.AudioPlayer() as player:
player.play(samples)
```## Installation
`setup.py` needs a lot of work, as it does several non-standard things, and relies on `sudo`.
```bash
wget https://github.com/JohnVinyard/audiorepl/archive/master.zip
unzip master.zip
cd audiorepl-master
sudo python setup.py install
````setup.py` will add the current user to the "audio" group, which will require a logout before taking effect.