Chris@40: Chris@40: Chris@40: Chris@40:
Chris@40:Chris@40: Libsndfile is a C library for reading and writing files containing sampled sound Chris@40: (such as MS Windows WAV and the Apple/SGI AIFF format) through one standard Chris@40: library interface. It is released in source code format under the Chris@40: Gnu Lesser General Public License. Chris@40:
Chris@40: Chris@40:Chris@40: The library was written to compile and run on a Linux system but should compile Chris@40: and run on just about any Unix (including MacOS X). Chris@40: There are also pre-compiled binaries available for 32 and 64 bit windows. Chris@40:
Chris@40:Chris@40: It was designed to handle both little-endian (such as WAV) and big-endian Chris@40: (such as AIFF) data, and to compile and run correctly on little-endian (such as Intel Chris@40: and DEC/Compaq Alpha) processor systems as well as big-endian processor systems such Chris@40: as Motorola 68k, Power PC, MIPS and Sparc. Chris@40: Hopefully the design of the library will also make it easy to extend for reading and Chris@40: writing new sound file formats. Chris@40:
Chris@40: Chris@40:Chris@40: It has been compiled and tested (at one time or another) on the following systems: Chris@40:
Chris@40: Chris@40:Chris@40: At the moment, each new release is being tested on i386 Linux, x86_64 Linux, Chris@40: PowerPC Linux, Win32 and Win64. Chris@40:
Chris@40: Chris@40: Chris@40: Chris@40: Chris@40:Chris@40: libsndfile has the following main features : Chris@40:
Chris@40:Chris@40: libsndfile has a comprehensive test suite so that each release is as bug free Chris@40: as possible. Chris@40: When new bugs are found, new tests are added to the test suite to ensure that Chris@40: these bugs don't creep back into the code. Chris@40: When new features are added, tests are added to the test suite to make sure that Chris@40: these features continue to work correctly even when they are old features. Chris@40:
Chris@40:Chris@40: The following table lists the file formats and encodings that libsndfile can read Chris@40: and write. Chris@40: The file formats are arranged across the top and encodings along the left Chris@40: edge. Chris@40:
Chris@40:Chris@40: | Micro- soft WAV |
Chris@40: SGI / Apple AIFF / AIFC |
Chris@40: Sun / DEC / NeXT AU / SND |
Chris@40: Header- less RAW |
Chris@40: Paris Audio File PAF |
Chris@40: Commo- dore Amiga IFF / SVX |
Chris@40: Sphere Nist WAV |
Chris@40: IRCAM SF |
Chris@40: Creative VOC |
Chris@40: Sound forge W64 |
Chris@40: GNU Octave 2.0 MAT4 |
Chris@40: GNU Octave 2.1 MAT5 |
Chris@40: Portable Voice Format PVF |
Chris@40: Fasttracker 2 XI |
Chris@40: HMM Tool Kit HTK |
Chris@40: Apple CAF |
Chris@40: Sound Designer II SD2 |
Chris@40: Free Lossless Audio Codec FLAC |
Chris@40:
Unsigned 8 bit PCM | Chris@40:R/W | R/W | R/W | Chris@40:R/W | Chris@40:R/W | R/W | Chris@40: | Chris@40: | ||||||||||
Signed 8 bit PCM | Chris@40:R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | Chris@40: | R/W | Chris@40:R/W | R/W | R/W | Chris@40:|||||||
Signed 16 bit PCM | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | Chris@40:R/W | R/W | Chris@40:|
Signed 24 bit PCM | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | Chris@40:R/W | Chris@40: | R/W | R/W | R/W | Chris@40:||||||
Signed 32 bit PCM | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | Chris@40: | R/W | R/W | R/W | R/W | Chris@40:R/W | Chris@40: | |||||
32 bit float | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | Chris@40: | R/W | R/W | R/W | Chris@40: | R/W | Chris@40: | ||||||
64 bit double | Chris@40:R/W | R/W | R/W | Chris@40:R/W | Chris@40: | R/W | R/W | R/W | Chris@40:R/W | Chris@40: | ||||||||
u-law encoding | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | Chris@40:R/W | Chris@40: | R/W | Chris@40: | |||||||
A-law encoding | Chris@40:R/W | R/W | R/W | R/W | Chris@40:R/W | R/W | R/W | Chris@40:R/W | Chris@40: | R/W | Chris@40: | |||||||
IMA ADPCM | Chris@40:R/W | Chris@40: | R/W | Chris@40:Chris@40: | Chris@40: | |||||||||||||
MS ADPCM | Chris@40:R/W | Chris@40: | R/W | Chris@40: | Chris@40: | |||||||||||||
GSM 6.10 | Chris@40:R/W | R/W | R/W | Chris@40: | R/W | Chris@40: | Chris@40: | |||||||||||
G721 ADPCM 32kbps | Chris@40:R/W | R/W | Chris@40: | Chris@40: | Chris@40: | |||||||||||||
G723 ADPCM 24kbps | Chris@40:R/W | Chris@40: | Chris@40: | Chris@40: | ||||||||||||||
G723 ADPCM 40kbps | Chris@40:R/W | Chris@40: | Chris@40: | Chris@40: | ||||||||||||||
12 bit DWVW | Chris@40:R/W | R/W | Chris@40: | Chris@40: | Chris@40: | |||||||||||||
16 bit DWVW | Chris@40:R/W | R/W | Chris@40: | Chris@40: | Chris@40: | |||||||||||||
24 bit DWVW | Chris@40:R/W | R/W | Chris@40: | Chris@40: | Chris@40: | |||||||||||||
Ok Dialogic ADPCM | Chris@40:R/W | Chris@40: | Chris@40: | Chris@40: | ||||||||||||||
8 bit DPCM | Chris@40:Chris@40: | Chris@40: | R/W | Chris@40: | ||||||||||||||
16 bit DPCM | Chris@40:Chris@40: | Chris@40: | R/W | Chris@40: |
Chris@40: From version 1.0.18, libsndfile also reads and writes Chris@40: FLAC Chris@40: and Chris@40: Ogg/Vorbis. Chris@40:
Chris@40: Chris@40: Chris@40: Chris@40:Chris@40: Some of the file formats I am also interested in adding are: Chris@40:
Chris@40:Chris@40: I have decided that I will not be adding support for MPEG Layer 3 (commonly Chris@40: known as MP3) due to the patent issues surrounding this file format. Chris@40: See Chris@40: Chris@40: the FAQ Chris@40: for more. Chris@40:
Chris@40:Chris@40: Other file formats may also be added on request. Chris@40:
Chris@40: Chris@40: Chris@40: Chris@40: Chris@40:Chris@40: My first attempt at reading and writing WAV files was in 1990 or so under Windows Chris@40: 3.1. Chris@40: I started using Linux in early 1995 and contributed some code to the Chris@40: wavplay Chris@40: program. Chris@40: That contributed code would eventually mutate into this library. Chris@40: As one of my interests is Digital Signal Processing (DSP) I decided that as well as Chris@40: reading data from an audio file in the native format (typically 16 bit short integers) Chris@40: it would also be useful to be able to have the library do the conversion to floating Chris@40: point numbers for DSP applications. Chris@40: It then dawned on me that whatever file format (anything from 8 bit unsigned chars, Chris@40: to 32 bit floating point numbers) the library should be able to convert the data to Chris@40: whatever format the library user wishes to use it in. Chris@40: For example, in a sound playback program, the library caller typically wants the sound Chris@40: data in 16 bit short integers to dump into a sound card even though the data in the Chris@40: file may be 32 bit floating point numbers (ie Microsoft's WAVE_FORMAT_IEEE_FLOAT Chris@40: format). Chris@40: Another example would be someone doing speech recognition research who has recorded Chris@40: some speech as a 16 bit WAV file but wants to process it as double precision floating Chris@40: point numbers. Chris@40:
Chris@40:Chris@40: Here is the release history for libsndfile : Chris@40:
Chris@40:Chris@40: libsndfile is released under the terms of the GNU Lesser General Public License, Chris@40: of which there are two versions; Chris@40: version 2.1 Chris@40: and Chris@40: version 3. Chris@40: To maximise the compatibility of libsndfile, the user may choose to use libsndfile Chris@40: under either of the above two licenses. Chris@40: You can also read a simple explanation of the ideas behind the GPL and the LGPL Chris@40: here. Chris@40:
Chris@40:Chris@40: You can use libsndfile with Chris@40: Free Software, Chris@40: Open Source, Chris@40: proprietary, shareware or other closed source applications as long as libsndfile Chris@40: is used as a dynamically loaded library and you abide by a small number of other Chris@40: conditions (read the LGPL for more info). Chris@40: With applications released under the GNU GPL you can also use libsndfile statically Chris@40: linked to your application. Chris@40:
Chris@40:Chris@40: I would like to see libsndfile used as widely as possible but I would prefer it Chris@40: if you released software that uses libsndfile as Chris@40: Free Software Chris@40: or Chris@40: Open Source. Chris@40: However, if you put in a great deal of effort building a significant application Chris@40: which simply uses libsndfile for file I/O, then I have no problem with you releasing Chris@40: that as closed source and charging as much money as you want for it as long as you Chris@40: abide by the license. Chris@40:
Chris@40: Chris@40: Chris@40:Chris@40: Here is the latest version. It is available in the following formats: Chris@40:
Chris@40:Chris@40: The Win32 installer should work on Windows Vista or later. Chris@40:
Chris@40: Chris@40:Chris@40: Pre-release versions of libsndfile are available Chris@40: here Chris@40: and are announced on the Chris@40: libsndfile-devel Chris@40: mailing list. Chris@40:
Chris@40: Chris@40: Chris@40:Chris@40: The latest version of this document can be found Chris@40: here. Chris@40:
Chris@40:Chris@40: Author : Chris@40: Chris@40: Erik de Castro Lopo Chris@40:
Chris@40: Chris@40:
Chris@40: This page has been accessed
Chris@40:
Chris@40: times.
Chris@40: