Installation

AudioIO does not provide own code but rather uses whatever audio modules are installed on your system. The python standard library support for reading and writing audio files and for playing sound is rather poor. You certainly want to install additional packages for better performance.

Run in your terminal

> audiomodules

to see which audio modules you have already installed on your system, which ones are recommended to install, and how to install them. By calling the script with the name of an audio module as an argument you get platform specific installation instructions for this module. E.g.

> audiomodules soundfile

Recommendations

For accessing a wide range of open source audio file formats install sndfile library and the python wrapper SoundFile.

MPEG and similar formats are supported by libav (https://libav.org) and ffmpeg (https://ffmpeg.org/) via audioread for reading and Pydub for writing.

For playing sounds, use the sounddevice package, that is based on portaudio. Unfortunately, the simple but powerful simpleaudio package is no longer maintained.

For details, call

audiomodules soundfile
audiomodules audioread
audiomodules pydub
audiomodules sounddevice

Here is how to install all these packages at once:

Debian-based Linux

sudo apt install libsndfile1 libsndfile1-dev libffi-dev
sudo pip install SoundFile
sudo apt install ffmpeg python3-audioread python3-pydub
sudo apt install libportaudio2 portaudio19-dev python3-cffi
sudo pip install sounddevice

Fedora-based Linux

dnf install libsndfile libsndfile-devel libffi-devel
pip install SoundFile
dnf install ffmpeg ffmpeg-devel python3-audioread python3-pydub
dnf install libportaudio portaudio-devel python3-cffi
pip install sounddevie

Windows

pip install SoundFile
pip install sounddevice