mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-10 16:43:33 +02:00
Update libsndfile to 1.0.29pre2+git
This pulls in MANY (over 890) changes compared to our from our current 1.0.24 version.
This commit is contained in:
@@ -26,7 +26,8 @@
|
||||
<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="#Q008">Q8 : I have libsndfile installed and now I want to use it. 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/>
|
||||
<A HREF="#Q010">Q10 : Reading a 16 bit PCM file as normalised floats and then
|
||||
@@ -49,8 +50,7 @@
|
||||
<A HREF="#Q019">Q19 : I have project files for Visual Studio / XCode / Whatever. Why
|
||||
don't you distribute them with libsndfile?
|
||||
</A><BR/>
|
||||
<A HREF="#Q020">Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source
|
||||
projects support it!
|
||||
<A HREF="#Q020">Q20 : Why doesn't libsndfile support MP3?
|
||||
</A><BR/>
|
||||
<A HREF="#Q021">Q21 : How do I use libsndfile in a closed source or commercial program
|
||||
and comply with the license?
|
||||
@@ -95,7 +95,7 @@ If you can't find either then the answer is no.
|
||||
</UL>
|
||||
<P>
|
||||
As documented
|
||||
<A HREF="http://www.mega-nerd.com/libsndfile/api.html#note1">here</A>
|
||||
<A HREF="api.html#note1">here</A>
|
||||
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()
|
||||
@@ -116,7 +116,7 @@ case.
|
||||
<P>
|
||||
To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to
|
||||
/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.
|
||||
Bash is designed to behave as a Bourne shell when it is called as /bin/sh.
|
||||
</P>
|
||||
<P>
|
||||
When I did this on my iBook running MacOS X, compile times dropped from 13 minutes
|
||||
@@ -133,7 +133,7 @@ It seems that the Solaris Bourne shell disagrees with GNU libtool.
|
||||
<P>
|
||||
To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to
|
||||
/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.
|
||||
Bash is designed to behave as a Bourne shell when it is called as /bin/sh.
|
||||
</P>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
@@ -246,7 +246,8 @@ 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 : I have libsndfile installed and now I want to use it. 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
|
||||
@@ -339,7 +340,7 @@ other than normalized floats in the application.
|
||||
Alternatives to normalized floats are the <b>short</b> and <b>int</b> data
|
||||
types (ie using sf_read_short or sf_read_int) or using un-normalized floats
|
||||
(see
|
||||
<a href="http://www.mega-nerd.com/libsndfile/command.html#SFC_SET_NORM_FLOAT">
|
||||
<a href="command.html#SFC_SET_NORM_FLOAT">
|
||||
SFC_SET_NORM_FLOAT</a>).
|
||||
</P>
|
||||
<P>
|
||||
@@ -389,11 +390,12 @@ is the risk of breaking something that currently works.
|
||||
</B></H2>
|
||||
|
||||
<P>
|
||||
An <tt>item</tt>tt> is a single sample of the data type you are reading; ie a
|
||||
An <tt>item</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>
|
||||
|
||||
<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.
|
||||
@@ -412,7 +414,7 @@ on a stereo file, first using items:
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
and now readng the exact same amount of data using frames:
|
||||
and now reading the exact same amount of data using frames:
|
||||
</P>
|
||||
|
||||
<PRE>
|
||||
@@ -640,7 +642,7 @@ CPU and run them on the other, the test suite will fail.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Part of the problem is the the CPU endian-ness is detected at configure time.
|
||||
Part of the problem is that the CPU endian-ness is detected at configure time.
|
||||
Yes, I know the Apple compiler defines one of the macros __LITTLE_ENDIAN__
|
||||
and __BIG_ENDIAN__, but those macros are not part of the 1999 ISO C Standard
|
||||
and they are not portable.
|
||||
@@ -726,42 +728,18 @@ 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
|
||||
projects support it!
|
||||
<H2><BR/><B>Q20 : Why doesn't libsndfile support MP3?
|
||||
</B></H2>
|
||||
|
||||
<P>
|
||||
MP3 is not supported for one very good reason; doing so requires the payment
|
||||
of licensing fees.
|
||||
As can be seen from
|
||||
<a href="http://www.mp3licensing.com/royalty/software.html">
|
||||
mp3licensing.com</a>
|
||||
the required royalty payments are not cheap.
|
||||
In the past, MP3 was not supported because the technology behind MP3 was
|
||||
patented.
|
||||
Those patents have now expired and there is an
|
||||
<a href="https://github.com/erikd/libsndfile/issues/258">
|
||||
open ticket</a>
|
||||
to implement MP3 support.
|
||||
</P>
|
||||
|
||||
<p>
|
||||
Yes, I know other libraries ignore the licensing requirements, but their legal
|
||||
status is extremely dubious.
|
||||
At any time, the body selling the licenses could go after the authors of those
|
||||
libraries.
|
||||
Some of those authors may be students and hence wouldn't be worth pursuing.
|
||||
</P>
|
||||
|
||||
<p>
|
||||
However, libsndfile is released under the name of a company, Mega Nerd Pty Ltd;
|
||||
a company which has income from from libsamplerate licensing, libsndfile based
|
||||
consulting income and other unrelated consulting income.
|
||||
Adding MP3 support to libsndfile could place that income would be under legal
|
||||
threat.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Fortunately, Ogg Vorbis exists as an alternative to MP3.
|
||||
Support for Ogg Vorbis was added to libsndfile (mostly due to the efforts of
|
||||
John ffitch of the Csound project) in version 1.0.18.
|
||||
</p>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q021"></A>
|
||||
<H2><BR/><B>Q21 : How do I use libsndfile in a closed source or commercial program
|
||||
@@ -842,7 +820,7 @@ the top level of the extracted tarball.
|
||||
<A HREF="http://www.mega-nerd.com/libsndfile/">
|
||||
http://www.mega-nerd.com/libsndfile/</A>.
|
||||
<BR/>
|
||||
Version : 1.0.24
|
||||
Version : 1.0.28
|
||||
</P>
|
||||
|
||||
</BODY>
|
||||
|
@@ -1,10 +0,0 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
htmldir = $(htmldocdir)
|
||||
html_DATA = index.html libsndfile.jpg libsndfile.css api.html command.html \
|
||||
bugs.html sndfile_info.html new_file_type.HOWTO pkgconfig.html \
|
||||
win32.html FAQ.html lists.html embedded_files.html octave.html \
|
||||
dither.html tutorial.html
|
||||
|
||||
EXTRA_DIST = $(html_DATA)
|
||||
|
@@ -1,551 +0,0 @@
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = doc
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/libsndfile.css.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/add_cflags.m4 \
|
||||
$(top_srcdir)/M4/add_cxxflags.m4 $(top_srcdir)/M4/clip_mode.m4 \
|
||||
$(top_srcdir)/M4/endian.m4 $(top_srcdir)/M4/extra_largefile.m4 \
|
||||
$(top_srcdir)/M4/extra_pkg.m4 \
|
||||
$(top_srcdir)/M4/flexible_array.m4 \
|
||||
$(top_srcdir)/M4/gcc_version.m4 $(top_srcdir)/M4/libtool.m4 \
|
||||
$(top_srcdir)/M4/lrint.m4 $(top_srcdir)/M4/lrintf.m4 \
|
||||
$(top_srcdir)/M4/ltoptions.m4 $(top_srcdir)/M4/ltsugar.m4 \
|
||||
$(top_srcdir)/M4/ltversion.m4 $(top_srcdir)/M4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/M4/mkoctfile_version.m4 \
|
||||
$(top_srcdir)/M4/octave.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES = libsndfile.css
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(htmldir)"
|
||||
DATA = $(html_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALSA_LIBS = @ALSA_LIBS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CLEAN_VERSION = @CLEAN_VERSION@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTERNAL_CFLAGS = @EXTERNAL_CFLAGS@
|
||||
EXTERNAL_LIBS = @EXTERNAL_LIBS@
|
||||
FGREP = @FGREP@
|
||||
FLAC_CFLAGS = @FLAC_CFLAGS@
|
||||
FLAC_LIBS = @FLAC_LIBS@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GCC_MINOR_VERSION = @GCC_MINOR_VERSION@
|
||||
GCC_VERSION = @GCC_VERSION@
|
||||
GETCONF = @GETCONF@
|
||||
GREP = @GREP@
|
||||
HAVE_AUTOGEN = @HAVE_AUTOGEN@
|
||||
HAVE_MKOCTFILE = @HAVE_MKOCTFILE@
|
||||
HAVE_OCTAVE = @HAVE_OCTAVE@
|
||||
HAVE_OCTAVE_CONFIG = @HAVE_OCTAVE_CONFIG@
|
||||
HAVE_WINE = @HAVE_WINE@
|
||||
HOST_TRIPLET = @HOST_TRIPLET@
|
||||
HTML_BGCOLOUR = @HTML_BGCOLOUR@
|
||||
HTML_FGCOLOUR = @HTML_FGCOLOUR@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MKOCTFILE = @MKOCTFILE@
|
||||
MKOCTFILE_VERSION = @MKOCTFILE_VERSION@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OCTAVE = @OCTAVE@
|
||||
OCTAVE_CONFIG = @OCTAVE_CONFIG@
|
||||
OCTAVE_CONFIG_VERSION = @OCTAVE_CONFIG_VERSION@
|
||||
OCTAVE_DEST_MDIR = @OCTAVE_DEST_MDIR@
|
||||
OCTAVE_DEST_ODIR = @OCTAVE_DEST_ODIR@
|
||||
OCTAVE_VERSION = @OCTAVE_VERSION@
|
||||
OGG_CFLAGS = @OGG_CFLAGS@
|
||||
OGG_LIBS = @OGG_LIBS@
|
||||
OS_SPECIFIC_CFLAGS = @OS_SPECIFIC_CFLAGS@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SF_COUNT_MAX = @SF_COUNT_MAX@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SIZEOF_SF_COUNT_T = @SIZEOF_SF_COUNT_T@
|
||||
SNDIO_LIBS = @SNDIO_LIBS@
|
||||
SQLITE3_CFLAGS = @SQLITE3_CFLAGS@
|
||||
SQLITE3_LIBS = @SQLITE3_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TYPEOF_SF_COUNT_T = @TYPEOF_SF_COUNT_T@
|
||||
VERSION = @VERSION@
|
||||
VORBISENC_CFLAGS = @VORBISENC_CFLAGS@
|
||||
VORBISENC_LIBS = @VORBISENC_LIBS@
|
||||
VORBIS_CFLAGS = @VORBIS_CFLAGS@
|
||||
VORBIS_LIBS = @VORBIS_LIBS@
|
||||
WIN_RC_VERSION = @WIN_RC_VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = $(htmldocdir)
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
html_DATA = index.html libsndfile.jpg libsndfile.css api.html command.html \
|
||||
bugs.html sndfile_info.html new_file_type.HOWTO pkgconfig.html \
|
||||
win32.html FAQ.html lists.html embedded_files.html octave.html \
|
||||
dither.html tutorial.html
|
||||
|
||||
EXTRA_DIST = $(html_DATA)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu doc/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
libsndfile.css: $(top_builddir)/config.status $(srcdir)/libsndfile.css.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-htmlDATA: $(html_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-htmlDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(DATA)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(htmldir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-htmlDATA
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-htmlDATA
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-htmlDATA install-info install-info-am \
|
||||
install-man install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags-am uninstall uninstall-am uninstall-htmlDATA
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
@@ -34,7 +34,7 @@
|
||||
Every effort is made to keep these documents up-to-date, error free and
|
||||
unambiguous.
|
||||
However, since maintaining the documentation is the least fun part of working
|
||||
on libsndfile, these docs can and do fall behind the behaviour of library.
|
||||
on libsndfile, these docs can and do fall behind the behaviour of the library.
|
||||
If any errors, omissions or ambiguities are found, please notify me (erikd)
|
||||
at mega-nerd dot com.
|
||||
</P>
|
||||
@@ -63,6 +63,7 @@ The functions of libsndfile are defined as follows:
|
||||
#include <sndfile.h>
|
||||
|
||||
SNDFILE* <A HREF="#open">sf_open</A> (const char *path, int mode, SF_INFO *sfinfo) ;
|
||||
SNDFILE* <A HREF="#open">sf_wchar_open</A> (LPCWSTR wpath, int mode, SF_INFO *sfinfo) ;
|
||||
SNDFILE* <A HREF="#open_fd">sf_open_fd</A> (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
|
||||
SNDFILE* <A HREF="#open_virtual">sf_open_virtual</A> (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
|
||||
int <A HREF="#check">sf_format_check</A> (const SF_INFO *info) ;
|
||||
@@ -121,6 +122,18 @@ SNDFILE* is an anonymous pointer to data which is private to the library.
|
||||
SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The sf_open() function opens the sound file at the specified path.
|
||||
The filename is byte encoded, but may be utf-8 on Linux, while on Mac OS X it
|
||||
will use the filesystem character set.
|
||||
On Windows, there is also a Windows specific sf_wchar_open() that takes a
|
||||
UTF16_BE encoded filename.
|
||||
</P>
|
||||
|
||||
<PRE>
|
||||
SNDFILE* sf_wchar_open (LPCWSTR wpath, int mode, SF_INFO *sfinfo) ;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The SF_INFO structure is for passing data between the calling function and the library
|
||||
when opening a file for reading or writing. It is defined in sndfile.h as follows:
|
||||
@@ -524,7 +537,7 @@ SFM_READ no action is taken.
|
||||
|
||||
|
||||
<A NAME="read"></A>
|
||||
<H2><BR><B>File Read Functions (Items)</B></H2>
|
||||
<H2><BR><B>File Read Functions</B></H2>
|
||||
|
||||
<PRE>
|
||||
sf_count_t sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
|
||||
@@ -533,32 +546,7 @@ SFM_READ no action is taken.
|
||||
sf_count_t sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The file read items functions fill the array pointed to by ptr with the requested
|
||||
number of items. The items parameter must be an integer product of the number
|
||||
of channels or an error will occur.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
It is important to note that the data type used by the calling program and the data
|
||||
format of the file do not need to be the same. For instance, it is possible to open
|
||||
a 16 bit PCM encoded WAV file and read the data using sf_read_float(). The library
|
||||
seamlessly converts between the two formats on-the-fly. See
|
||||
<A HREF="#note1">Note 1</A>.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
The sf_read_XXXX functions return the number of items read.
|
||||
Unless the end of the file was reached during the read, the return value should
|
||||
equal the number of items requested.
|
||||
Attempts to read beyond the end of the file will not result in an error but will
|
||||
cause the sf_read_XXXX functions to return less than the number of items requested
|
||||
or 0 if already at the end of the file.
|
||||
</P>
|
||||
|
||||
<A NAME="readf"></A>
|
||||
<H2><BR><B>File Read Functions (Frames)</B></H2>
|
||||
|
||||
<PRE>
|
||||
sf_count_t sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
|
||||
sf_count_t sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
|
||||
@@ -567,27 +555,55 @@ or 0 if already at the end of the file.
|
||||
</PRE>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
The file read frames functions fill the array pointed to by ptr with the requested
|
||||
number of frames of data. The array must be large enough to hold the product of
|
||||
frames and the number of channels.
|
||||
The file read functions fill the array pointed to by ptr with the
|
||||
requested number of items or frames.
|
||||
</P>
|
||||
|
||||
<P><B>
|
||||
Care must be taken to ensure that there is enough space in the array pointed to by
|
||||
ptr, to take (frames * channels) number of items (shorts, ints, floats or doubles).
|
||||
<P>
|
||||
For the frames-count functions, the frames parameter specifies the number
|
||||
of frames. A frame is just a block of samples, one for each
|
||||
channel. <B>Care must be taken to ensure that there is enough space
|
||||
in the array pointed to by ptr, to take (frames * channels) number of
|
||||
items (shorts, ints, floats or doubles).
|
||||
</B></P>
|
||||
|
||||
<P>
|
||||
The sf_readf_XXXX functions return the number of frames read.
|
||||
Unless the end of the file was reached during the read, the return value should equal
|
||||
the number of frames requested.
|
||||
Attempts to read beyond the end of the file will not result in an error but will cause
|
||||
the sf_readf_XXXX functions to return less than the number of frames requested or 0 if
|
||||
already at the end of the file.
|
||||
For the items-count functions, the items parameter must be an integer product
|
||||
of the number of channels or an error will occur. Here, an item is just a
|
||||
sample.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Note: The only difference between the "items" and "frames" versions of
|
||||
each read function is the units in which the object count is specified
|
||||
- calling sf_readf_short with a count argument of N, on a SNDFILE with
|
||||
C channels, is the same as calling sf_read_short with a count argument
|
||||
of N*C. The buffer pointed to by "ptr" should be the same number of
|
||||
bytes in each case.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
Note: The data type used by the calling program and the data format of
|
||||
the file do not need to be the same. For instance, it is possible to
|
||||
open a 16 bit PCM encoded WAV file and read the data using
|
||||
sf_read_float(). The library seamlessly converts between the two
|
||||
formats on-the-fly. See
|
||||
<A HREF="#note1">Note 1</A>.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
The sf_read_XXXX and sf_readf_XXXX functions return the number of
|
||||
items or frames read, respectively. Unless the end of the file was
|
||||
reached during the read, the return value should equal the number of
|
||||
objects requested. Attempts to read beyond the end of the file will
|
||||
not result in an error but will cause the read functions to return
|
||||
less than the number of objects requested or 0 if already at the end
|
||||
of the file.
|
||||
</P>
|
||||
|
||||
<A NAME="write"></A>
|
||||
<H2><BR><B>File Write Functions (Items)</B></H2>
|
||||
<H2><BR><B>File Write Functions</B></H2>
|
||||
|
||||
<PRE>
|
||||
sf_count_t sf_write_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
|
||||
@@ -596,27 +612,7 @@ already at the end of the file.
|
||||
sf_count_t sf_write_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The file write items functions write the data in the array pointed to by ptr to the file.
|
||||
The items parameter must be an integer product of the number of channels or an error
|
||||
will occur.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
It is important to note that the data type used by the calling program and the data
|
||||
format of the file do not need to be the same. For instance, it is possible to open
|
||||
a 16 bit PCM encoded WAV file and write the data using sf_write_float(). The library
|
||||
seamlessly converts between the two formats on-the-fly. See
|
||||
<A HREF="#note1">Note 1</A>.
|
||||
</P>
|
||||
<P>
|
||||
The sf_write_XXXX functions return the number of items written (which should be the
|
||||
same as the items parameter).
|
||||
</P>
|
||||
|
||||
<A NAME="writef"></A>
|
||||
<H2><BR><B>File Write Functions (Frames)</B></H2>
|
||||
|
||||
<PRE>
|
||||
sf_count_t sf_writef_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
|
||||
sf_count_t sf_writef_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
|
||||
@@ -625,14 +621,35 @@ same as the items parameter).
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The file write frames functions write the data in the array pointed to by ptr to the file.
|
||||
The array must be large enough to hold the product of frames and the number of channels.
|
||||
The file write functions write the data in the array pointed to by ptr to the file.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The sf_writef_XXXX functions return the number of frames written (which should be the
|
||||
same as the frames parameter).
|
||||
For items-count functions, the items parameter specifies the size of
|
||||
the array and must be an integer product of the number of channels or
|
||||
an error will occur.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
For the frames-count functions, the array is expected to be large enough
|
||||
to hold a number of items equal to the product of frames and the
|
||||
number of channels.
|
||||
</P>
|
||||
|
||||
<P>As with the read functions <A HREF="#read">above</A>, the only
|
||||
difference in the items and frames version of each write function is
|
||||
the units in which the buffer size is specified. Again, the data type
|
||||
used by the calling program and the data format of the file do not
|
||||
need to be the same (<A HREF="#note1">Note 1</A>).
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The sf_write_XXXX and sf_writef_XXXX functions respectively return the
|
||||
number of items or frames written (which should be the same as the
|
||||
items or frames parameter).
|
||||
</P>
|
||||
|
||||
|
||||
<A NAME="raw"></A>
|
||||
<H2><BR><B>Raw File Read and Write Functions</B></H2>
|
||||
<!-- pepper -->
|
||||
@@ -692,7 +709,11 @@ The <B>str_type</B> parameter can be any one of the following string types:
|
||||
SF_STR_SOFTWARE,
|
||||
SF_STR_ARTIST,
|
||||
SF_STR_COMMENT,
|
||||
SF_STR_DATE
|
||||
SF_STR_DATE,
|
||||
SF_STR_ALBUM,
|
||||
SF_STR_LICENSE,
|
||||
SF_STR_TRACKNUMBER,
|
||||
SF_STR_GENRE
|
||||
} ;
|
||||
</PRE>
|
||||
|
||||
@@ -710,9 +731,20 @@ It returns zero on success and non-zero on error.
|
||||
The error code can be converted to a string using sf_error_number().
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Strings passed to and retrieved from these two functions are assumed to be
|
||||
utf-8.
|
||||
However, while formats like Ogg/Vorbis and FLAC fully support utf-8, others
|
||||
like WAV and AIFF officially only support ASCII.
|
||||
Writing utf-8 strings to WAV and AIF files with libsndfile will work when read
|
||||
back with libsndfile, but may not work with other programs.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
|
||||
The suggested method of dealing with tags retrived using sf_get_string() is to
|
||||
assume they are utf-8.
|
||||
Similarly if you have a string in some exotic format like utf-16, it should be
|
||||
encoded to utf-8 before being written using libsndfile.
|
||||
</P>
|
||||
|
||||
<HR>
|
||||
@@ -721,8 +753,9 @@ The error code can be converted to a string using sf_error_number().
|
||||
<H2><BR><B>Note 1</B></H2>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
When converting between integer PCM formats of differing size (ie using sf_read_int()
|
||||
to read a 16 bit PCM encoded WAV file) libsndfile obeys one simple rule:
|
||||
When converting between integer PCM formats of differing size
|
||||
(e.g. using sf_read_int() to read a 16 bit PCM encoded WAV file)
|
||||
libsndfile obeys one simple rule:
|
||||
</P>
|
||||
|
||||
<P CLASS=indent_block>
|
||||
@@ -766,7 +799,7 @@ and a parameter of SF_TRUE to force correct scaling.
|
||||
<A HREF="http://www.mega-nerd.com/libsndfile/">here</A>.
|
||||
</P>
|
||||
<P>
|
||||
Version : 1.0.24
|
||||
Version : 1.0.28
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<!-- pepper -->
|
||||
|
@@ -68,9 +68,8 @@
|
||||
problems.
|
||||
</P>
|
||||
<P>
|
||||
Once you have the above information you should email it to one of the
|
||||
<A HREF="lists.html">mailing lists</a>
|
||||
(posting to these lists is limited to the list subscribers).
|
||||
Once you have the above information you should submit a ticket on the libsnfile
|
||||
<A HREF="https://github.com/erikd/libsndfile/issues">github issue tracker</A>.
|
||||
|
||||
</P>
|
||||
</BODY>
|
||||
|
@@ -49,6 +49,10 @@
|
||||
<TD><A HREF="#SFC_GET_LOG_INFO">SFC_GET_LOG_INFO</A></TD>
|
||||
<TD>Retrieve the internal per-file operation log.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_CURRENT_SF_INFO">SFC_GET_CURRENT_SF_INFO</A></TD>
|
||||
<TD>Retrieve <CODE>SF_INFO</CODE> struct of opened file.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_CALC_SIGNAL_MAX">SFC_CALC_SIGNAL_MAX</A></TD>
|
||||
<TD>Calculate the measured maximum signal value.</TD>
|
||||
@@ -177,22 +181,27 @@
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_WAVEX_GET_AMBISONIC">SFC_GET_AMBISONIC</A></TD>
|
||||
<TD><A HREF="#SFC_WAVEX_GET_AMBISONIC">SFC_WAVEX_GET_AMBISONIC</A></TD>
|
||||
<TD>Test a WAVEX file for Ambisonic format</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_WAVEX_SET_AMBISONIC">SFC_SET_AMBISONIC</A></TD>
|
||||
<TD><A HREF="#SFC_WAVEX_SET_AMBISONIC">SFC_WAVEX_SET_AMBISONIC</A></TD>
|
||||
<TD>Modify a WAVEX header for Ambisonic format</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_SET_VBR_ENCODING_QUALITY">SFC_SET_VBR_ENCODING_QUALITY</A></TD>
|
||||
<TD>Set the the Variable Bit Rate encoding quality</TD>
|
||||
<TD>Set the Variable Bit Rate encoding quality</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_RAW_NEEDS_ENDSWAP">SFC_RAW_NEEDS_ENDSWAP</a></td>
|
||||
<TD><A HREF="#SFC_SET_COMPRESSION_LEVEL">SFC_SET_COMPRESSION_LEVEL</A></TD>
|
||||
<TD>Set the compression level.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_RAW_DATA_NEEDS_ENDSWAP">SFC_RAW_DATA_NEEDS_ENDSWAP</a></td>
|
||||
<TD>Determine if raw data needs endswapping</TD>
|
||||
</TR>
|
||||
|
||||
@@ -206,6 +215,68 @@
|
||||
<TD>Set the Broadcast Chunk info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_CHANNEL_MAP_INFO">SFC_GET_CHANNEL_MAP_INFO</A></TD>
|
||||
<TD>Retrieve the channel map info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_SET_CHANNEL_MAP_INFO">SFC_SET_CHANNEL_MAP_INFO</A></TD>
|
||||
<TD>Set the channel map info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_SET_CART_INFO">SFC_SET_CART_INFO</A></TD>
|
||||
<TD>Set the Cart Chunk info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_CART_INFO">SFC_GET_CART_INFO</A></TD>
|
||||
<TD>Retrieve the Cart Chunk info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_LOOP_INFO">SFC_GET_LOOP_INFO</A></TD>
|
||||
<TD>Get loop info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_INSTRUMENT">SFC_GET_INSTRUMENT</A></TD>
|
||||
<TD>Get instrument info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_SET_INSTRUMENT">SFC_SET_INSTRUMENT</A></TD>
|
||||
<TD>Set instrument info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_CUE_COUNT">SFC_GET_CUE_COUNT</A></TD>
|
||||
<TD>Get the cue marker count</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_CUE">SFC_GET_CUE</A></TD>
|
||||
<TD>Get cue marker info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_SET_CUE">SFC_SET_CUE</A></TD>
|
||||
<TD>Set cue marker info</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_RF64_AUTO_DOWNGRADE">SFC_RF64_AUTO_DOWNGRADE</A></TD>
|
||||
<TD>Enable auto downgrade from RF64 to WAV</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_GET_ORIGINAL_SAMPLERATE">SFC_GET_ORIGINAL_SAMPLERATE</A></TD>
|
||||
<TD>Get original samplerate</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><A HREF="#SFC_SET_ORIGINAL_SAMPLERATE">SFC_SET_ORIGINAL_SAMPLERATE</A></TD>
|
||||
<TD>Set original samplerate</TD>
|
||||
</TR>
|
||||
<!--
|
||||
<TR>
|
||||
<TD><A HREF="#add-dither">add dither</A></TD>
|
||||
@@ -231,7 +302,7 @@ Parameters:
|
||||
sndfile : Not used
|
||||
cmd : SFC_GET_LIB_VERSION
|
||||
data : A pointer to a char buffer
|
||||
datasize : The size of the the buffer
|
||||
datasize : The size of the buffer
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
@@ -266,7 +337,7 @@ Parameters:
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_LOG_INFO
|
||||
data : A pointer to a char buffer
|
||||
datasize : The size of the the buffer
|
||||
datasize : The size of the buffer
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
@@ -287,6 +358,38 @@ The string returned in the buffer passed to this function will not overflow
|
||||
the buffer and will always be null terminated .
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_GET_CURRENT_SF_INFO"></A>
|
||||
<H2><BR><B>SFC_GET_CURRENT_SF_INFO</B></H2>
|
||||
<P>
|
||||
Retrieve <CODE>SF_INFO</CODE> struct of opened file.
|
||||
</P>
|
||||
<P>
|
||||
<CODE>SFC_GET_CURRENT_SF_INFO</CODE> command copies <CODE>SF_INFO</CODE> struct of
|
||||
<CODE>sndfile</CODE> object to provided buffer.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Parameters:
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_CURRENT_SF_INFO
|
||||
data : A pointer to a valid SF_INFO* pointer
|
||||
datasize : sizeof (SF_INFO)
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
SF_INFO sfinfo ;
|
||||
sf_command (sndfile, SFC_GET_CURRENT_SF_INFO, sfinfo, sizeof (SF_INFO)) ;
|
||||
</PRE>
|
||||
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<DD><DD>Zero on success, non-zero otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_CALC_SIGNAL_MAX"></A>
|
||||
<H2><BR><B>SFC_CALC_SIGNAL_MAX</B></H2>
|
||||
@@ -1243,7 +1346,7 @@ Parameters:
|
||||
</P>
|
||||
<DL>
|
||||
<DT>Return value: </DT>
|
||||
<DD>SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT or zero if the file format
|
||||
<DD>SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT or zero if the file format
|
||||
does not support ambisonic formats.
|
||||
</DL>
|
||||
|
||||
@@ -1280,9 +1383,11 @@ This command is currently only supported for files with SF_FORMAT_WAVEX format.
|
||||
<A NAME="SFC_SET_VBR_ENCODING_QUALITY"></A>
|
||||
<H2><BR><B>SFC_SET_VBR_ENCODING_QUALITY</B></H2>
|
||||
<P>
|
||||
Set the the Variable Bit Rate encoding quality.
|
||||
Set the Variable Bit Rate encoding quality.
|
||||
The encoding quality value should be between 0.0 (lowest quality) and 1.0
|
||||
(highest quality).
|
||||
Currenly this command is only implemented for FLAC and Ogg/Vorbis files.
|
||||
It has no effect on un-compressed file formats.
|
||||
</P>
|
||||
<P>
|
||||
Parameters:
|
||||
@@ -1298,13 +1403,43 @@ The command must be sent before any audio data is written to the file.
|
||||
<P>
|
||||
</P>
|
||||
<DL>
|
||||
<DT>Return value: </DT>
|
||||
<DD>Zero on success, non-zero otherwise.
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if VBR encoding quality was set.
|
||||
SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_RAW_NEEDS_ENDSWAP"></A>
|
||||
<H2><BR><B>SFC_RAW_NEEDS_ENDSWAP</B></H2>
|
||||
<A NAME="SFC_SET_COMPRESSION_LEVEL"></A>
|
||||
<H2><BR><B>SFC_SET_COMPRESSION_LEVEL</B></H2>
|
||||
<P>
|
||||
Set the compression level.
|
||||
The compression level should be between 0.0 (minimum compression level) and 1.0
|
||||
(highest compression level).
|
||||
Currenly this command is only implemented for FLAC and Ogg/Vorbis files.
|
||||
It has no effect on un-compressed file formats.
|
||||
</P>
|
||||
<P>
|
||||
Parameters:
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_SET_COMPRESSION_LEVEL
|
||||
data : A pointer to a double value
|
||||
datasize : sizeof (double)
|
||||
</PRE>
|
||||
<P>
|
||||
The command must be sent before any audio data is written to the file.
|
||||
</P>
|
||||
<P>
|
||||
</P>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if compression level was set.
|
||||
SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_RAW_DATA_NEEDS_ENDSWAP"></A>
|
||||
<H2><BR><B>SFC_RAW_DATA_NEEDS_ENDSWAP</B></H2>
|
||||
<P>
|
||||
Determine if raw data read using
|
||||
<a href="api.html#raw">
|
||||
@@ -1320,7 +1455,7 @@ machine.
|
||||
Parameters:
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_RAW_NEEDS_ENDSWAP
|
||||
cmd : SFC_RAW_DATA_NEEDS_ENDSWAP
|
||||
data : NULL
|
||||
datasize : 0
|
||||
</PRE>
|
||||
@@ -1392,7 +1527,528 @@ Parameters:
|
||||
<DT>Return value: </DT>
|
||||
<DD>SF_TRUE if setting the Broadcast Extension chunk was successful and SF_FALSE
|
||||
otherwise.
|
||||
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_GET_CHANNEL_MAP_INFO"></A>
|
||||
<H2><BR><B>SFC_GET_CHANNEL_MAP_INFO</B></H2>
|
||||
<P>
|
||||
Retrieve the channel map contained in an AIFF or CAF Channel Layout chunk.
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_CHANNEL_MAP_INFO
|
||||
data : a pointer to an array of int, the same size as the number of channels in the file
|
||||
datasize : number of channels * sizeof (int)
|
||||
</PRE>
|
||||
<P>
|
||||
Channel map positions are defined in an enum in <sndfile.h>.
|
||||
</P>
|
||||
|
||||
<DL>
|
||||
<DT>Return value: </DT>
|
||||
<DD>SF_TRUE if the file contained a Channel Layout chunk or SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_SET_CHANNEL_MAP_INFO"></A>
|
||||
<H2><BR><B>SFC_SET_CHANNEL_MAP_INFO</B></H2>
|
||||
<P>
|
||||
Set the channel map contained in an AIFF or CAF Channel Layout chunk.
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_SET_CHANNEL_MAP_INFO
|
||||
data : a pointer to an array of int, the same size as the number of channels in the file
|
||||
datasize : number of channels * sizeof (int)
|
||||
</PRE>
|
||||
|
||||
<DL>
|
||||
<DT>Return value: </DT>
|
||||
<DD>SF_TRUE if setting the Channel Layout chunk was successful and SF_FALSE otherwise.
|
||||
|
||||
</DL>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_GET_CART_INFO"></A>
|
||||
<H2><BR><B>SFC_GET_CART_INFO</B></H2>
|
||||
<P>Retrieve the Cart Chunk from WAV (and related) files. Based on AES46 standard for CartChunk (see <a href="http://www.cartchunk.org/">CartChunk.org</a> for more information.
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_CART_INFO
|
||||
data : a pointer to an SF_CART_INFO struct
|
||||
datasize : sizeof (SF_CART_INFO)
|
||||
</PRE>
|
||||
<P>
|
||||
The SF_CART_INFO struct is defined in <sndfile.h> as:
|
||||
</P>
|
||||
<PRE>
|
||||
#define SF_CART_INFO_VAR(p_tag_text_size) \
|
||||
struct
|
||||
{ char version [4] ;
|
||||
char title [64] ;
|
||||
char artist [64] ;
|
||||
char cut_id [64] ;
|
||||
char client_id [64] ;
|
||||
char category [64] ;
|
||||
char classification [64] ;
|
||||
char out_cue [64] ;
|
||||
char start_date [10] ;
|
||||
char start_time [8] ;
|
||||
char end_date [10] ;
|
||||
char end_time [8] ;
|
||||
char producer_app_id [64] ;
|
||||
char producer_app_version [64] ;
|
||||
char user_def [64] ;
|
||||
long level_reference ;
|
||||
SF_CART_TIMER post_timers [8] ;
|
||||
char reserved [276] ;
|
||||
char url [1024] ;
|
||||
unsigned int tag_text_size ;
|
||||
char tag_text[p_tag_text_size] ;
|
||||
}
|
||||
</PRE>
|
||||
|
||||
<DL>
|
||||
<DT>Return value: </DT>
|
||||
<DD>SF_TRUE if the file contained a Cart chunk or SF_FALSE
|
||||
otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_SET_CART_INFO"></A>
|
||||
<H2><BR><B>SFC_SET_CART_INFO</B></H2>
|
||||
<P>
|
||||
Set the Cart Chunk for WAV (and related) files.
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_SET_CART_INFO
|
||||
data : a pointer to an SF_CART_INFO struct
|
||||
datasize : sizeof (SF_CART_INFO)
|
||||
</PRE>
|
||||
|
||||
<DL>
|
||||
<DT>Return value: </DT>
|
||||
<DD>SF_TRUE if setting the Cart chunk was successful and SF_FALSE
|
||||
otherwise.
|
||||
</DL>
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
<A NAME="SFC_GET_LOOP_INFO"></A>
|
||||
<H2><BR><B>SFC_GET_LOOP_INFO</B></H2>
|
||||
<P>
|
||||
Retrieve loop information for file including time signature, length in
|
||||
beats and original MIDI base note
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_LOOP_INFO
|
||||
data : a pointer to an SF_LOOP_INFO struct
|
||||
datasize : sizeof (SF_LOOP_INFO)
|
||||
</PRE>
|
||||
<P>
|
||||
The SF_BROADCAST_INFO struct is defined in <sndfile.h> as:
|
||||
</P>
|
||||
<PRE>
|
||||
typedef struct
|
||||
{ short time_sig_num ; /* any positive integer > 0 */
|
||||
short time_sig_den ; /* any positive power of 2 > 0 */
|
||||
int loop_mode ; /* see SF_LOOP enum */
|
||||
|
||||
int num_beats ; /* this is NOT the amount of quarter notes !!!*/
|
||||
/* a full bar of 4/4 is 4 beats */
|
||||
/* a full bar of 7/8 is 7 beats */
|
||||
|
||||
float bpm ; /* suggestion, as it can be calculated using other fields:*/
|
||||
/* file's lenght, file's sampleRate and our time_sig_den*/
|
||||
/* -> bpms are always the amount of _quarter notes_ per minute */
|
||||
|
||||
int root_key ; /* MIDI note, or -1 for None */
|
||||
int future [6] ;
|
||||
} SF_LOOP_INFO ;
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
SF_LOOP_INFO loop;
|
||||
sf_command (sndfile, SFC_GET_LOOP_INFO, &loop, sizeof (loop)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<DD>SF_TRUE if the file header contains loop information for the file.
|
||||
SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
|
||||
<A NAME="SFC_GET_INSTRUMENT"></A>
|
||||
<H2><BR><B>SFC_GET_INSTRUMENT</B></H2>
|
||||
<P>
|
||||
Retrieve instrument information from file including MIDI base note,
|
||||
keyboard mapping and looping informations(start/stop and mode).
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_INSTRUMENT
|
||||
data : a pointer to an SF_INSTRUMENT struct
|
||||
datasize : sizeof (SF_INSTRUMENT)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The SF_INSTRUMENT struct is defined in <sndfile.h> as:
|
||||
</P>
|
||||
<PRE>
|
||||
enum
|
||||
{ /*
|
||||
** The loop mode field in SF_INSTRUMENT will be one of the following.
|
||||
*/
|
||||
SF_LOOP_NONE = 800,
|
||||
SF_LOOP_FORWARD,
|
||||
SF_LOOP_BACKWARD,
|
||||
SF_LOOP_ALTERNATING
|
||||
} ;
|
||||
|
||||
typedef struct
|
||||
{ int gain ;
|
||||
char basenote, detune ;
|
||||
char velocity_lo, velocity_hi ;
|
||||
char key_lo, key_hi ;
|
||||
int loop_count ;
|
||||
|
||||
struct
|
||||
{ int mode ;
|
||||
unsigned int start ;
|
||||
unsigned int end ;
|
||||
unsigned int count ;
|
||||
} loops [16] ; /* make variable in a sensible way */
|
||||
} SF_INSTRUMENT ;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
SF_INSTRUMENT inst ;
|
||||
sf_command (sndfile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if the file header contains instrument information for the
|
||||
file. SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
|
||||
<A NAME="SFC_SET_INSTRUMENT"></A>
|
||||
<H2><BR><B>SFC_SET_INSTRUMENT</B></H2>
|
||||
<P>
|
||||
Set the instrument information for the file.
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_SET_INSTRUMENT
|
||||
data : a pointer to an SF_INSTRUMENT struct
|
||||
datasize : sizeof (SF_INSTRUMENT)
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
SF_INSTRUMENT inst ;
|
||||
sf_command (sndfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if the file header contains instrument information for the
|
||||
file. SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
<A NAME="SFC_GET_CUE"></A>
|
||||
<H2><BR><B>SFC_GET_CUE_COUNT</B></H2>
|
||||
<P>
|
||||
Retrieve the number of cue markers available for retrieval using the
|
||||
SFC_GET_CUE command.
|
||||
</P>
|
||||
<P>
|
||||
Parameters:
|
||||
</P>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_CUE
|
||||
data : a pointer to a uint32_t
|
||||
datasize : sizeof (uint32_t)
|
||||
</PRE>
|
||||
|
||||
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
uint32_t cue_count ;
|
||||
sf_command (sndfile, SFC_GET_CUE_COUNT, &cue_count, sizeof (cue_count)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if the file header contains cue marker information for the
|
||||
file. SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
<A NAME="SFC_GET_CUE"></A>
|
||||
<H2><BR><B>SFC_GET_CUE</B></H2>
|
||||
<P>
|
||||
Retrieve cue marker information from file.
|
||||
</P>
|
||||
<P>
|
||||
Parameters:
|
||||
</P>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_CUE
|
||||
data : a pointer to an SF_CUES struct
|
||||
datasize : sizeof (SF_CUES)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The SF_CUES struct is defined in <sndfile.h> as:
|
||||
</P>
|
||||
<PRE>
|
||||
typedef struct
|
||||
{ int cue_count ;
|
||||
|
||||
struct
|
||||
{ int32_t indx ;
|
||||
uint32_t position ;
|
||||
int32_t fcc_chunk ;
|
||||
int32_t chunk_start ;
|
||||
int32_t block_start ;
|
||||
uint32_t sample_offset ;
|
||||
char name [256] ;
|
||||
} cue_points [100] ;
|
||||
} SF_CUES ;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
There is also an SF_CUES_VAR #define that allows reading/writing more than 100
|
||||
cue markers.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
SF_CUES cues ;
|
||||
sf_command (sndfile, SFC_GET_CUE, &cues, sizeof (cues)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if the file header contains cue marker information for the
|
||||
file. SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
|
||||
<A NAME="SFC_SET_CUE"></A>
|
||||
<H2><BR><B>SFC_SET_CUE</B></H2>
|
||||
<P>
|
||||
Set the cue marker information for the file.
|
||||
</P>
|
||||
<P>
|
||||
Parameters:
|
||||
</P>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_SET_CUE
|
||||
data : a pointer to an SF_CUES struct
|
||||
datasize : sizeof (SF_CUES)
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
SF_CUES cues ;
|
||||
sf_command (sndfile, SFC_SET_CUE, &cues, sizeof (cues)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>SF_TRUE if the file header contains cue marker information for the
|
||||
file. SF_FALSE otherwise.
|
||||
</DL>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
|
||||
<A NAME="SFC_RF64_AUTO_DOWNGRADE"></A>
|
||||
<H2><BR><B>SFC_RF64_AUTO_DOWNGRADE</B></H2>
|
||||
<P>
|
||||
Enable auto downgrade from RF64 to WAV.
|
||||
</P>
|
||||
<P>
|
||||
The EBU recomendation is that when writing RF64 files and the resulting file is
|
||||
less than 4Gig in size, it should be downgraded to a WAV file (WAV files have a
|
||||
maximum size of 4Gig).
|
||||
libsndfile doesn't follow the EBU recommendations exactly, , mainly because the
|
||||
test suite needs to be able test reading/writing RF64 files without having to
|
||||
generate files larger than 4 gigabytes.
|
||||
</P>
|
||||
<p>
|
||||
Note: This command should be issued before the first bit of audio data has been
|
||||
written to the file.
|
||||
Calling this command after audio data has been written will return the current
|
||||
value of this setting, but will not allow it to be changed.
|
||||
</p>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_RF64_AUTO_DOWNGRADE
|
||||
data : NULL
|
||||
datasize : SF_TRUE or SF_FALSE
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
/* Enable auto downgrade on file close. */
|
||||
sf_command (sndfile, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_TRUE) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>Returns SF_TRUE if SFC_RF64_AUTO_DOWNGRADE is set and SF_FALSE
|
||||
otherwise.
|
||||
</DL>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_GET_ORIGINAL_SAMPLERATE"></A>
|
||||
<H2><BR><B>SFC_GET_ORIGINAL_SAMPLERATE</B></H2>
|
||||
<P>
|
||||
Get original samplerate metadata.
|
||||
</P>
|
||||
<P>
|
||||
The Opus audio codec stores audio data independent of samplerate, but only
|
||||
supports encoding or decoding at 8000Hz, 12000Hz, 16000Hz, 24000HZ or 48000Hz.
|
||||
Opus includes a header field to record the original source input samplerate, and
|
||||
a samplerate converter may be used if needed.
|
||||
</p>
|
||||
<P>
|
||||
This command gets the original samplerate header field. It does not enable any
|
||||
(non-existent) samplerate conversion, nor change the current decoder samplerate.
|
||||
</P>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_GET_ORIGINAL_SAMPLERATE
|
||||
data : pointer to an integer
|
||||
datasize : sizeof (int)
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
/* Get the original sample rate */
|
||||
int original_samplerate ;
|
||||
sf_command (sndfile, SFC_GET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>Returns SF_TRUE on success, SF_FALSE otherwise.
|
||||
<dd>The passed integer is set to the value of the original samplerate.
|
||||
</DL>
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="SFC_SET_ORIGINAL_SAMPLERATE"></A>
|
||||
<H2><BR><B>SFC_SET_ORIGINAL_SAMPLERATE</B></H2>
|
||||
<P>
|
||||
Set original samplerate metadata.
|
||||
</P>
|
||||
<P>
|
||||
The Opus audio codec stores audio data independent of samplerate, but only
|
||||
supports encoding or decoding at 8000Hz, 12000Hz, 16000Hz, 24000HZ or 48000Hz.
|
||||
Opus includes a header field to record the original source input samplerate, and
|
||||
a samplerate converter may be used if needed.
|
||||
</p>
|
||||
<p>
|
||||
When writing an Opus file this command sets the original samplerate header field
|
||||
to the provided value, which is then stored in the file. This has no effect on
|
||||
the current encoder samplerate.
|
||||
</p>
|
||||
<p>
|
||||
When reading an Opus file this command overrides the original samplerate value
|
||||
as read from the file. libsndfile uses this value to choose what samplerate
|
||||
to decode at, rounding up to the nearest valid Opus samplerate. After a
|
||||
successful call, the file samplerate and frames count may have changed.
|
||||
</p>
|
||||
<p>
|
||||
Note: This command should be issued before the first bit of audio data has been
|
||||
read from or written to the file.
|
||||
</p>
|
||||
<p>
|
||||
Parameters:
|
||||
</p>
|
||||
<PRE>
|
||||
sndfile : A valid SNDFILE* pointer
|
||||
cmd : SFC_SET_ORIGINAL_SAMPLERATE
|
||||
data : pointer to an integer
|
||||
datasize : sizeof (int)
|
||||
</PRE>
|
||||
<P>
|
||||
Example:
|
||||
</P>
|
||||
<PRE>
|
||||
/* Store the original sample rate as 44100 */
|
||||
int original_samplerate 44100;
|
||||
sf_command (sndfile, SFC_SET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (input_samplerate)) ;
|
||||
</PRE>
|
||||
<DL>
|
||||
<DT>Return value:</DT>
|
||||
<dd>Returns SF_TRUE on success, SF_FALSE otherwise.
|
||||
<dd>On write, can only succeed if no data has been written.
|
||||
<dd>On read, if successful, <a HREF="#SFC_GET_CURRENT_SF_INFO">SFC_GET_CURRENT_SF_INFO</a>
|
||||
should be called to determine the new frames count and samplerate
|
||||
</DL>
|
||||
|
||||
|
||||
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
|
||||
@@ -1402,7 +2058,7 @@ Parameters:
|
||||
<A HREF="http://www.mega-nerd.com/libsndfile/">
|
||||
http://www.mega-nerd.com/libsndfile/</A>.
|
||||
<BR>
|
||||
Version : 1.0.24
|
||||
Version : 1.0.25
|
||||
</P>
|
||||
|
||||
</BODY>
|
||||
|
42
lib-src/libsndfile/doc/development.html
Normal file
42
lib-src/libsndfile/doc/development.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
libsndfile Development
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<LINK REL="stylesheet" HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
|
||||
<LINK REL="stylesheet" HREF="print.css" TYPE="text/css" MEDIA="print">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
<!-- pepper -->
|
||||
<H1><BR>libsndfile Development</H1>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
libsndfile is being developed by a small community of users and hackers.
|
||||
People interested in helping can join the libsndfile-devel
|
||||
<A HREF="lists.html">mailing list</A>
|
||||
or raise an issue on Github.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
The main repository can be found on Github:
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<center>
|
||||
<A HREF="https://github.com/erikd/libsndfile/">
|
||||
https://github.com/erikd/libsndfile/</A>
|
||||
</center>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
and includes
|
||||
<a href="https://github.com/erikd/libsndfile/blob/master/README.md">
|
||||
instuctions</a>
|
||||
on how to build libsndfile from the Git repo.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
File diff suppressed because it is too large
Load Diff
112
lib-src/libsndfile/doc/donate.html
Normal file
112
lib-src/libsndfile/doc/donate.html
Normal file
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
libsndfile : donate.
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<!-- Another version at the bottom of the page. -->
|
||||
<META NAME="Description" CONTENT="The libsndfile API.">
|
||||
<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="print.css" TYPE="text/css" MEDIA="print">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
|
||||
<br/>
|
||||
<!-- pepper -->
|
||||
<center>
|
||||
<IMG SRC="libsndfile.jpg" HEIGHT=98 WIDTH=367 ALT="libsndfile.jpg">
|
||||
</center>
|
||||
<!-- pepper -->
|
||||
<br/>
|
||||
|
||||
<p>
|
||||
Dear libsndfile user,
|
||||
</p>
|
||||
<!-- pepper -->
|
||||
<p>
|
||||
This library was developed on Linux for Linux. I am not a Windows user and
|
||||
maintaining this library for Windows costs me significant amounts of time above
|
||||
and beyond the time taken to make it work on Linux and Unix-like systems.
|
||||
</p>
|
||||
<!-- pepper -->
|
||||
<p>
|
||||
I therefore ask Windows users of libsndfile to donate to ensure that libsndfile's
|
||||
support for Windows continues. As long as donations continue to flow in at a decent
|
||||
rate, I will continue to release precompiled Windows binaries in sync with the
|
||||
Linux/Unix version. If donations are poor, support for windows will fall behind.
|
||||
</p>
|
||||
<!-- pepper -->
|
||||
|
||||
<p>
|
||||
You are free to donate any amount you chose.
|
||||
As a guideline:
|
||||
</p>
|
||||
<!-- pepper -->
|
||||
<ul>
|
||||
<li>If you are simply a user of libsndfile that would like to ensure that
|
||||
the development of libsndfile continues, a donation of $10US would be more
|
||||
than adequate.
|
||||
</li>
|
||||
<li>If you are shareware author that distributes libsndfile with your app and
|
||||
makes more than $1000 a year from your shareware, a one off donation of $50
|
||||
would be appropriate.
|
||||
</li>
|
||||
<li>If your company is a commercial software house that distributes one or more
|
||||
products that ship with libsndfile, a donation of $100 every second or third
|
||||
year would be appropriate.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- pepper -->
|
||||
<p>
|
||||
Donations can be made in Bitcoin to the Bitcoin address
|
||||
<b>15hVWemFiH6DLJ22SBYPk9b4fgWtxBEvfQ</b>
|
||||
|
||||
which can be verified by checking the following GPG signature.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA256
|
||||
|
||||
libsndfile Bitcoin address : 15hVWemFiH6DLJ22SBYPk9b4fgWtxBEvfQ
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.12 (GNU/Linux)
|
||||
|
||||
iQIcBAEBCAAGBQJSK7MUAAoJEEXYQ7zIiotIgXEP/R8hy65tlV7TiPw9bY9BklXS
|
||||
/Vl8FU2RhDkBt61ZmxbfDTybyQ5Vce/3wWph15L4RvpoX1OyeintQFmwwuPjOGiq
|
||||
eIz0nT9vDorG37Xdo5NZNBu9Tp1Od9MNtxFaAsRWFrDfvKEKljBHrcfM972cYrAp
|
||||
DaFd0Ik+bHKom9iQXFB7TFd0w2V4uszVMQDUGqb/vRNeRURZS7ypeMNwc8tZyTKR
|
||||
waEGMTa5sxxRjs7MqGRxSovnFT7JV3TNfdkBInUliIR/XvrudFR9J4Fiv+8Dk9P8
|
||||
WNjm6uFxvgIqiu1G9bjrwwr+DsBju93ljGNcZoayAKw5vwbX6KTcCbc31k9dP8Hf
|
||||
p6YdmPlZVKZmva+P3nLSJBTlxNu24Jm+ha+ZM/svDXTaPFWC8l5FP17kK0Bj8wCq
|
||||
N7pDz6RchEn10u+HdhfT1XiUjxj0zNXrr0GGj9apjl0RlT0O49eBttV0oXIdBRLi
|
||||
nTEaOWITpCgu7ggw1kWXHIWEncuiaSuJy/iH8PgNepWVj/6PxQRMrTqG4ux2Snk8
|
||||
Ua4vO8YHLMZX/XvSUS7eMtgfM7AO6YjJ/ac9bQif9bh6LsYEVVklysMUin6ZRS7Z
|
||||
Cms23FnqeQKtJOzdvqSJiV06lK6fP+tYdM4WSYn+AfL4IfYl2v48xXVU8XOOK9BH
|
||||
bJPKMDcz1ZvfYtX5mSW1
|
||||
=WXGB
|
||||
-----END PGP SIGNATURE-----
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Thanks and regards,
|
||||
<br/>
|
||||
Erik de Castro Lopo
|
||||
<br/>
|
||||
Main libsndfile author and maintainer
|
||||
</p>
|
||||
|
||||
<!-- pepper -->
|
||||
|
||||
<img src=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|trgb=0;0;0|wxh=15;20|md=6|dd=B|st=1|sh=1|df=libsndfile-donate.dat"
|
||||
HEIGHT=0 WIDTH=0 ALT="">
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
@@ -6,7 +6,7 @@
|
||||
libsndfile
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsndfile-1.0.24">
|
||||
<META NAME="Version" CONTENT="libsndfile-1.0.28">
|
||||
<META NAME="Description" CONTENT="The libsndfile Home Page">
|
||||
<META NAME="Keywords" CONTENT="WAV AIFF AU SVX PAF NIST W64 libsndfile sound audio dsp Linux">
|
||||
<META NAME="ROBOTS" CONTENT="NOFOLLOW">
|
||||
@@ -68,7 +68,6 @@
|
||||
<LI>Every platform supported by Debian GNU/Linux including x86_64-linux-gnu,
|
||||
i486-linux-gnu, powerpc-linux-gnu, sparc-linux-gnu, alpha-linux-gnu,
|
||||
mips-linux-gnu and armel-linux-gnu.</LI>
|
||||
<LI>arm-linux-androideab (Android phones OS)</LI>
|
||||
<LI>powerpc-apple-darwin7.0 (Mac OS X 10.3)</LI>
|
||||
<LI>sparc-sun-solaris2.8 (using gcc)</LI>
|
||||
<LI>mips-sgi-irix5.3 (using gcc)</LI>
|
||||
@@ -163,7 +162,7 @@
|
||||
|
||||
<TR><TD>Signed 24 bit PCM</TD>
|
||||
<TD ALIGN="center">R/W</TD><TD ALIGN="center">R/W</TD><TD ALIGN="center">R/W</TD><TD ALIGN="center">R/W</TD>
|
||||
<TD ALIGN="center">R/W</TD><TD> </TD><TD ALIGN="center">R/W</TD><TD ALIGN="center">R/W</TD>
|
||||
<TD ALIGN="center">R/W</TD><TD> </TD><TD ALIGN="center">R/W</TD><TD> </TD>
|
||||
<TD> </TD><TD ALIGN="center">R/W</TD><TD> </TD><TD> </TD><TD> </TD>
|
||||
<TD> </TD><TD> </TD><TD ALIGN="center">R/W</TD><TD ALIGN="center">R/W</TD><TD ALIGN="center">R/W</TD>
|
||||
</TR>
|
||||
@@ -293,7 +292,7 @@ and
|
||||
I have decided that I will not be adding support for MPEG Layer 3 (commonly
|
||||
known as MP3) due to the patent issues surrounding this file format.
|
||||
See
|
||||
<a href="http://www.mega-nerd.com/libsndfile/FAQ.html#Q020">
|
||||
<a href="FAQ.html#Q020">
|
||||
the FAQ</a>
|
||||
for more.
|
||||
</P>
|
||||
@@ -367,6 +366,14 @@ and
|
||||
<LI>Version 1.0.22 (October 04 2010) Bunch of minor bug fixes.
|
||||
<LI>Version 1.0.23 (October 10 2010) Minor bug fixes.
|
||||
<LI>Version 1.0.24 (March 23 2011) Minor bug fixes.
|
||||
<LI>Version 1.0.25 (July 13 2011) Fix for Secunia Advisory SA45125. Minor bug fixes and
|
||||
improvements.
|
||||
<LI>Version 1.0.26 (November 22 2015) Fix for CVE-2014-9496, CVE-2014-9756 and CVE-2015-7805.
|
||||
Add ALAC/CAF support. Minor bug fixes and improvements.
|
||||
<LI>Version 1.0.27 (June 19 2016) Fix a seek regression in 1.0.26. Add metadata read/write
|
||||
for CAF and RF64. FIx PAF endian-ness issue.
|
||||
<LI>Version 1.0.28 (April 2 2017) Fix buffer overruns in FLAC and ID3 handling code. Reduce default
|
||||
header memory requirements. Fix detection of Large File Support for 32 bit systems.
|
||||
</UL>
|
||||
|
||||
<A NAME="Similar"></A>
|
||||
@@ -428,22 +435,28 @@ and
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Source code as a .tar.gz :
|
||||
<A HREF="files/libsndfile-1.0.24.tar.gz">libsndfile-1.0.24.tar.gz</A>
|
||||
<A HREF="files/libsndfile-1.0.28.tar.gz">libsndfile-1.0.28.tar.gz</A>
|
||||
and
|
||||
<A HREF="files/libsndfile-1.0.24.tar.gz.asc">(GPG signature)</A>.
|
||||
<A HREF="files/libsndfile-1.0.28.tar.gz.asc">GPG signature</A>.
|
||||
<LI>Win32 installer:
|
||||
<A HREF="files/libsndfile-1.0.24-w32-setup.exe">
|
||||
libsndfile-1.0.24-w32-setup.exe</A> (thoroughly tested under
|
||||
<a href="http://www.winehq.com/">Wine</a> and Windows XP).
|
||||
<A HREF="files/libsndfile-1.0.28-w32-setup.exe">
|
||||
libsndfile-1.0.28-w32-setup.exe</A> (thoroughly tested under
|
||||
<a href="http://www.winehq.com/">Wine</a>)
|
||||
and
|
||||
<A HREF="files/libsndfile-1.0.28-w32-setup.exe.asc">GPG signature</A>.
|
||||
<LI>Win64 installer:
|
||||
<A HREF="files/libsndfile-1.0.24-w64-setup.exe">
|
||||
libsndfile-1.0.24-w64-setup.exe</A>
|
||||
(thoroughly tested on 64 bit Windows 7).
|
||||
<A HREF="files/libsndfile-1.0.28-w64-setup.exe">
|
||||
libsndfile-1.0.28-w64-setup.exe</A> (thoroughly tested under
|
||||
<a href="http://www.winehq.com/">Wine</a>)
|
||||
and
|
||||
<A HREF="files/libsndfile-1.0.28-w64-setup.exe.asc">GPG signature</A>.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The Win32 installer was compiled for Windows XP but should also work on Windows
|
||||
2000, Vista and Windows 7.
|
||||
The GPG signature can be validated at
|
||||
<A HREF="https://keybase.io/erikd/">Keybase.IO</A>.
|
||||
</P>
|
||||
<P>
|
||||
The Win32 installer should work on Windows Vista or later.
|
||||
</p>
|
||||
|
||||
<P>
|
||||
|
@@ -83,6 +83,8 @@ h4 {
|
||||
pre {
|
||||
font-family : courier, monospace ;
|
||||
font-size : medium ;
|
||||
margin-left : 6% ;
|
||||
margin-right : 6% ;
|
||||
}
|
||||
a:link { color : #9090FF ; }
|
||||
a:visited { color : #5050FF ; }
|
||||
|
434
lib-src/libsndfile/doc/linux_games_programming.txt
Normal file
434
lib-src/libsndfile/doc/linux_games_programming.txt
Normal file
@@ -0,0 +1,434 @@
|
||||
# Here are some some emails I exchanged with a guy trying to use
|
||||
# libsndfile version 1 with code from the book "Linux Games Programming"
|
||||
# by John Hall. The email addresses have been changed to foil the spam
|
||||
# bots.
|
||||
|
||||
Date: Tue, 20 Jul 2004 22:49:21 +0100
|
||||
From: Paul <paul@fake-domain-name.co.uk>
|
||||
To: erikd@fake-domain-name.com
|
||||
Subject: Can you help with a problem?
|
||||
Date: Tue, 20 Jul 2004 22:49:21 +0100
|
||||
|
||||
Hi,
|
||||
|
||||
I'm trying to get the source examples in the "Programming Linux Games"
|
||||
(NoStarch, Loki Software + John R. Hall) which use sndfile.h/libsndfile.
|
||||
|
||||
While I can guess some of the newer versions of function calls and
|
||||
enumerations, there are some which I cannot guess.
|
||||
|
||||
Would you be able to translate them to the current version of
|
||||
enumeration and function calls so that I can update the source?
|
||||
|
||||
These are the three currently failing me:
|
||||
|
||||
sf_open_read(filename, SF_INFO *sfinfo) (guess: sf_open(filename,SFM_READ, &sfinfo))
|
||||
SF_FORMAT_PCM (guess: either SF_FORMAT_PCM_U8 or _RAW)
|
||||
SF_INFO.pcmbitwidth (guess: no idea!)
|
||||
|
||||
There are probably more. I'm happy to send you the source files for
|
||||
sound calls, scan the pages or anything else. Failing that, is there
|
||||
somewhere with the changes listed so I can try and fix the code for myself?
|
||||
|
||||
Thanks
|
||||
|
||||
TTFN
|
||||
|
||||
Paul
|
||||
|
||||
================================================================================
|
||||
|
||||
Date: Wed, 21 Jul 2004 17:38:08 +1000
|
||||
From: Erik de Castro Lopo <erikd@fake-domain-name.com>
|
||||
To: Paul <paul@fake-domain-name.co.uk>
|
||||
Subject: Re: Can you help with a problem?
|
||||
|
||||
On Tue, 20 Jul 2004 22:49:21 +0100
|
||||
Paul <paul@fake-domain-name.co.uk> wrote:
|
||||
|
||||
> Hi,
|
||||
>
|
||||
> I'm trying to get the source examples in the "Programming Linux Games"
|
||||
> (NoStarch, Loki Software + John R. Hall) which use sndfile.h/libsndfile.
|
||||
>
|
||||
> While I can guess some of the newer versions of function calls and
|
||||
> enumerations, there are some which I cannot guess.
|
||||
>
|
||||
> Would you be able to translate them to the current version of
|
||||
> enumeration and function calls so that I can update the source?
|
||||
>
|
||||
> These are the three currently failing me:
|
||||
>
|
||||
> sf_open_read(filename, SF_INFO *sfinfo) (guess: sf_open(filename,
|
||||
> SFM_READ, &sfinfo))
|
||||
|
||||
yes.
|
||||
|
||||
> SF_FORMAT_PCM (guess: either SF_FORMAT_PCM_U8 or _RAW)
|
||||
|
||||
Actually this list:
|
||||
|
||||
SF_FORMAT_PCM_U8
|
||||
SF_FORMAT_PCM_S8
|
||||
SF_FORMAT_PCM_16
|
||||
SF_FORMAT_PCM_24
|
||||
SF_FORMAT_PCM_32
|
||||
|
||||
> SF_INFO.pcmbitwidth (guess: no idea!)
|
||||
|
||||
WIth the above change, pcmbitwidth becomes redundant.
|
||||
|
||||
> There are probably more. I'm happy to send you the source files for
|
||||
> sound calls, scan the pages or anything else. Failing that, is there
|
||||
> somewhere with the changes listed so I can try and fix the code for
|
||||
> myself?
|
||||
|
||||
Version 1.0.0 came out some time ago, but I think this:
|
||||
|
||||
http://www.mega-nerd.com/libsndfile/version-1.html
|
||||
|
||||
lists most of the changes. You should also look at the API docs:
|
||||
|
||||
http://www.mega-nerd.com/libsndfile/api.html
|
||||
|
||||
HTH,
|
||||
Erik
|
||||
--
|
||||
+-----------------------------------------------------------+
|
||||
Erik de Castro Lopo nospam@fake-domain-name.com
|
||||
+-----------------------------------------------------------+
|
||||
"There is no reason why anyone would want a computer in their home"
|
||||
Ken Olson, DEC, 1977
|
||||
|
||||
================================================================================
|
||||
|
||||
From: PFJ <paul@fake-domain-name.co.uk>
|
||||
To: Erik de Castro Lopo <erikd@fake-domain-name.com>
|
||||
Subject: Re: Can you help with a problem?
|
||||
Date: Wed, 21 Jul 2004 09:07:39 +0100
|
||||
|
||||
|
||||
Hi Erik,
|
||||
|
||||
Thanks for getting back to me.
|
||||
|
||||
> > sf_open_read(filename, SF_INFO *sfinfo) (guess: sf_open(filename, SFM_READ, &sfinfo))
|
||||
>
|
||||
> yes.
|
||||
|
||||
Yay!
|
||||
|
||||
> > SF_FORMAT_PCM (guess: either SF_FORMAT_PCM_U8 or _RAW)
|
||||
>
|
||||
> Actually this list:
|
||||
>
|
||||
> SF_FORMAT_PCM_U8
|
||||
> SF_FORMAT_PCM_S8
|
||||
> SF_FORMAT_PCM_16
|
||||
> SF_FORMAT_PCM_24
|
||||
> SF_FORMAT_PCM_32
|
||||
|
||||
I know, but the source code explicitly has SF_FORMAT_PCM which given the
|
||||
code afterwards would equate to one of the above, but given that PCM
|
||||
files can have a varied bitwidth the author probably wanted to cover all
|
||||
bases.
|
||||
|
||||
> Version 1.0.0 came out some time ago, but I think this:
|
||||
>
|
||||
> http://www.mega-nerd.com/libsndfile/version-1.html
|
||||
>
|
||||
> lists most of the changes. You should also look at the API docs:
|
||||
>
|
||||
> http://www.mega-nerd.com/libsndfile/api.html
|
||||
|
||||
I'll download them and see what I can gleen.
|
||||
|
||||
Thanks again for getting back to me
|
||||
|
||||
TTFN
|
||||
|
||||
Paul
|
||||
|
||||
================================================================================
|
||||
|
||||
Date: Wed, 21 Jul 2004 18:20:29 +1000
|
||||
From: Erik de Castro Lopo <erikd@fake-domain-name.com>
|
||||
To: PFJ <paul@fake-domain-name.co.uk>
|
||||
Subject: Re: Can you help with a problem?
|
||||
|
||||
On Wed, 21 Jul 2004 09:07:39 +0100
|
||||
PFJ <paul@fake-domain-name.co.uk> wrote:
|
||||
|
||||
> I know, but the source code explicitly has SF_FORMAT_PCM which given the
|
||||
> code afterwards would equate to one of the above, but given that PCM
|
||||
> files can have a varied bitwidth the author probably wanted to cover all
|
||||
> bases.
|
||||
|
||||
But surely the existing code does something like:
|
||||
|
||||
sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM;
|
||||
sfinfo.pcmbitwidth = 16;
|
||||
|
||||
which can be directly translated to:
|
||||
|
||||
sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
|
||||
|
||||
and the same for pcmbitwitdhs of 24 and 32. For pcmbitwidth of 8
|
||||
you need to know that WAV files use SF_FORMAT_PCM_U8 and AIFF
|
||||
files use SF_FORMAT_PCM_S8. Thats all there is to it.
|
||||
|
||||
Erik
|
||||
--
|
||||
+-----------------------------------------------------------+
|
||||
Erik de Castro Lopo nospam@fake-domain-name.com
|
||||
+-----------------------------------------------------------+
|
||||
"Python addresses true pseudocode's two major failings: that it
|
||||
isn't standardized, and it isn't executable."
|
||||
- Grant R. Griffin in comp.dsp
|
||||
|
||||
================================================================================
|
||||
|
||||
Subject: Re: Can you help with a problem?
|
||||
From: PFJ <paul@fake-domain-name.co.uk>
|
||||
To: Erik de Castro Lopo <erikd@fake-domain-name.com>
|
||||
Date: Wed, 21 Jul 2004 09:50:55 +0100
|
||||
|
||||
Hi Erik,
|
||||
|
||||
> > I know, but the source code explicitly has SF_FORMAT_PCM which given the
|
||||
> > code afterwards would equate to one of the above, but given that PCM
|
||||
> > files can have a varied bitwidth the author probably wanted to cover all
|
||||
> > bases.
|
||||
>
|
||||
> But surely the existing code does something like:
|
||||
>
|
||||
> sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM;
|
||||
> sfinfo.pcmbitwidth = 16;
|
||||
|
||||
If only!
|
||||
|
||||
The actual code is this
|
||||
|
||||
int LoadSoundFile(char *filename, sound_p sound)
|
||||
{
|
||||
SNDFILE *file;
|
||||
SF_INFO file_info;
|
||||
short *buffer_short = NULL;
|
||||
u_int8_t *buffer_8 = NULL;
|
||||
int16_t *buffer_16 = NULL;
|
||||
unsigned int i;
|
||||
|
||||
/* Open the file and retrieve sample information. */
|
||||
file = sf_open_read(filename, &file_info);
|
||||
// I've sorted this one already - PFJ
|
||||
|
||||
/* Make sure the format is acceptable. */
|
||||
if ((file_info.format & 0x0F) != SF_FORMAT_PCM) {
|
||||
printf("'%s' is not a PCM-based audio file.\n", filename);
|
||||
sf_close(file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((file_info.pcmbitwidth == 8) && (file_info.channels == 1)) {
|
||||
sound->format = AL_FORMAT_MONO8;
|
||||
} else if ((file_info.pcmbitwidth == 8) && (file_info.channels == 2)) {
|
||||
sound->format = AL_FORMAT_STEREO8;
|
||||
} else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 1)) {
|
||||
sound->format = AL_FORMAT_MONO16;
|
||||
} else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 2)) {
|
||||
sound->format = AL_FORMAT_STEREO16;
|
||||
} else {
|
||||
printf("Unknown sample format in %s.\n", filename);
|
||||
sf_close(file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Allocate buffers. */
|
||||
buffer_short = (short *)malloc(file_info.samples * file_info.channels * sizeof (short));
|
||||
|
||||
buffer_8 = (u_int8_t *)malloc(file_info.samples * file_info.channels * file_info.pcmbitwidth / 8);
|
||||
|
||||
buffer_16 = (int16_t *)buffer_8;
|
||||
|
||||
if (buffer_short == NULL || buffer_8 == NULL) {
|
||||
printf("Unable to allocate enough memory for '%s'.\n", filename);
|
||||
goto error_cleanup;
|
||||
}
|
||||
|
||||
/* Read the entire sound file. */
|
||||
if (sf_readf_short(file,buffer_short,file_info.samples) == (size_t)-1) {
|
||||
printf("Error while reading samples from '%s'.\n", filename);
|
||||
goto error_cleanup;
|
||||
}
|
||||
|
||||
<minor snip>
|
||||
|
||||
/* Fill in the sound data structure. */
|
||||
sound->freq = file_info.samplerate;
|
||||
sound->size = file_info.samples * file_info.channels * file_info.pcmbitwidth / 8;
|
||||
|
||||
/* Give our sound data to OpenAL. */
|
||||
alGenBuffers(1, &sound->name);
|
||||
if (alGetError() != AL_NO_ERROR) {
|
||||
printf("Error creating an AL buffer name for %s.\n", filename);
|
||||
goto error_cleanup;
|
||||
}
|
||||
|
||||
alBufferData(sound->name, sound->format, buffer_8, sound->size,sound->freq);
|
||||
if (alGetError() != AL_NO_ERROR) {
|
||||
printf("Error sending buffer data to OpenAL for %s.\n", filename);
|
||||
goto error_cleanup;
|
||||
}
|
||||
|
||||
/* Close the file and return success. */
|
||||
sf_close(file);
|
||||
free(buffer_short);
|
||||
free(buffer_8);
|
||||
|
||||
return 0;
|
||||
|
||||
error_cleanup:
|
||||
if (file != NULL) fclose(file);
|
||||
free(buffer_short);
|
||||
free(buffer_8);
|
||||
return -1;
|
||||
}
|
||||
|
||||
As you can see, the PCM material in the listing will not currently
|
||||
compile and for the other sndfile material, it probably won't either.
|
||||
|
||||
Any help would be appreciated.
|
||||
|
||||
TTFN
|
||||
|
||||
Paul
|
||||
|
||||
================================================================================
|
||||
|
||||
From: Erik de Castro Lopo <erikd@fake-domain-name.com>
|
||||
To: PFJ <paul@fake-domain-name.co.uk>
|
||||
Subject: Re: Can you help with a problem?
|
||||
Date: Wed, 21 Jul 2004 19:36:46 +1000
|
||||
|
||||
On Wed, 21 Jul 2004 09:50:55 +0100
|
||||
PFJ <paul@fake-domain-name.co.uk> wrote:
|
||||
|
||||
> Hi Erik,
|
||||
>
|
||||
> > > I know, but the source code explicitly has SF_FORMAT_PCM which given the
|
||||
> > > code afterwards would equate to one of the above, but given that PCM
|
||||
> > > files can have a varied bitwidth the author probably wanted to cover all
|
||||
> > > bases.
|
||||
> >
|
||||
> > But surely the existing code does something like:
|
||||
> >
|
||||
> > sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM;
|
||||
> > sfinfo.pcmbitwidth = 16;
|
||||
>
|
||||
> If only!
|
||||
|
||||
No, really.
|
||||
|
||||
Drop this completely:
|
||||
|
||||
> /* Make sure the format is acceptable. */
|
||||
> if ((file_info.format & 0x0F) != SF_FORMAT_PCM) {
|
||||
> printf("'%s' is not a PCM-based audio file.\n", filename);
|
||||
> sf_close(file);
|
||||
> return -1;
|
||||
> }
|
||||
|
||||
Replace this block:
|
||||
|
||||
> if ((file_info.pcmbitwidth == 8) && (file_info.channels == 1)) {
|
||||
> sound->format = AL_FORMAT_MONO8;
|
||||
> } else if ((file_info.pcmbitwidth == 8) && (file_info.channels == 2)) {
|
||||
> sound->format = AL_FORMAT_STEREO8;
|
||||
> } else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 1)) {
|
||||
> sound->format = AL_FORMAT_MONO16;
|
||||
> } else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 2)) {
|
||||
> sound->format = AL_FORMAT_STEREO16;
|
||||
> } else {
|
||||
> printf("Unknown sample format in %s.\n", filename);
|
||||
> sf_close(file);
|
||||
> return -1;
|
||||
> }
|
||||
|
||||
with:
|
||||
|
||||
int pcmbitwidth = 0;
|
||||
|
||||
if (file_info.format & SF_FORMAT_SUBMASK != SF_FORMAT_PCM_16)
|
||||
{ printf("'%s' is not a PCM-based audio file.\n", filename);
|
||||
sf_close(file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (file_info.channels < 1 || file_info.channels > 2)
|
||||
{ printf("'%s' bad channel count.\n", filename);
|
||||
sf_close(file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (file_info.format & SF_FORMAT_SUBMASK + file_info.channels << 16)
|
||||
{ case (SF_FORMAT_PCM_U8 + 1 << 16):
|
||||
sound->format = AL_FORMAT_MONO8;
|
||||
pcmbitwidth = 8;
|
||||
break;
|
||||
case (SF_FORMAT_PCM_U8 + 2 << 16):
|
||||
sound->format = AL_FORMAT_STEREO8;
|
||||
pcmbitwidth = 8;
|
||||
break;
|
||||
case (SF_FORMAT_PCM_16 + 1 << 16):
|
||||
sound->format = AL_FORMAT_MONO16;
|
||||
pcmbitwidth = 16;
|
||||
break;
|
||||
case (SF_FORMAT_PCM_16 + 2 << 16):
|
||||
sound->format = AL_FORMAT_STEREO16;
|
||||
pcmbitwidth = 16;
|
||||
break;
|
||||
default:
|
||||
printf("Unknown sample format in %s.\n", filename);
|
||||
sf_close(file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
> /* Allocate buffers. */
|
||||
> buffer_short = (short *)malloc(file_info.samples *
|
||||
> file_info.channels *
|
||||
> sizeof (short));
|
||||
>
|
||||
> buffer_8 = (u_int8_t *)malloc(file_info.samples *
|
||||
> file_info.channels *
|
||||
> file_info.pcmbitwidth / 8);
|
||||
|
||||
Use pcmbitwidth as calculated above.
|
||||
|
||||
> buffer_16 = (int16_t *)buffer_8;
|
||||
>
|
||||
> if (buffer_short == NULL || buffer_8 == NULL) {
|
||||
> printf("Unable to allocate enough memory for '%s'.\n", filename);
|
||||
> goto error_cleanup;
|
||||
> }
|
||||
>
|
||||
> /* Read the entire sound file. */
|
||||
> if (sf_readf_short(file,buffer_short,file_info.samples) == (size_t)- 1) {
|
||||
|
||||
Replace "(size_t) - 1" with " < 0".
|
||||
|
||||
> As you can see, the PCM material in the listing will not currently
|
||||
> compile and for the other sndfile material, it probably won't either.
|
||||
|
||||
None of the changes above should have been very difficult to figure
|
||||
out.
|
||||
|
||||
Erik
|
||||
--
|
||||
+-----------------------------------------------------------+
|
||||
Erik de Castro Lopo nospam@fake-domain-name.com
|
||||
+-----------------------------------------------------------+
|
||||
Microsoft is finally bringing all of its Windows operating system families
|
||||
under one roof. It will combine all of the features of CE, stability and
|
||||
support of ME and the speed of NT.
|
||||
It will be called Windows CEMENT...
|
||||
|
@@ -15,21 +15,21 @@
|
||||
<BR>
|
||||
<H1><B>libsndfile and GNU Octave</B></H1>
|
||||
<P>
|
||||
<A HREF="http://www.octave.org/">GNU Octave</A> is a high-level interactive
|
||||
language for numerical computations.
|
||||
<A HREF="http://www.octave.org/">GNU Octave</A> is a high-level interactive
|
||||
language for numerical computations.
|
||||
There are currently two development streams, a stable 2.0.X series and a
|
||||
development 2.1.X series.
|
||||
Octave reads and writes data in binary formats that were originally developed
|
||||
for
|
||||
for
|
||||
<A HREF="http://www.mathworks.com/">MATLAB</A>.
|
||||
Version 2.0.X of Octave uses binary data files compatible with MATLAB
|
||||
version 4.2 while Octave 2.1.X uses binary data files compatible
|
||||
with MATLAB version 5.0 as well as being able to read the older MATLAB 4.2
|
||||
with MATLAB version 5.0 as well as being able to read the older MATLAB 4.2
|
||||
format.
|
||||
</P>
|
||||
<P>
|
||||
From version 1.0.1 of libsndfile onwards, libsndfile has the ability of reading
|
||||
and writing a small subset of the binary data files used by both versions
|
||||
From version 1.0.1 of libsndfile onwards, libsndfile has the ability of reading
|
||||
and writing a small subset of the binary data files used by both versions
|
||||
of GNU Octave.
|
||||
This gives people using GNU Octave for audio based work an easy method of
|
||||
moving audio data between GNU Octave and other programs which use libsndfile.
|
||||
@@ -37,22 +37,22 @@
|
||||
<P>
|
||||
For instance it is now possible to do the following:
|
||||
</P>
|
||||
|
||||
|
||||
<UL>
|
||||
<LI> Load a WAV file into a sound file editor such as
|
||||
<LI> Load a WAV file into a sound file editor such as
|
||||
<A HREF="http://www.metadecks.org/software/sweep/">Sweep</A>.
|
||||
<LI> Save it as a MAT4 file.
|
||||
<LI> Load the data into Octave for manipulation.
|
||||
<LI> Save the modified data.
|
||||
<LI> Save the modified data.
|
||||
<LI> Reload it in Sweep.
|
||||
</UL>
|
||||
<P>
|
||||
Another example would be using the MAT4 or MAT5 file formats as a format which
|
||||
can be easily loaded into Octave for viewing/analyzing as well as a format
|
||||
can be easily loaded into Octave for viewing/analyzing as well as a format
|
||||
which can be played with command line players such as the one included with
|
||||
libsndfile.
|
||||
</P>
|
||||
|
||||
|
||||
<H2><B>Details</B></H2>
|
||||
<P>
|
||||
Octave, like most programming languages, uses variables to store data, and
|
||||
@@ -70,7 +70,7 @@
|
||||
<PRE>
|
||||
octave:1 > samplerate = 44100 ;
|
||||
octave:2 > wavedata = sin ((0:1023)*2*pi/1024) ;
|
||||
octave:3 > save sine.mat samplerate wavedata
|
||||
octave:3 > save sine.mat samplerate wavedata
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
@@ -84,7 +84,7 @@
|
||||
<P>
|
||||
In addition, libsndfile contains a command line program which which is able
|
||||
to play the correct types of Octave files.
|
||||
Using this command line player <B>sndfile-play</B> and a third Octave script
|
||||
Using this command line player <B>sndfile-play</B> and a third Octave script
|
||||
file allows Octave data to be played from within Octave on any of the platforms
|
||||
which <B>sndfile-play</B> supports (at the moment: Linux, MacOS X, Solaris and
|
||||
Win32).
|
||||
@@ -100,8 +100,8 @@
|
||||
</P>
|
||||
|
||||
<P>
|
||||
There are some other Octave scripts for audio to be found
|
||||
<A HREF="http://octave.sourceforge.net/index/audio.html">here</A>.
|
||||
There are some other Octave scripts for audio to be found
|
||||
<A HREF="http://octave.sourceforge.net/audio/index.html">here</A>.
|
||||
</P>
|
||||
|
||||
<BR>
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
<HR>
|
||||
<P>
|
||||
The libsndfile home page is here :
|
||||
The libsndfile home page is here :
|
||||
<A HREF="http://www.mega-nerd.com/libsndfile/">
|
||||
http://www.mega-nerd.com/libsndfile/</A>.
|
||||
</P>
|
||||
|
@@ -1,71 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
libsndfile : pkg-config
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<LINK REL="stylesheet" HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
|
||||
<LINK REL="stylesheet" HREF="print.css" TYPE="text/css" MEDIA="print">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
|
||||
<BR>
|
||||
<H1>libsndfile and pkg-config</H1>
|
||||
|
||||
<P>
|
||||
From version 1.0.0 libsndfile has had the ability to read and write files of
|
||||
greater than 2 Gig in size on most OSes even if sizeof (long) == 4.
|
||||
OSes which support this feature include Linux (2.4 kernel, glibc6) on x86, PPC and
|
||||
probably others, Win32, MacOS X, *BSD, Solaris and probably others.
|
||||
OSes on 64 bit processors where the default compile environment is LP64 (longs and
|
||||
pointers are 64 bit ie Linux on DEC/Compaq/HP Alpha processors) automatically
|
||||
support large file access.
|
||||
</P>
|
||||
<P>
|
||||
Other OSes including Linux on 32 bit processors, 32 bit Solaris and others require
|
||||
special compiler flags to add large file support.
|
||||
This applies to both the compilation of the library itself and the compilation of
|
||||
programs which link to the library.
|
||||
</P>
|
||||
<P>
|
||||
Note : People using Win32, MacOS (both OS X and pre-OS X) or *BSD can disregard the
|
||||
rest of this document as it does not apply to either of these OSes.
|
||||
</P>
|
||||
<P>
|
||||
The <B>pkg-config</B> program makes finding the correct compiler flag values and
|
||||
library location far easier.
|
||||
During the installation of libsndfile, a file named <B>sndfile.pc</B> is installed
|
||||
in the directory <B>${libdir}/pkgconfig</B> (ie if libsndfile is installed in
|
||||
<B>/usr/local/lib</B>, <B>sndfile.pc</B> will be installed in
|
||||
<B>/usr/local/lib/pkgconfig/</B>).
|
||||
</P>
|
||||
<P>
|
||||
In order for pkg-config to find sndfile.pc it may be necessary to point the
|
||||
environment variable <B>PKG_CONFIG_PATH</B> in the right direction.
|
||||
</P>
|
||||
<PRE>
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Then, to compile a C file into an object file, the command would be:
|
||||
</P>
|
||||
<PRE>
|
||||
gcc `pkg-config --cflags sndfile` -c somefile.c
|
||||
</PRE>
|
||||
<P>
|
||||
and to link a number of objects into an executable that links against libsndfile,
|
||||
the command would be:
|
||||
</P>
|
||||
<PRE>
|
||||
gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Obviously all this can be rolled into a Makefile for easier maintenance.
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
14
lib-src/libsndfile/doc/print.css
Normal file
14
lib-src/libsndfile/doc/print.css
Normal file
@@ -0,0 +1,14 @@
|
||||
body {
|
||||
background:white;
|
||||
color:black;
|
||||
}
|
||||
|
||||
h1{
|
||||
background:white;
|
||||
color:black;
|
||||
}
|
||||
|
||||
h2 {
|
||||
background:white;
|
||||
color:#666;
|
||||
}
|
Reference in New Issue
Block a user