1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-24 23:13:42 +02:00

Upgrades libsndfile to 1.0.24.

This commit is contained in:
lllucius
2011-04-03 03:08:57 +00:00
parent dbf2cdf605
commit fa00dd005f
267 changed files with 13363 additions and 14998 deletions

View File

@@ -8,65 +8,69 @@
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
<META NAME="Description" CONTENT="The libsndfile FAQ.">
<META NAME="Keywords" CONTENT="WAV AIFF AU libsndfile sound audio dsp Linux">
<LINK REL=StyleSheet HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
<LINK REL="stylesheet" HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
<LINK REL="stylesheet" HREF="print.css" TYPE="text/css" MEDIA="print">
</HEAD>
<BODY>
<H1><B>libsndfile : Frequently Asked Questions.</B></H1>
<P>
<A HREF="#Q001">Q1 : Do you plan to support XYZ codec in libsndfile?</A><BR>
<A HREF="#Q001">Q1 : Do you plan to support XYZ codec in libsndfile?</A><BR/>
<A HREF="#Q002">Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field
but version 1 does not. Why?</A><BR>
<A HREF="#Q003">Q3 : Compiling is really slow on MacOSX. Why?</A><BR>
but version 1 does not. Why?</A><BR/>
<A HREF="#Q003">Q3 : Compiling is really slow on MacOS X. Why?</A><BR/>
<A HREF="#Q004">Q4 : When trying to compile libsndfile on Solaris I get a "bad
substitution" error during linking. What can I do to fix this?</A><BR>
<A HREF="#Q005">Q5 : Why doesn't libsndfile do interleaving/de-interleaving?</A><BR>
<A HREF="#Q006">Q6 : What's the best format for storing temporary files?</A><BR>
<A HREF="#Q007">Q7 : On Linux/Unix/MacOSX, what's the best way of detecting the
presence of libsndfile?</A><BR>
<A HREF="#Q008">Q8 : But I just want a simple Makefile! What do I do?</A><BR>
substitution" error during linking. What can I do to fix this?</A><BR/>
<A HREF="#Q005">Q5 : Why doesn't libsndfile do interleaving/de-interleaving?</A><BR/>
<A HREF="#Q006">Q6 : What's the best format for storing temporary files?</A><BR/>
<A HREF="#Q007">Q7 : On Linux/Unix/MacOS X, what's the best way of detecting the
presence of libsndfile?</A><BR/>
<A HREF="#Q008">Q8 : But I just want a simple Makefile! What do I do?</A><BR/>
<A HREF="#Q009">Q9 : How about adding the ability to write/read sound files to/from
memory buffers?</A><BR>
memory buffers?</A><BR/>
<A HREF="#Q010">Q10 : Reading a 16 bit PCM file as normalised floats and then
writing them back changes some sample values. Why?</A><BR>
writing them back changes some sample values. Why?</A><BR/>
<A HREF="#Q011">Q11 : I'm having problems with u-law encoded WAV files generated by
libsndfile in Winamp. Why?</A><BR>
<A HREF="#Q012">Q12 : I'm looking at sf_read*. What are items? What are frames?</A><BR>
libsndfile in Winamp. Why?</A><BR/>
<A HREF="#Q012">Q12 : I'm looking at sf_read*. What are items? What are frames?</A><BR/>
<A HREF="#Q013">Q13 : Why can't libsndfile open this Sound Designer II (SD2)
file?</A><BR>
file?</A><BR/>
<A HREF="#Q014">Q14 : I'd like to statically link libsndfile to my closed source
application. Can I buy a license so that this is possible?</A><BR>
application. Can I buy a license so that this is possible?</A><BR/>
<A HREF="#Q015">Q15 : My program is crashing during a call to a function in libsndfile.
Is this a bug in libsndfile?</A><BR>
Is this a bug in libsndfile?</A><BR/>
<A HREF="#Q016">Q16 : Will you accept a fix for compiling libsndfile with compiler X?
</A><BR>
</A><BR/>
<A HREF="#Q017">Q17 : Can libsndfile read/write files from/to UNIX pipes?
</A><BR>
<A HREF="#Q018">Q18 : Is it possible to build a Universal Binary on Mac OSX?
</A><BR>
</A><BR/>
<A HREF="#Q018">Q18 : Is it possible to build a Universal Binary on Mac OS X?
</A><BR/>
<A HREF="#Q019">Q19 : I have project files for Visual Studio / XCode / Whatever. Why
don't you distribute them with libsndfile?
</A><BR>
</A><BR/>
<A HREF="#Q020">Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source
projects support it!
</A><BR>
</A><BR/>
<A HREF="#Q021">Q21 : How do I use libsndfile in a closed source or commercial program
and comply with the license?
</A><BR>
</A><BR/>
<A HREF="#Q022">Q22 : What versions of windows does libsndfile work on?
</A><BR>
</A><BR/>
<A HREF="#Q023">Q23 : I'm cross compiling libsndfile for another platform. How can I
run the test suite?
</A><BR/>
<HR>
<!-- ========================================================================= -->
<A NAME="Q001"></A>
<H2><BR><B>Q1 : Do you plan to support XYZ codec in libsnfile?</B></H2>
<H2><BR/><B>Q1 : Do you plan to support XYZ codec in libsndfile?</B></H2>
<P>
If source code for XYZ codec is available under a suitable license (LGPL, BSD,
MIT etc) then yes, I'd like to add it.
</P>
<P>
If suitable documentation is available on how to decode and enocde the format
If suitable documentation is available on how to decode and encode the format
then maybe, depending on how much work is involved.
</P>
<P>
@@ -80,7 +84,7 @@ If you can't find either then the answer is no.
</P>
<!-- ========================================================================= -->
<A NAME="Q002"></A>
<H2><BR><B>Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field
<H2><BR/><B>Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field
but version 1 does not. Why?</B></H2>
<P>
This was dropped for a number of reasons:
@@ -92,49 +96,49 @@ If you can't find either then the answer is no.
<P>
As documented
<A HREF="http://www.mega-nerd.com/libsndfile/api.html#note1">here</A>
there is now a well defined behavior which ensures that no matter what the
there is now a well defined behaviour which ensures that no matter what the
bit width of the source file, the scaling always does something sensible.
This makes it safe to read 8, 16, 24 and 32 bit PCM files using sf_read_short()
and always have the optimal behavior.
and always have the optimal behaviour.
</P>
<!-- ========================================================================= -->
<A NAME="Q003"></A>
<H2><BR><B>Q3 : Compiling is really slow on MacOSX. Why?</B></H2>
<H2><BR/><B>Q3 : Compiling is really slow on MacOS X. Why?</B></H2>
<P>
When you configure and compile libsndfile, it uses the /bin/sh shell for a number
of tasks (ie configure script and libtool).
Older versions of OSX (10.2?) shipped a a really crappy Bourne shell as /bin/sh
Older versions of OS X (10.2?) shipped a really crappy Bourne shell as /bin/sh
which resulted in <b>really</b> slow compiles.
New version of OSX ship GNU BASh as /bin/sh and this answer doesn't apply in that
Newer version of OS X ship GNU Bash as /bin/sh and this answer doesn't apply in that
case.
</P>
<P>
To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to
/bin/sh.old and make a softlink from /bin/sh to the bash shell.
/bin/sh.old and make a symlink from /bin/sh to the bash shell.
Bash is designed to behave as a Bourne shell when is is called as /bin/sh.
</P>
<P>
When I did this on my iBook running MacOSX, compile times dropped from 13 minutes
When I did this on my iBook running MacOS X, compile times dropped from 13 minutes
to 3 minutes.
</P>
<!-- ========================================================================= -->
<A NAME="Q004"></A>
<H2><BR><B>Q4 : When trying to compile libsndfile on Solaris I get a "bad
<H2><BR/><B>Q4 : When trying to compile libsndfile on Solaris I get a "bad
substitution" error on linking. Why?</B></H2>
<P>
It seems that the Solaris Bourne shell disagrees with GNU libtool.
</P>
<P>
To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to
/bin/sh.old and make a softlink from /bin/sh to the bash shell.
/bin/sh.old and make a symlink from /bin/sh to the bash shell.
Bash is designed to behave as a Bourne shell when is is called as /bin/sh.
</P>
<!-- ========================================================================= -->
<A NAME="Q005"></A>
<H2><BR><B>Q5 : Why doesn't libsndfile do interleaving/de-interleaving?</B></H2>
<H2><BR/><B>Q5 : Why doesn't libsndfile do interleaving/de-interleaving?</B></H2>
<P>
This problem is bigger than it may seem at first.
</P>
@@ -143,7 +147,7 @@ For a stereo file, it is a pretty safe bet that a simple interleaving/de-interle
could satisfy most users.
However, for files with more than 2 channels this is unlikely to be the case.
If the user has a 4 channel file and want to play that file on a stereo output
sound card they either want the first two channels or they want some mixed combination
sound card they either want the first 2 channels or they want some mixed combination
of the 4 channels.
</P>
<P>
@@ -156,7 +160,7 @@ This means that this feature will not be added any time soon.
<!-- ========================================================================= -->
<A NAME="Q006"></A>
<H2><BR><B>Q6 : What's the best format for storing temporary files?</B></H2>
<H2><BR/><B>Q6 : What's the best format for storing temporary files?</B></H2>
<P>
When you want to store temporary data there are a number of requirements;
@@ -184,7 +188,7 @@ regardless of the host CPU.
<!-- ========================================================================= -->
<A NAME="Q007"></A>
<H2><BR><B>Q7 : On Linux/Unix/MaxOSX, what's the best way of detecting the presence
<H2><BR/><B>Q7 : On Linux/Unix/MaxOS X, what's the best way of detecting the presence
of libsndfile using autoconf?</B></H2>
<P>
@@ -242,7 +246,7 @@ libsndfile configure process. For instance on my system I get this:
<!-- ========================================================================= -->
<A NAME="Q008"></A>
<H2><BR><B>Q8 : But I just want a simple Makefile! What do I do?</B></H2>
<H2><BR/><B>Q8 : But I just want a simple Makefile! What do I do?</B></H2>
<P>
The <B>pkg-config</B> program makes finding the correct compiler flag values and
@@ -277,7 +281,7 @@ the command would be:
<!-- ========================================================================= -->
<A NAME="Q009"></A>
<H2><BR><B>Q9 : How about adding the ability to write/read sound files to/from
<H2><BR/><B>Q9 : How about adding the ability to write/read sound files to/from
memory buffers?</B></H2>
<P>
@@ -287,7 +291,7 @@ This has been added for version 1.0.13.
<!-- ========================================================================= -->
<A NAME="Q010"></A>
<H2><BR><B>Q10 : Reading a 16 bit PCM file as normalised floats and then
<H2><BR/><B>Q10 : Reading a 16 bit PCM file as normalised floats and then
writing them back changes some sample values. Why?</B></H2>
<P>
@@ -352,7 +356,7 @@ storage format (and which is also supported by most common file types).
<!-- ========================================================================= -->
<A NAME="Q011"></A>
<H2><BR><B>Q11 : I'm having problems with u-law encoded WAV files generated by
<H2><BR/><B>Q11 : I'm having problems with u-law encoded WAV files generated by
libsndfile in Winamp. Why?
</B></H2>
@@ -381,21 +385,47 @@ is the risk of breaking something that currently works.
<!-- ========================================================================= -->
<A NAME="Q012"></A>
<H2><BR><B>Q12 : I'm looking at sf_read*. What are items? What are frames?
<H2><BR/><B>Q12 : I'm looking at sf_read*. What are items? What are frames?
</B></H2>
<P>
For a sound file with only one channel, a frame is the same as a item.
An <tt>item</tt>tt> is a single sample of the data type you are reading; ie a
single <tt>short</tt> value for <tt>sf_read_short</tt> or a single <tt>float</tt>
for <tt>sf_read_float</tt>.
</P>
For a sound file with only one channel, a frame is the same as a item (ie a
single sample) while for multi channel sound files, a single frame contains a
single item for each channel.
</P>
<P>
For multi channel sound files, a single frame contains a single item for
each channel.
Here are two simple, correct examples, both of which are assumed to be working
on a stereo file, first using items:
</P>
<PRE>
#define CHANNELS 2
short data [CHANNELS * 100] ;
sf_count items_read = sf_read_short (file, data, 200) ;
assert (items_read == 200) ;
</PRE>
<P>
and now readng the exact same amount of data using frames:
</P>
<PRE>
#define CHANNELS 2
short data [CHANNELS * 100] ;
sf_count frames_read = sf_readf_short (file, data, 100) ;
assert (frames_read == 100) ;
</PRE>
<!-- ========================================================================= -->
<A NAME="Q013"></A>
<H2><BR><B>Q13 : Why can't libsndfile open this Sound Designer II (SD2) file?
<H2><BR/><B>Q13 : Why can't libsndfile open this Sound Designer II (SD2) file?
</B></H2>
<P>
@@ -407,7 +437,7 @@ First some background.
SD2 files are native to the Apple Macintosh platform and use features of
the Mac filesystem (file resource forks) to store the file's sample rate,
number of channels, sample width and more.
When you look at a file and its resource fork on Mac OSX it looks like
When you look at a file and its resource fork on Mac OS X it looks like
this:
</P>
@@ -419,7 +449,7 @@ this:
<P>
Notice how the file itself looks like a directory containing a single file
named <B>rsrc</B>.
When libsndfile is compiled for MacOSX, it should open (for write and read)
When libsndfile is compiled for MacOS X, it should open (for write and read)
SD2 file with resource forks like this without any problems.
It will also handle files with the resource fork in a separate file as
described below.
@@ -436,8 +466,8 @@ libsndfile to open the file.
<P>
However, it is possible to safely move an SD2 file to a Linux or Windows
machine.
For instance, when an SD2 file is copied from inside MacOSX to a windows
shared directory or a Samba share (ie Linux), MacOSX is clever enough to
For instance, when an SD2 file is copied from inside MacOS X to a windows
shared directory or a Samba share (ie Linux), MacOS X is clever enough to
store the resource fork of the file in a separate hidden file in the
same directory like this:
</P>
@@ -475,7 +505,7 @@ files are.
<!-- ========================================================================= -->
<A NAME="Q014"></A>
<H2><BR><B>Q14 : I'd like to statically link libsndfile to my closed source
<H2><BR/><B>Q14 : I'd like to statically link libsndfile to my closed source
application. Can I buy a license so that this is possible?
</B></H2>
@@ -494,7 +524,7 @@ library is if your application is released under the GNU GPL or LGPL.
<!-- ========================================================================= -->
<A NAME="Q015"></A>
<H2><BR><B>Q15 : My program is crashing during a call to a function in libsndfile.
<H2><BR/><B>Q15 : My program is crashing during a call to a function in libsndfile.
Is this a bug in libsndfile?
</B></H2>
@@ -527,7 +557,7 @@ following:
<!-- ========================================================================= -->
<A NAME="Q016"></A>
<H2><BR><B>Q16 : Will you accept a fix for compiling libsndfile with compiler X?
<H2><BR/><B>Q16 : Will you accept a fix for compiling libsndfile with compiler X?
</B></H2>
<P>
@@ -548,7 +578,7 @@ This can make compiling libsndfile with some older compilers difficult.
<!-- ========================================================================= -->
<A NAME="Q017"></A>
<H2><BR><B>Q17 : Can libsndfile read/write files from/to UNIX pipes?
<H2><BR/><B>Q17 : Can libsndfile read/write files from/to UNIX pipes?
</B></H2>
<P>
@@ -583,7 +613,7 @@ See also <A HREF="#Q006">FAQ Q6</A>.
<!-- ========================================================================= -->
<A NAME="Q018"></A>
<H2><BR><B>Q18 : Is it possible to build a Universal Binary on Mac OSX?
<H2><BR/><B>Q18 : Is it possible to build a Universal Binary on Mac OS X?
</B></H2>
<P>
@@ -644,7 +674,7 @@ libsndfile is currently working on.
<!-- ========================================================================= -->
<A NAME="Q019"></A>
<H2><BR><B>Q19 : I have project files for Visual Studio / XCode / Whatever. Why
<H2><BR/><B>Q19 : I have project files for Visual Studio / XCode / Whatever. Why
don't you distribute them with libsndfile?
</B></H2>
@@ -674,7 +704,7 @@ fixing or even testing it.
<P>
I currently release sources that I personally test on Win32, Linux and
MacOSX (PowerPC) using the compiler I trust (GNU GCC).
MacOS X (PowerPC) using the compiler I trust (GNU GCC).
Supporting one compiler on three (actually much more because GCC is available
almost everywhere) platforms is doable without too much pain.
I also release binaries for Win32 with instructions on how to use those
@@ -696,7 +726,7 @@ Hence, I'm not willing to enter into an arrangement like that again.
<!-- ========================================================================= -->
<A NAME="Q020"></A>
<H2><BR><B>Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source
<H2><BR/><B>Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source
projects support it!
</B></H2>
@@ -734,7 +764,7 @@ John ffitch of the Csound project) in version 1.0.18.
<!-- ========================================================================= -->
<A NAME="Q021"></A>
<H2><BR><B>Q21 : How do I use libsndfile in a closed source or commercial program
<H2><BR/><B>Q21 : How do I use libsndfile in a closed source or commercial program
and comply with the license?
</B></H2>
@@ -746,7 +776,7 @@ released under, the GNU Lesser General Public License (LGPL):
<ul>
<li>Make sure you are linking to libsndfile as a shared library (Linux and Unix
systems), Dynamic Link Library (Microsoft Windows) or dynlib (Mac OSX).
systems), Dynamic Link Library (Microsoft Windows) or dynlib (Mac OS X).
If you are using some other operating system that doesn't allow dynamically
linked libraries, you will not be able to use libsndfile unless you release
the source code to your program.
@@ -762,28 +792,57 @@ released under, the GNU Lesser General Public License (LGPL):
<!-- ========================================================================= -->
<A NAME="Q022"></A>
<H2><BR><B>Q22 : What versions of windows does libsndfile work on?
<H2><BR/><B>Q22 : What versions of Windows does libsndfile work on?
</B></H2>
<p>
Currently the precompiled windows binaries are tested in Windows XP.
Currently the precompiled windows binaries are thoroughly tested on Windows XP.
As such, they should also work on Win2k and Windows Vista.
They may also work on earlier versions of windows.
They may also work on earlier versions of Windows.
</p>
<p>
libsndfile does not yet work on 64 bit versions of windows.
Support for 64 bit versions of WinXP and Vista is likely to be working some
time late in 2008.
Since version 0.1.18 I have also been releasing precompiled binaries for Win64,
the 64 bit version of Windows.
These binaries have received much less testing than the 32 bit versions, but
should work as expected.
I'd be very interested in receiving feedback on these binaries.
</p>
<!-- ========================================================================= -->
<A NAME="Q023"></A>
<H2><BR/><B>Q23 : I'm cross compiling libsndfile for another platform. How can I
run the test suite?
</B></H2>
<p>
</p>
<p>
Since version 1.0.21 the top level Makefile has an extra make target,
'test-tarball'.
Building this target creates a tarball called called:
</p>
<center><tt>
libsndfile-testsuite-${host_triplet}-${version}.tar.gz
</tt></center>
<p>
in the top level directory.
This tarball can then be copied to the target platform.
Once untarred and test script <tt>test_wrapper.sh</tt> can be run from
the top level of the extracted tarball.
</p>
<!-- ========================================================================= -->
<HR>
<P>
The libsndfile home page is here :
<A HREF="http://www.mega-nerd.com/libsndfile/">
http://www.mega-nerd.com/libsndfile/</A>.
<BR>
Version : 1.0.18
<BR/>
Version : 1.0.24
</P>
</BODY>