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