me.fier.aspew/README.md

35 lines
1.5 KiB
Markdown
Raw Normal View History

2023-02-08 18:12:04 +00:00
# me.fier.aspew
2023-02-08 18:35:08 +00:00
Audio I/O for real-time applications, like VoIP.
2023-02-08 18:12:04 +00:00
2023-02-08 18:41:36 +00:00
## Prerequisites
### Python 3.4 or newer:
- **Windows:** [https://www.python.org/downloads/](https://www.python.org/downloads/)
- **Debian:** `apt install python3`
### PyAudio:
- **Windows:** `py -m pip install PyAudio`
- **Debian:** `apt install python3-pyaudio`
2023-02-08 18:35:08 +00:00
## Tools
- `aspew-in.py` takes a microphone as an input, and outputs it to pipe.
- `aspew-out.py` takes input from a pipe, and outputs it to a speaker.
## Arguments
Arguments are pairs of key=value.
2023-02-08 18:41:36 +00:00
### in & out:
2023-02-08 18:35:08 +00:00
- `device`: The device, a number (Default: Your default audio device.)
- `format`: The encoding of your audio, choices: [https://people.csail.mit.edu/hubert/pyaudio/docs/#pasampleformat](https://people.csail.mit.edu/hubert/pyaudio/docs/#pasampleformat) (Default: `paUInt8`)
- `channels`: How many channels the audio has (Default: `1`)
- `bitrate`: How high the refresh rate of the audio is in Hz (Default: `8000`)
- `buffersize`: The buffer-size, in seconds. Higher buffer-sizes reduce CPU load and risk of stutter, but raise delay (Default: `0.05`)
2023-02-08 18:41:36 +00:00
### out-only:
2023-02-08 18:35:08 +00:00
- `store`: How much audio to store in the back-buffer at maximum before cutting it off, in seconds. Raise this if you get inconsistent playback (Default: 0.3s)
## Examples
2023-02-08 18:41:36 +00:00
- `./aspew-in.py | ./aspew-out.py`
2023-02-08 18:35:08 +00:00
Listen to your default microphone at default settings.
2023-02-08 18:41:36 +00:00
- `./aspew-in.py format=paInt16 bitrate=48000 channels=2 | ./aspew-out.py format=paInt16 bitrate=48000 channels=2`
2023-02-08 18:35:08 +00:00
Listen to your default microphone at 16-bit, 48000Hz, stereo.