Sndfile
Reads and writes sound files. Manages all the formats that libsndfile supports. Which is at the moment:
- Microsoft WAV
- SGI / Apple AIFF/AIFC
- Sun/DEC/NeXT AU/SND
- Headerless RAW
- Paris Audio File PAF
- Commodore Amiga IFF/SVX
- Sphere Nist WAV
- IRCAM SF
- Creative VOC
- Sound forge W64
- GNU Octave 2.0 MAT4
- GNU Octave 2.1 MAT5
- Portable Voice Format PVF
- Fasttracker 2 XI
- HMM Tool Kit HTK
- Apple CAF
- Sound Designer II SD2
- Free Lossless Audio Codec FLAC
- MP3
Install
- Mac OSX:
brew install libsndfile
- Ubuntu/Raspbian:
sudo apt-get install libsndfile
Usage
Playing sound
i_sndfile -f toto.mp3 | o_sound.sh
play the sound of the mp3 on the default speaker.
Recording sound
i_sound.sh | o_sndfile -f toto.mp3
records the sound from the default microphone in a mp3 file.