me.fier.aspew/README.md

48 lines
1.8 KiB
Markdown
Raw Permalink 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
2023-02-08 18:43:04 +00:00
### Python (3.4 or newer)
- Windows: [https://www.python.org/downloads/](https://www.python.org/downloads/)
- Debian: `apt install python3`
2023-02-08 18:41:36 +00:00
2023-02-08 18:43:04 +00:00
### PyAudio
- Windows: `py -m pip install PyAudio`
- Debian: `apt install python3-pyaudio`
2023-02-08 18:41:36 +00:00
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.
2023-02-09 11:50:44 +00:00
## Flags
Flags formatted as `-s` or `--long`.
### in & out:
- `-l`: List devices as JSON
- `-h`: Use human-readable format
2023-02-08 18:35:08 +00:00
## Arguments
2023-02-09 11:51:53 +00:00
Arguments are pairs of `key=value`.
2023-02-08 18:35:08 +00:00
2023-02-08 18:41:36 +00:00
### in & out:
2023-02-09 11:49:43 +00:00
- `device`: The device, a number (Default: `-1` aka. your default device)
2023-02-08 18:35:08 +00:00
- `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. Raise this if you get constant stutter (Default: `0.05`)
2023-02-08 18:35:08 +00:00
2023-02-08 18:41:36 +00:00
### out-only:
2023-02-08 18:44:31 +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.3`)
2023-02-08 18:35:08 +00:00
## 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-09 11:50:44 +00:00
Listen to your default microphone at 16-bit, 48000Hz, stereo.
2023-02-09 11:52:44 +00:00
- `./aspew-in.py -lh`
2023-02-09 11:50:44 +00:00
List your input devices.
2023-02-09 11:52:44 +00:00
- `./aspew-out.py -lh`
2023-02-09 11:50:44 +00:00
List your output devices.