cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: libsndfile cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125:
cannam@125: libsndfile.jpg cannam@125:
cannam@125: cannam@125:
cannam@125: History -+- cannam@125: Features -+- cannam@125: Similar or Related Projects -+- cannam@125: News cannam@125:
cannam@125: Development -+- cannam@125: Programming Interface -+- cannam@125: Bug Reporting -+- cannam@125: Download cannam@125:
cannam@125: FAQ -+- cannam@125: Mailing Lists -+- cannam@125: Change Log -+- cannam@125: Licensing Information -+- cannam@125: See Also cannam@125:
cannam@125: cannam@125:

cannam@125:

cannam@125: Libsndfile is a C library for reading and writing files containing sampled sound cannam@125: (such as MS Windows WAV and the Apple/SGI AIFF format) through one standard cannam@125: library interface. It is released in source code format under the cannam@125: Gnu Lesser General Public License. cannam@125:

cannam@125: cannam@125:

cannam@125: The library was written to compile and run on a Linux system but should compile cannam@125: and run on just about any Unix (including MacOS X). cannam@125: There are also pre-compiled binaries available for 32 and 64 bit windows. cannam@125:

cannam@125:

cannam@125: It was designed to handle both little-endian (such as WAV) and big-endian cannam@125: (such as AIFF) data, and to compile and run correctly on little-endian (such as Intel cannam@125: and DEC/Compaq Alpha) processor systems as well as big-endian processor systems such cannam@125: as Motorola 68k, Power PC, MIPS and Sparc. cannam@125: Hopefully the design of the library will also make it easy to extend for reading and cannam@125: writing new sound file formats. cannam@125:

cannam@125: cannam@125:

cannam@125: It has been compiled and tested (at one time or another) on the following systems: cannam@125:

cannam@125: cannam@125: cannam@125: cannam@125:

cannam@125: At the moment, each new release is being tested on i386 Linux, x86_64 Linux, cannam@125: PowerPC Linux, Win32 and Win64. cannam@125:

cannam@125: cannam@125: cannam@125: cannam@125: cannam@125:

Features

cannam@125:

cannam@125: libsndfile has the following main features : cannam@125:

cannam@125: cannam@125:

cannam@125: libsndfile has a comprehensive test suite so that each release is as bug free cannam@125: as possible. cannam@125: When new bugs are found, new tests are added to the test suite to ensure that cannam@125: these bugs don't creep back into the code. cannam@125: When new features are added, tests are added to the test suite to make sure that cannam@125: these features continue to work correctly even when they are old features. cannam@125:

cannam@125:

cannam@125: The following table lists the file formats and encodings that libsndfile can read cannam@125: and write. cannam@125: The file formats are arranged across the top and encodings along the left cannam@125: edge. cannam@125:

cannam@125:
cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125: cannam@125:
 Micro- soft
WAV
SGI / Apple
AIFF / AIFC
Sun / DEC /
NeXT
AU / SND
Header- less
RAW
Paris Audio
File
PAF
Commo- dore
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
Unsigned 8 bit PCMR/WR/W R/W    R/WR/W R/W      
Signed 8 bit PCM R/WR/WR/WR/WR/WR/W     R/W  R/WR/WR/W
Signed 16 bit PCMR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/W R/WR/WR/WR/W
Signed 24 bit PCMR/WR/WR/WR/WR/W R/WR/W R/W     R/WR/WR/W
Signed 32 bit PCMR/WR/WR/WR/W  R/WR/W R/WR/WR/WR/W  R/W  
32 bit floatR/WR/WR/WR/W   R/W R/WR/WR/W   R/W  
64 bit doubleR/WR/WR/WR/W     R/WR/WR/W   R/W  
u-law encodingR/WR/WR/WR/W  R/WR/WR/WR/W     R/W  
A-law encodingR/WR/WR/WR/W  R/WR/WR/WR/W     R/W  
IMA ADPCMR/W        R/W        
MS ADPCMR/W        R/W        
GSM 6.10R/WR/W R/W     R/W        
G721 ADPCM 32kbpsR/W R/W               
G723 ADPCM 24kbps  R/W               
G723 ADPCM 40kbps  R/W               
12 bit DWVW R/W R/W              
16 bit DWVW R/W R/W              
24 bit DWVW R/W R/W              
Ok Dialogic ADPCM   R/W              
8 bit DPCM             R/W    
16 bit DPCM             R/W    
cannam@125: cannam@125:

cannam@125: From version 1.0.18, libsndfile also reads and writes cannam@125: FLAC cannam@125: and cannam@125: Ogg/Vorbis. cannam@125:

cannam@125: cannam@125: cannam@125: cannam@125:

cannam@125: Some of the file formats I am also interested in adding are: cannam@125:

cannam@125: cannam@125:

cannam@125: I have decided that I will not be adding support for MPEG Layer 3 (commonly cannam@125: known as MP3) due to the patent issues surrounding this file format. cannam@125: See cannam@125: cannam@125: the FAQ cannam@125: for more. cannam@125:

cannam@125:

cannam@125: Other file formats may also be added on request. cannam@125:

cannam@125: cannam@125: cannam@125: cannam@125: cannam@125:

History

cannam@125:

cannam@125: My first attempt at reading and writing WAV files was in 1990 or so under Windows cannam@125: 3.1. cannam@125: I started using Linux in early 1995 and contributed some code to the cannam@125: wavplay cannam@125: program. cannam@125: That contributed code would eventually mutate into this library. cannam@125: As one of my interests is Digital Signal Processing (DSP) I decided that as well as cannam@125: reading data from an audio file in the native format (typically 16 bit short integers) cannam@125: it would also be useful to be able to have the library do the conversion to floating cannam@125: point numbers for DSP applications. cannam@125: It then dawned on me that whatever file format (anything from 8 bit unsigned chars, cannam@125: to 32 bit floating point numbers) the library should be able to convert the data to cannam@125: whatever format the library user wishes to use it in. cannam@125: For example, in a sound playback program, the library caller typically wants the sound cannam@125: data in 16 bit short integers to dump into a sound card even though the data in the cannam@125: file may be 32 bit floating point numbers (ie Microsoft's WAVE_FORMAT_IEEE_FLOAT cannam@125: format). cannam@125: Another example would be someone doing speech recognition research who has recorded cannam@125: some speech as a 16 bit WAV file but wants to process it as double precision floating cannam@125: point numbers. cannam@125:

cannam@125:

cannam@125: Here is the release history for libsndfile : cannam@125:

cannam@125: cannam@125: cannam@125: cannam@125:

Similar or Related Projects

cannam@125: cannam@125: cannam@125: cannam@125: cannam@125:

Licensing

cannam@125:

cannam@125: libsndfile is released under the terms of the GNU Lesser General Public License, cannam@125: of which there are two versions; cannam@125: version 2.1 cannam@125: and cannam@125: version 3. cannam@125: To maximise the compatibility of libsndfile, the user may choose to use libsndfile cannam@125: under either of the above two licenses. cannam@125: You can also read a simple explanation of the ideas behind the GPL and the LGPL cannam@125: here. cannam@125:

cannam@125:

cannam@125: You can use libsndfile with cannam@125: Free Software, cannam@125: Open Source, cannam@125: proprietary, shareware or other closed source applications as long as libsndfile cannam@125: is used as a dynamically loaded library and you abide by a small number of other cannam@125: conditions (read the LGPL for more info). cannam@125: With applications released under the GNU GPL you can also use libsndfile statically cannam@125: linked to your application. cannam@125:

cannam@125:

cannam@125: I would like to see libsndfile used as widely as possible but I would prefer it cannam@125: if you released software that uses libsndfile as cannam@125: Free Software cannam@125: or cannam@125: Open Source. cannam@125: However, if you put in a great deal of effort building a significant application cannam@125: which simply uses libsndfile for file I/O, then I have no problem with you releasing cannam@125: that as closed source and charging as much money as you want for it as long as you cannam@125: abide by the license. cannam@125:

cannam@125: cannam@125: cannam@125:

Download

cannam@125:

cannam@125: Here is the latest version. It is available in the following formats: cannam@125:

cannam@125: cannam@125: cannam@125:

cannam@125: The Win32 installer should work on Windows Vista or later. cannam@125:

cannam@125: cannam@125:

cannam@125: Pre-release versions of libsndfile are available cannam@125: here cannam@125: and are announced on the cannam@125: libsndfile-devel cannam@125: mailing list. cannam@125:

cannam@125: cannam@125: cannam@125:

See Also

cannam@125: cannam@125: cannam@125:

cannam@125: cannam@125:
cannam@125: cannam@125:

cannam@125: The latest version of this document can be found cannam@125: here. cannam@125:

cannam@125:

cannam@125: Author : cannam@125: cannam@125: Erik de Castro Lopo cannam@125:

cannam@125: cannam@125:

cannam@125: This page has been accessed cannam@125: counter.gif cannam@125: times. cannam@125:

cannam@125: cannam@125: cannam@125: cannam@125: cannam@125:

cannam@125: cannam@125: