From 32c16669c4c2fab6a1a88dc9980cf9b158c4f061 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 5 Apr 2018 01:56:04 +0300 Subject: [PATCH] FS-11091: [mod_sndfile] Remove libsndfile from the code base, use pre-compiled binaries on Windows, update to libsndfile 1.0.28 --- Freeswitch.2015.sln | 14 - libs/.gitignore | 2 + libs/libsndfile/.update | 1 - libs/libsndfile/AUTHORS | 14 - libs/libsndfile/COPYING | 503 - libs/libsndfile/Cfg/.empty | 0 libs/libsndfile/ChangeLog | 9764 ----------------- libs/libsndfile/INSTALL | 182 - libs/libsndfile/M4/Makefile.am | 5 - libs/libsndfile/M4/add_cflags.m4 | 18 - libs/libsndfile/M4/add_cxxflags.m4 | 19 - libs/libsndfile/M4/clang.m4 | 31 - libs/libsndfile/M4/clip_mode.m4 | 124 - libs/libsndfile/M4/endian.m4 | 155 - libs/libsndfile/M4/extra_largefile.m4 | 114 - libs/libsndfile/M4/extra_pkg.m4 | 105 - libs/libsndfile/M4/flexible_array.m4 | 32 - libs/libsndfile/M4/gcc_version.m4 | 33 - libs/libsndfile/M4/llrint.m4 | 38 - libs/libsndfile/M4/lrint.m4 | 37 - libs/libsndfile/M4/lrintf.m4 | 37 - libs/libsndfile/M4/mkoctfile_version.m4 | 38 - libs/libsndfile/M4/octave.m4 | 143 - libs/libsndfile/M4/really_gcc.m4 | 33 - libs/libsndfile/M4/stack_protect.m4 | 73 - libs/libsndfile/Makefile.am | 46 - libs/libsndfile/Mingw-make-dist.sh | 116 - libs/libsndfile/NEWS | 175 - libs/libsndfile/Octave/Makefile.am | 79 - libs/libsndfile/Octave/PKG_ADD | 3 - libs/libsndfile/Octave/Readme.txt | 23 - libs/libsndfile/Octave/format.h | 21 - libs/libsndfile/Octave/octave_test.m | 52 - libs/libsndfile/Octave/octave_test.sh | 81 - libs/libsndfile/Octave/sndfile.cc | 405 - libs/libsndfile/Octave/sndfile_load.m | 52 - libs/libsndfile/Octave/sndfile_play.m | 59 - libs/libsndfile/Octave/sndfile_save.m | 53 - libs/libsndfile/README | 68 - libs/libsndfile/README.md | 79 - libs/libsndfile/Scripts/android-configure.sh | 92 - .../Scripts/build-test-tarball.mk.in | 61 - libs/libsndfile/Scripts/clang-sanitize.sh | 13 - libs/libsndfile/Scripts/cstyle.py | 246 - libs/libsndfile/Scripts/git-pre-commit-hook | 79 - .../Scripts/linux-to-win-cross-configure.sh | 22 - libs/libsndfile/TODO | 42 - libs/libsndfile/Win32/Makefile.am | 4 - .../Win32/README-precompiled-dll.txt | 40 - libs/libsndfile/Win32/testprog.c | 16 - libs/libsndfile/acinclude.m4 | 637 -- libs/libsndfile/autogen.sh | 179 - libs/libsndfile/binheader_readf_check.py | 62 - libs/libsndfile/configure.ac | 697 -- libs/libsndfile/configure.gnu | 4 - libs/libsndfile/doc/FAQ.html | 851 -- libs/libsndfile/doc/Makefile.am | 9 - libs/libsndfile/doc/api.html | 781 -- libs/libsndfile/doc/bugs.html | 76 - libs/libsndfile/doc/command.html | 1687 --- libs/libsndfile/doc/development.html | 43 - libs/libsndfile/doc/dither.html | 1017 -- libs/libsndfile/doc/donate.html | 112 - libs/libsndfile/doc/embedded_files.html | 47 - libs/libsndfile/doc/index.html | 493 - libs/libsndfile/doc/libsndfile.css.in | 92 - .../doc/linux_games_programming.txt | 434 - libs/libsndfile/doc/lists.html | 52 - libs/libsndfile/doc/new_file_type.HOWTO | 135 - libs/libsndfile/doc/octave.html | 118 - libs/libsndfile/doc/pkgconfig.html | 71 - libs/libsndfile/doc/print.css | 14 - libs/libsndfile/doc/sndfile_info.html | 53 - libs/libsndfile/doc/tutorial.html | 34 - libs/libsndfile/doc/win32.html | 53 - libs/libsndfile/echo-install-dirs.in | 25 - libs/libsndfile/examples/Makefile.am | 25 - libs/libsndfile/examples/cooledit-fixer.c | 231 - libs/libsndfile/examples/generate.c | 133 - libs/libsndfile/examples/generate.cs | 250 - libs/libsndfile/examples/list_formats.c | 83 - libs/libsndfile/examples/make_sine.c | 96 - libs/libsndfile/examples/sfprocess.c | 142 - libs/libsndfile/examples/sndfile-convert.c | 376 - libs/libsndfile/examples/sndfile-info.c | 354 - .../libsndfile/examples/sndfile-play-beos.cpp | 153 - libs/libsndfile/examples/sndfile-play.c | 960 -- libs/libsndfile/examples/sndfile-to-text.c | 128 - libs/libsndfile/examples/sndfilehandle.cc | 84 - libs/libsndfile/libsndfile.spec.in | 69 - libs/libsndfile/make_lite.py | 491 - libs/libsndfile/man/Makefile.am | 15 - libs/libsndfile/man/sndfile-cmp.1 | 16 - libs/libsndfile/man/sndfile-concat.1 | 16 - libs/libsndfile/man/sndfile-convert.1 | 22 - libs/libsndfile/man/sndfile-info.1 | 16 - libs/libsndfile/man/sndfile-interleave.1 | 23 - libs/libsndfile/man/sndfile-metadata-get.1 | 26 - libs/libsndfile/man/sndfile-play.1 | 36 - libs/libsndfile/programs/Makefile.am | 47 - libs/libsndfile/programs/common.c | 466 - libs/libsndfile/programs/common.h | 78 - libs/libsndfile/programs/sndfile-cmp.c | 165 - libs/libsndfile/programs/sndfile-concat.c | 169 - libs/libsndfile/programs/sndfile-convert.c | 377 - .../programs/sndfile-deinterleave.c | 194 - libs/libsndfile/programs/sndfile-info.c | 529 - libs/libsndfile/programs/sndfile-interleave.c | 202 - libs/libsndfile/programs/sndfile-jackplay.c | 277 - .../programs/sndfile-metadata-get.c | 176 - .../programs/sndfile-metadata-set.c | 284 - .../libsndfile/programs/sndfile-play-beos.cpp | 144 - libs/libsndfile/programs/sndfile-play.c | 1211 -- libs/libsndfile/programs/sndfile-salvage.c | 277 - .../programs/test-sndfile-metadata-set.py | 188 - libs/libsndfile/reconfigure.mk | 63 - libs/libsndfile/regtest/Makefile.am | 12 - libs/libsndfile/regtest/Readme.txt | 108 - libs/libsndfile/regtest/checksum.c | 117 - libs/libsndfile/regtest/database.c | 495 - libs/libsndfile/regtest/regtest.h | 38 - libs/libsndfile/regtest/sndfile-regtest.c | 121 - libs/libsndfile/sndfile.pc.in | 12 - libs/libsndfile/src/ALAC/ALACAudioTypes.h | 200 - libs/libsndfile/src/ALAC/ALACBitUtilities.c | 262 - libs/libsndfile/src/ALAC/ALACBitUtilities.h | 91 - libs/libsndfile/src/ALAC/ALACDecoder.h | 61 - libs/libsndfile/src/ALAC/ALACEncoder.h | 92 - libs/libsndfile/src/ALAC/EndianPortable.h | 39 - libs/libsndfile/src/ALAC/LICENSE | 170 - libs/libsndfile/src/ALAC/ag_dec.c | 355 - libs/libsndfile/src/ALAC/ag_enc.c | 360 - libs/libsndfile/src/ALAC/aglib.h | 81 - libs/libsndfile/src/ALAC/alac_codec.h | 103 - libs/libsndfile/src/ALAC/alac_decoder.c | 646 -- libs/libsndfile/src/ALAC/alac_decoder.h | 61 - libs/libsndfile/src/ALAC/alac_encoder.c | 1342 --- libs/libsndfile/src/ALAC/dp_dec.c | 375 - libs/libsndfile/src/ALAC/dp_enc.c | 380 - libs/libsndfile/src/ALAC/dplib.h | 61 - libs/libsndfile/src/ALAC/matrix_dec.c | 320 - libs/libsndfile/src/ALAC/matrix_enc.c | 272 - libs/libsndfile/src/ALAC/matrixlib.h | 81 - libs/libsndfile/src/G72x/ChangeLog | 50 - libs/libsndfile/src/G72x/Makefile.am | 22 - libs/libsndfile/src/G72x/README | 0 libs/libsndfile/src/G72x/README.original | 94 - libs/libsndfile/src/G72x/g721.c | 155 - libs/libsndfile/src/G72x/g723_16.c | 162 - libs/libsndfile/src/G72x/g723_24.c | 139 - libs/libsndfile/src/G72x/g723_40.c | 153 - libs/libsndfile/src/G72x/g72x.c | 644 -- libs/libsndfile/src/G72x/g72x.h | 91 - libs/libsndfile/src/G72x/g72x_priv.h | 109 - libs/libsndfile/src/G72x/g72x_test.c | 214 - libs/libsndfile/src/GSM610/COPYRIGHT | 16 - libs/libsndfile/src/GSM610/ChangeLog | 56 - libs/libsndfile/src/GSM610/Makefile.am | 16 - libs/libsndfile/src/GSM610/README | 36 - libs/libsndfile/src/GSM610/add.c | 240 - libs/libsndfile/src/GSM610/code.c | 87 - libs/libsndfile/src/GSM610/config.h | 26 - libs/libsndfile/src/GSM610/decode.c | 59 - libs/libsndfile/src/GSM610/gsm.h | 52 - libs/libsndfile/src/GSM610/gsm610_priv.h | 301 - libs/libsndfile/src/GSM610/gsm_create.c | 37 - libs/libsndfile/src/GSM610/gsm_decode.c | 359 - libs/libsndfile/src/GSM610/gsm_destroy.c | 24 - libs/libsndfile/src/GSM610/gsm_encode.c | 449 - libs/libsndfile/src/GSM610/gsm_option.c | 66 - libs/libsndfile/src/GSM610/long_term.c | 959 -- libs/libsndfile/src/GSM610/lpc.c | 331 - libs/libsndfile/src/GSM610/preprocess.c | 105 - libs/libsndfile/src/GSM610/rpe.c | 480 - libs/libsndfile/src/GSM610/short_term.c | 417 - libs/libsndfile/src/GSM610/table.c | 60 - libs/libsndfile/src/Makefile.am | 134 - libs/libsndfile/src/Symbols.darwin | 37 - libs/libsndfile/src/Symbols.linux | 42 - libs/libsndfile/src/Symbols.os2 | 43 - libs/libsndfile/src/aiff.c | 1778 --- libs/libsndfile/src/alac.c | 964 -- libs/libsndfile/src/alaw.c | 548 - libs/libsndfile/src/au.c | 450 - libs/libsndfile/src/audio_detect.c | 105 - libs/libsndfile/src/avr.c | 246 - libs/libsndfile/src/binheader_writef_check.py | 117 - libs/libsndfile/src/broadcast.c | 191 - libs/libsndfile/src/caf.c | 804 -- libs/libsndfile/src/cart.c | 101 - libs/libsndfile/src/chanmap.c | 262 - libs/libsndfile/src/chanmap.h | 32 - libs/libsndfile/src/chunk.c | 255 - libs/libsndfile/src/command.c | 390 - libs/libsndfile/src/common.c | 1662 --- libs/libsndfile/src/common.h | 1044 -- libs/libsndfile/src/create_symbols_file.py | 182 - libs/libsndfile/src/cygsndfile.def | 39 - libs/libsndfile/src/dither.c | 534 - libs/libsndfile/src/double64.c | 1058 -- libs/libsndfile/src/dwd.c | 201 - libs/libsndfile/src/dwvw.c | 674 -- libs/libsndfile/src/file_io.c | 1550 --- libs/libsndfile/src/flac.c | 1385 --- libs/libsndfile/src/float32.c | 1012 -- libs/libsndfile/src/float_cast.h | 273 - libs/libsndfile/src/g72x.c | 608 - libs/libsndfile/src/gsm610.c | 627 -- libs/libsndfile/src/htk.c | 226 - libs/libsndfile/src/id3.c | 57 - libs/libsndfile/src/ima_adpcm.c | 948 -- libs/libsndfile/src/ima_oki_adpcm.c | 297 - libs/libsndfile/src/ima_oki_adpcm.h | 54 - libs/libsndfile/src/interleave.c | 299 - libs/libsndfile/src/ircam.c | 323 - libs/libsndfile/src/libsndfile-1.def | 41 - libs/libsndfile/src/libsndfile.def | 39 - libs/libsndfile/src/macbinary3.c | 45 - libs/libsndfile/src/macos.c | 51 - .../src/make-static-lib-hidden-privates.sh | 14 - libs/libsndfile/src/mat4.c | 390 - libs/libsndfile/src/mat5.c | 509 - libs/libsndfile/src/mpc2k.c | 204 - libs/libsndfile/src/ms_adpcm.c | 836 -- libs/libsndfile/src/new.c | 116 - libs/libsndfile/src/nist.c | 375 - libs/libsndfile/src/ogg.c | 253 - libs/libsndfile/src/ogg.h | 52 - libs/libsndfile/src/ogg_opus.c | 149 - libs/libsndfile/src/ogg_pcm.c | 164 - libs/libsndfile/src/ogg_speex.c | 425 - libs/libsndfile/src/ogg_vorbis.c | 1172 -- libs/libsndfile/src/paf.c | 819 -- libs/libsndfile/src/pcm.c | 2961 ----- libs/libsndfile/src/pvf.c | 188 - libs/libsndfile/src/raw.c | 104 - libs/libsndfile/src/rf64.c | 726 -- libs/libsndfile/src/rx2.c | 318 - libs/libsndfile/src/sd2.c | 654 -- libs/libsndfile/src/sds.c | 1022 -- libs/libsndfile/src/sf_unistd.h | 63 - libs/libsndfile/src/sfconfig.h | 115 - libs/libsndfile/src/sfendian.h | 296 - libs/libsndfile/src/sndfile.c | 3093 ------ libs/libsndfile/src/sndfile.h.in | 824 -- libs/libsndfile/src/sndfile.hh | 446 - libs/libsndfile/src/strings.c | 222 - libs/libsndfile/src/svx.c | 416 - libs/libsndfile/src/test_audio_detect.c | 111 - libs/libsndfile/src/test_broadcast_var.c | 119 - libs/libsndfile/src/test_cart_var.c | 91 - libs/libsndfile/src/test_conversions.c | 110 - libs/libsndfile/src/test_endswap.c | 235 - libs/libsndfile/src/test_endswap.def | 40 - libs/libsndfile/src/test_endswap.tpl | 151 - libs/libsndfile/src/test_file_io.c | 438 - libs/libsndfile/src/test_float.c | 104 - libs/libsndfile/src/test_ima_oki_adpcm.c | 157 - libs/libsndfile/src/test_log_printf.c | 123 - libs/libsndfile/src/test_main.c | 49 - libs/libsndfile/src/test_main.h | 41 - libs/libsndfile/src/test_strncpy_crlf.c | 56 - libs/libsndfile/src/txw.c | 377 - libs/libsndfile/src/ulaw.c | 1051 -- libs/libsndfile/src/version-metadata.rc.in | 32 - libs/libsndfile/src/voc.c | 882 -- libs/libsndfile/src/vox_adpcm.c | 400 - libs/libsndfile/src/w64.c | 639 -- libs/libsndfile/src/wav.c | 2048 ---- libs/libsndfile/src/wav_w64.c | 678 -- libs/libsndfile/src/wav_w64.h | 298 - libs/libsndfile/src/windows.c | 93 - libs/libsndfile/src/wve.c | 209 - libs/libsndfile/src/xi.c | 1230 --- libs/libsndfile/tests/Makefile.am | 218 - libs/libsndfile/tests/aiff_rw_test.c | 164 - libs/libsndfile/tests/alaw_test.c | 236 - libs/libsndfile/tests/benchmark-0.0.28 | 40 - libs/libsndfile/tests/benchmark-1.0.0 | 35 - libs/libsndfile/tests/benchmark-1.0.0rc2 | 31 - .../tests/benchmark-1.0.18pre16-hendrix | 38 - .../tests/benchmark-1.0.18pre16-mingus | 38 - .../tests/benchmark-1.0.6pre10-coltrane | 39 - .../tests/benchmark-1.0.6pre10-miles | 39 - .../tests/benchmark-latest-coltrane | 75 - libs/libsndfile/tests/benchmark.c | 545 - libs/libsndfile/tests/benchmark.def | 17 - libs/libsndfile/tests/benchmark.tpl | 360 - libs/libsndfile/tests/channel_test.c | 134 - libs/libsndfile/tests/checksum_test.c | 128 - libs/libsndfile/tests/chunk_test.c | 293 - libs/libsndfile/tests/command_test.c | 1570 --- libs/libsndfile/tests/compression_size_test.c | 205 - libs/libsndfile/tests/cpp_test.cc | 313 - libs/libsndfile/tests/dft_cmp.c | 149 - libs/libsndfile/tests/dft_cmp.h | 25 - libs/libsndfile/tests/dither_test.c | 180 - libs/libsndfile/tests/dwvw_test.c | 109 - libs/libsndfile/tests/error_test.c | 246 - libs/libsndfile/tests/external_libs_test.c | 149 - libs/libsndfile/tests/fix_this.c | 328 - libs/libsndfile/tests/floating_point_test.c | 694 -- libs/libsndfile/tests/floating_point_test.def | 32 - libs/libsndfile/tests/floating_point_test.tpl | 355 - libs/libsndfile/tests/format_check_test.c | 149 - libs/libsndfile/tests/generate.c | 73 - libs/libsndfile/tests/generate.h | 19 - libs/libsndfile/tests/header_test.c | 741 -- libs/libsndfile/tests/header_test.def | 22 - libs/libsndfile/tests/header_test.tpl | 543 - libs/libsndfile/tests/headerless_test.c | 185 - libs/libsndfile/tests/largefile_test.c | 83 - libs/libsndfile/tests/locale_test.c | 167 - libs/libsndfile/tests/lossy_comp_test.c | 2372 ---- libs/libsndfile/tests/misc_test.c | 415 - libs/libsndfile/tests/multi_file_test.c | 238 - libs/libsndfile/tests/ogg_test.c | 344 - libs/libsndfile/tests/open_fail_test.c | 81 - libs/libsndfile/tests/pcm_test.c | 1723 --- libs/libsndfile/tests/pcm_test.def | 34 - libs/libsndfile/tests/pcm_test.tpl | 931 -- libs/libsndfile/tests/peak_chunk_test.c | 362 - .../tests/pedantic-header-test.sh.in | 58 - libs/libsndfile/tests/pipe_test.c | 525 - libs/libsndfile/tests/pipe_test.def | 14 - libs/libsndfile/tests/pipe_test.tpl | 374 - libs/libsndfile/tests/raw_test.c | 187 - libs/libsndfile/tests/rdwr_test.def | 32 - libs/libsndfile/tests/rdwr_test.tpl | 105 - libs/libsndfile/tests/scale_clip_test.c | 1853 ---- libs/libsndfile/tests/scale_clip_test.def | 56 - libs/libsndfile/tests/scale_clip_test.tpl | 438 - libs/libsndfile/tests/sftest.c | 65 - libs/libsndfile/tests/sfversion.c | 45 - libs/libsndfile/tests/stdin_test.c | 204 - libs/libsndfile/tests/stdio_test.c | 153 - libs/libsndfile/tests/stdout_test.c | 161 - libs/libsndfile/tests/string_test.c | 795 -- libs/libsndfile/tests/test_wrapper.sh.in | 365 - libs/libsndfile/tests/ulaw_test.c | 257 - libs/libsndfile/tests/utils.c | 1162 -- libs/libsndfile/tests/utils.def | 52 - libs/libsndfile/tests/utils.h | 183 - libs/libsndfile/tests/utils.tpl | 897 -- libs/libsndfile/tests/virtual_io_test.c | 237 - libs/libsndfile/tests/vorbis_test.c | 176 - libs/libsndfile/tests/win32_ordinal_test.c | 145 - libs/libsndfile/tests/win32_test.c | 318 - libs/libsndfile/tests/write_read_test.c | 3731 ------- libs/libsndfile/tests/write_read_test.def | 75 - libs/libsndfile/tests/write_read_test.tpl | 1184 -- libs/win32/libsndfile/cleancount | 1 - libs/win32/libsndfile/config.h | 294 - .../libsndfile.2010.vcxproj.filters | 285 - libs/win32/libsndfile/libsndfile.2015.vcxproj | 222 - libs/win32/libsndfile/sndfile.h | 817 -- .../mod_sndfile/mod_sndfile.2015.vcxproj | 13 +- w32/libsndfile-version.props | 19 + w32/libsndfile.props | 78 + 359 files changed, 100 insertions(+), 119233 deletions(-) delete mode 100644 libs/libsndfile/.update delete mode 100644 libs/libsndfile/AUTHORS delete mode 100644 libs/libsndfile/COPYING delete mode 100644 libs/libsndfile/Cfg/.empty delete mode 100644 libs/libsndfile/ChangeLog delete mode 100644 libs/libsndfile/INSTALL delete mode 100644 libs/libsndfile/M4/Makefile.am delete mode 100644 libs/libsndfile/M4/add_cflags.m4 delete mode 100644 libs/libsndfile/M4/add_cxxflags.m4 delete mode 100644 libs/libsndfile/M4/clang.m4 delete mode 100644 libs/libsndfile/M4/clip_mode.m4 delete mode 100644 libs/libsndfile/M4/endian.m4 delete mode 100644 libs/libsndfile/M4/extra_largefile.m4 delete mode 100644 libs/libsndfile/M4/extra_pkg.m4 delete mode 100644 libs/libsndfile/M4/flexible_array.m4 delete mode 100644 libs/libsndfile/M4/gcc_version.m4 delete mode 100644 libs/libsndfile/M4/llrint.m4 delete mode 100644 libs/libsndfile/M4/lrint.m4 delete mode 100644 libs/libsndfile/M4/lrintf.m4 delete mode 100644 libs/libsndfile/M4/mkoctfile_version.m4 delete mode 100644 libs/libsndfile/M4/octave.m4 delete mode 100644 libs/libsndfile/M4/really_gcc.m4 delete mode 100644 libs/libsndfile/M4/stack_protect.m4 delete mode 100644 libs/libsndfile/Makefile.am delete mode 100755 libs/libsndfile/Mingw-make-dist.sh delete mode 100644 libs/libsndfile/NEWS delete mode 100644 libs/libsndfile/Octave/Makefile.am delete mode 100644 libs/libsndfile/Octave/PKG_ADD delete mode 100644 libs/libsndfile/Octave/Readme.txt delete mode 100644 libs/libsndfile/Octave/format.h delete mode 100644 libs/libsndfile/Octave/octave_test.m delete mode 100755 libs/libsndfile/Octave/octave_test.sh delete mode 100644 libs/libsndfile/Octave/sndfile.cc delete mode 100644 libs/libsndfile/Octave/sndfile_load.m delete mode 100644 libs/libsndfile/Octave/sndfile_play.m delete mode 100644 libs/libsndfile/Octave/sndfile_save.m delete mode 100644 libs/libsndfile/README delete mode 100644 libs/libsndfile/README.md delete mode 100644 libs/libsndfile/Scripts/android-configure.sh delete mode 100644 libs/libsndfile/Scripts/build-test-tarball.mk.in delete mode 100644 libs/libsndfile/Scripts/clang-sanitize.sh delete mode 100644 libs/libsndfile/Scripts/cstyle.py delete mode 100644 libs/libsndfile/Scripts/git-pre-commit-hook delete mode 100644 libs/libsndfile/Scripts/linux-to-win-cross-configure.sh delete mode 100644 libs/libsndfile/TODO delete mode 100644 libs/libsndfile/Win32/Makefile.am delete mode 100644 libs/libsndfile/Win32/README-precompiled-dll.txt delete mode 100644 libs/libsndfile/Win32/testprog.c delete mode 100644 libs/libsndfile/acinclude.m4 delete mode 100644 libs/libsndfile/autogen.sh delete mode 100644 libs/libsndfile/binheader_readf_check.py delete mode 100644 libs/libsndfile/configure.ac delete mode 100644 libs/libsndfile/configure.gnu delete mode 100644 libs/libsndfile/doc/FAQ.html delete mode 100644 libs/libsndfile/doc/Makefile.am delete mode 100644 libs/libsndfile/doc/api.html delete mode 100644 libs/libsndfile/doc/bugs.html delete mode 100644 libs/libsndfile/doc/command.html delete mode 100644 libs/libsndfile/doc/development.html delete mode 100644 libs/libsndfile/doc/dither.html delete mode 100644 libs/libsndfile/doc/donate.html delete mode 100644 libs/libsndfile/doc/embedded_files.html delete mode 100644 libs/libsndfile/doc/index.html delete mode 100644 libs/libsndfile/doc/libsndfile.css.in delete mode 100644 libs/libsndfile/doc/linux_games_programming.txt delete mode 100644 libs/libsndfile/doc/lists.html delete mode 100644 libs/libsndfile/doc/new_file_type.HOWTO delete mode 100644 libs/libsndfile/doc/octave.html delete mode 100644 libs/libsndfile/doc/pkgconfig.html delete mode 100644 libs/libsndfile/doc/print.css delete mode 100644 libs/libsndfile/doc/sndfile_info.html delete mode 100644 libs/libsndfile/doc/tutorial.html delete mode 100644 libs/libsndfile/doc/win32.html delete mode 100644 libs/libsndfile/echo-install-dirs.in delete mode 100644 libs/libsndfile/examples/Makefile.am delete mode 100644 libs/libsndfile/examples/cooledit-fixer.c delete mode 100644 libs/libsndfile/examples/generate.c delete mode 100644 libs/libsndfile/examples/generate.cs delete mode 100644 libs/libsndfile/examples/list_formats.c delete mode 100644 libs/libsndfile/examples/make_sine.c delete mode 100644 libs/libsndfile/examples/sfprocess.c delete mode 100644 libs/libsndfile/examples/sndfile-convert.c delete mode 100644 libs/libsndfile/examples/sndfile-info.c delete mode 100644 libs/libsndfile/examples/sndfile-play-beos.cpp delete mode 100644 libs/libsndfile/examples/sndfile-play.c delete mode 100644 libs/libsndfile/examples/sndfile-to-text.c delete mode 100644 libs/libsndfile/examples/sndfilehandle.cc delete mode 100644 libs/libsndfile/libsndfile.spec.in delete mode 100644 libs/libsndfile/make_lite.py delete mode 100644 libs/libsndfile/man/Makefile.am delete mode 100644 libs/libsndfile/man/sndfile-cmp.1 delete mode 100644 libs/libsndfile/man/sndfile-concat.1 delete mode 100644 libs/libsndfile/man/sndfile-convert.1 delete mode 100644 libs/libsndfile/man/sndfile-info.1 delete mode 100644 libs/libsndfile/man/sndfile-interleave.1 delete mode 100644 libs/libsndfile/man/sndfile-metadata-get.1 delete mode 100644 libs/libsndfile/man/sndfile-play.1 delete mode 100644 libs/libsndfile/programs/Makefile.am delete mode 100644 libs/libsndfile/programs/common.c delete mode 100644 libs/libsndfile/programs/common.h delete mode 100644 libs/libsndfile/programs/sndfile-cmp.c delete mode 100644 libs/libsndfile/programs/sndfile-concat.c delete mode 100644 libs/libsndfile/programs/sndfile-convert.c delete mode 100644 libs/libsndfile/programs/sndfile-deinterleave.c delete mode 100644 libs/libsndfile/programs/sndfile-info.c delete mode 100644 libs/libsndfile/programs/sndfile-interleave.c delete mode 100644 libs/libsndfile/programs/sndfile-jackplay.c delete mode 100644 libs/libsndfile/programs/sndfile-metadata-get.c delete mode 100644 libs/libsndfile/programs/sndfile-metadata-set.c delete mode 100644 libs/libsndfile/programs/sndfile-play-beos.cpp delete mode 100644 libs/libsndfile/programs/sndfile-play.c delete mode 100644 libs/libsndfile/programs/sndfile-salvage.c delete mode 100644 libs/libsndfile/programs/test-sndfile-metadata-set.py delete mode 100644 libs/libsndfile/reconfigure.mk delete mode 100644 libs/libsndfile/regtest/Makefile.am delete mode 100644 libs/libsndfile/regtest/Readme.txt delete mode 100644 libs/libsndfile/regtest/checksum.c delete mode 100644 libs/libsndfile/regtest/database.c delete mode 100644 libs/libsndfile/regtest/regtest.h delete mode 100644 libs/libsndfile/regtest/sndfile-regtest.c delete mode 100644 libs/libsndfile/sndfile.pc.in delete mode 100644 libs/libsndfile/src/ALAC/ALACAudioTypes.h delete mode 100644 libs/libsndfile/src/ALAC/ALACBitUtilities.c delete mode 100644 libs/libsndfile/src/ALAC/ALACBitUtilities.h delete mode 100644 libs/libsndfile/src/ALAC/ALACDecoder.h delete mode 100644 libs/libsndfile/src/ALAC/ALACEncoder.h delete mode 100644 libs/libsndfile/src/ALAC/EndianPortable.h delete mode 100644 libs/libsndfile/src/ALAC/LICENSE delete mode 100644 libs/libsndfile/src/ALAC/ag_dec.c delete mode 100644 libs/libsndfile/src/ALAC/ag_enc.c delete mode 100644 libs/libsndfile/src/ALAC/aglib.h delete mode 100644 libs/libsndfile/src/ALAC/alac_codec.h delete mode 100644 libs/libsndfile/src/ALAC/alac_decoder.c delete mode 100644 libs/libsndfile/src/ALAC/alac_decoder.h delete mode 100644 libs/libsndfile/src/ALAC/alac_encoder.c delete mode 100644 libs/libsndfile/src/ALAC/dp_dec.c delete mode 100644 libs/libsndfile/src/ALAC/dp_enc.c delete mode 100644 libs/libsndfile/src/ALAC/dplib.h delete mode 100644 libs/libsndfile/src/ALAC/matrix_dec.c delete mode 100644 libs/libsndfile/src/ALAC/matrix_enc.c delete mode 100644 libs/libsndfile/src/ALAC/matrixlib.h delete mode 100644 libs/libsndfile/src/G72x/ChangeLog delete mode 100644 libs/libsndfile/src/G72x/Makefile.am delete mode 100644 libs/libsndfile/src/G72x/README delete mode 100644 libs/libsndfile/src/G72x/README.original delete mode 100644 libs/libsndfile/src/G72x/g721.c delete mode 100644 libs/libsndfile/src/G72x/g723_16.c delete mode 100644 libs/libsndfile/src/G72x/g723_24.c delete mode 100644 libs/libsndfile/src/G72x/g723_40.c delete mode 100644 libs/libsndfile/src/G72x/g72x.c delete mode 100644 libs/libsndfile/src/G72x/g72x.h delete mode 100644 libs/libsndfile/src/G72x/g72x_priv.h delete mode 100644 libs/libsndfile/src/G72x/g72x_test.c delete mode 100644 libs/libsndfile/src/GSM610/COPYRIGHT delete mode 100644 libs/libsndfile/src/GSM610/ChangeLog delete mode 100644 libs/libsndfile/src/GSM610/Makefile.am delete mode 100644 libs/libsndfile/src/GSM610/README delete mode 100644 libs/libsndfile/src/GSM610/add.c delete mode 100644 libs/libsndfile/src/GSM610/code.c delete mode 100644 libs/libsndfile/src/GSM610/config.h delete mode 100644 libs/libsndfile/src/GSM610/decode.c delete mode 100644 libs/libsndfile/src/GSM610/gsm.h delete mode 100644 libs/libsndfile/src/GSM610/gsm610_priv.h delete mode 100644 libs/libsndfile/src/GSM610/gsm_create.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_decode.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_destroy.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_encode.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_option.c delete mode 100644 libs/libsndfile/src/GSM610/long_term.c delete mode 100644 libs/libsndfile/src/GSM610/lpc.c delete mode 100644 libs/libsndfile/src/GSM610/preprocess.c delete mode 100644 libs/libsndfile/src/GSM610/rpe.c delete mode 100644 libs/libsndfile/src/GSM610/short_term.c delete mode 100644 libs/libsndfile/src/GSM610/table.c delete mode 100644 libs/libsndfile/src/Makefile.am delete mode 100644 libs/libsndfile/src/Symbols.darwin delete mode 100644 libs/libsndfile/src/Symbols.linux delete mode 100644 libs/libsndfile/src/Symbols.os2 delete mode 100644 libs/libsndfile/src/aiff.c delete mode 100644 libs/libsndfile/src/alac.c delete mode 100644 libs/libsndfile/src/alaw.c delete mode 100644 libs/libsndfile/src/au.c delete mode 100644 libs/libsndfile/src/audio_detect.c delete mode 100644 libs/libsndfile/src/avr.c delete mode 100644 libs/libsndfile/src/binheader_writef_check.py delete mode 100644 libs/libsndfile/src/broadcast.c delete mode 100644 libs/libsndfile/src/caf.c delete mode 100644 libs/libsndfile/src/cart.c delete mode 100644 libs/libsndfile/src/chanmap.c delete mode 100644 libs/libsndfile/src/chanmap.h delete mode 100644 libs/libsndfile/src/chunk.c delete mode 100644 libs/libsndfile/src/command.c delete mode 100644 libs/libsndfile/src/common.c delete mode 100644 libs/libsndfile/src/common.h delete mode 100755 libs/libsndfile/src/create_symbols_file.py delete mode 100644 libs/libsndfile/src/cygsndfile.def delete mode 100644 libs/libsndfile/src/dither.c delete mode 100644 libs/libsndfile/src/double64.c delete mode 100644 libs/libsndfile/src/dwd.c delete mode 100644 libs/libsndfile/src/dwvw.c delete mode 100644 libs/libsndfile/src/file_io.c delete mode 100644 libs/libsndfile/src/flac.c delete mode 100644 libs/libsndfile/src/float32.c delete mode 100644 libs/libsndfile/src/float_cast.h delete mode 100644 libs/libsndfile/src/g72x.c delete mode 100644 libs/libsndfile/src/gsm610.c delete mode 100644 libs/libsndfile/src/htk.c delete mode 100644 libs/libsndfile/src/id3.c delete mode 100644 libs/libsndfile/src/ima_adpcm.c delete mode 100644 libs/libsndfile/src/ima_oki_adpcm.c delete mode 100644 libs/libsndfile/src/ima_oki_adpcm.h delete mode 100644 libs/libsndfile/src/interleave.c delete mode 100644 libs/libsndfile/src/ircam.c delete mode 100644 libs/libsndfile/src/libsndfile-1.def delete mode 100644 libs/libsndfile/src/libsndfile.def delete mode 100644 libs/libsndfile/src/macbinary3.c delete mode 100644 libs/libsndfile/src/macos.c delete mode 100644 libs/libsndfile/src/make-static-lib-hidden-privates.sh delete mode 100644 libs/libsndfile/src/mat4.c delete mode 100644 libs/libsndfile/src/mat5.c delete mode 100644 libs/libsndfile/src/mpc2k.c delete mode 100644 libs/libsndfile/src/ms_adpcm.c delete mode 100644 libs/libsndfile/src/new.c delete mode 100644 libs/libsndfile/src/nist.c delete mode 100644 libs/libsndfile/src/ogg.c delete mode 100644 libs/libsndfile/src/ogg.h delete mode 100644 libs/libsndfile/src/ogg_opus.c delete mode 100644 libs/libsndfile/src/ogg_pcm.c delete mode 100644 libs/libsndfile/src/ogg_speex.c delete mode 100644 libs/libsndfile/src/ogg_vorbis.c delete mode 100644 libs/libsndfile/src/paf.c delete mode 100644 libs/libsndfile/src/pcm.c delete mode 100644 libs/libsndfile/src/pvf.c delete mode 100644 libs/libsndfile/src/raw.c delete mode 100644 libs/libsndfile/src/rf64.c delete mode 100644 libs/libsndfile/src/rx2.c delete mode 100644 libs/libsndfile/src/sd2.c delete mode 100644 libs/libsndfile/src/sds.c delete mode 100644 libs/libsndfile/src/sf_unistd.h delete mode 100644 libs/libsndfile/src/sfconfig.h delete mode 100644 libs/libsndfile/src/sfendian.h delete mode 100644 libs/libsndfile/src/sndfile.c delete mode 100644 libs/libsndfile/src/sndfile.h.in delete mode 100644 libs/libsndfile/src/sndfile.hh delete mode 100644 libs/libsndfile/src/strings.c delete mode 100644 libs/libsndfile/src/svx.c delete mode 100644 libs/libsndfile/src/test_audio_detect.c delete mode 100644 libs/libsndfile/src/test_broadcast_var.c delete mode 100644 libs/libsndfile/src/test_cart_var.c delete mode 100644 libs/libsndfile/src/test_conversions.c delete mode 100644 libs/libsndfile/src/test_endswap.c delete mode 100644 libs/libsndfile/src/test_endswap.def delete mode 100644 libs/libsndfile/src/test_endswap.tpl delete mode 100644 libs/libsndfile/src/test_file_io.c delete mode 100644 libs/libsndfile/src/test_float.c delete mode 100644 libs/libsndfile/src/test_ima_oki_adpcm.c delete mode 100644 libs/libsndfile/src/test_log_printf.c delete mode 100644 libs/libsndfile/src/test_main.c delete mode 100644 libs/libsndfile/src/test_main.h delete mode 100644 libs/libsndfile/src/test_strncpy_crlf.c delete mode 100644 libs/libsndfile/src/txw.c delete mode 100644 libs/libsndfile/src/ulaw.c delete mode 100644 libs/libsndfile/src/version-metadata.rc.in delete mode 100644 libs/libsndfile/src/voc.c delete mode 100644 libs/libsndfile/src/vox_adpcm.c delete mode 100644 libs/libsndfile/src/w64.c delete mode 100644 libs/libsndfile/src/wav.c delete mode 100644 libs/libsndfile/src/wav_w64.c delete mode 100644 libs/libsndfile/src/wav_w64.h delete mode 100644 libs/libsndfile/src/windows.c delete mode 100644 libs/libsndfile/src/wve.c delete mode 100644 libs/libsndfile/src/xi.c delete mode 100644 libs/libsndfile/tests/Makefile.am delete mode 100644 libs/libsndfile/tests/aiff_rw_test.c delete mode 100644 libs/libsndfile/tests/alaw_test.c delete mode 100644 libs/libsndfile/tests/benchmark-0.0.28 delete mode 100644 libs/libsndfile/tests/benchmark-1.0.0 delete mode 100644 libs/libsndfile/tests/benchmark-1.0.0rc2 delete mode 100644 libs/libsndfile/tests/benchmark-1.0.18pre16-hendrix delete mode 100644 libs/libsndfile/tests/benchmark-1.0.18pre16-mingus delete mode 100644 libs/libsndfile/tests/benchmark-1.0.6pre10-coltrane delete mode 100644 libs/libsndfile/tests/benchmark-1.0.6pre10-miles delete mode 100644 libs/libsndfile/tests/benchmark-latest-coltrane delete mode 100644 libs/libsndfile/tests/benchmark.c delete mode 100644 libs/libsndfile/tests/benchmark.def delete mode 100644 libs/libsndfile/tests/benchmark.tpl delete mode 100644 libs/libsndfile/tests/channel_test.c delete mode 100644 libs/libsndfile/tests/checksum_test.c delete mode 100644 libs/libsndfile/tests/chunk_test.c delete mode 100644 libs/libsndfile/tests/command_test.c delete mode 100644 libs/libsndfile/tests/compression_size_test.c delete mode 100644 libs/libsndfile/tests/cpp_test.cc delete mode 100644 libs/libsndfile/tests/dft_cmp.c delete mode 100644 libs/libsndfile/tests/dft_cmp.h delete mode 100644 libs/libsndfile/tests/dither_test.c delete mode 100644 libs/libsndfile/tests/dwvw_test.c delete mode 100644 libs/libsndfile/tests/error_test.c delete mode 100644 libs/libsndfile/tests/external_libs_test.c delete mode 100644 libs/libsndfile/tests/fix_this.c delete mode 100644 libs/libsndfile/tests/floating_point_test.c delete mode 100644 libs/libsndfile/tests/floating_point_test.def delete mode 100644 libs/libsndfile/tests/floating_point_test.tpl delete mode 100644 libs/libsndfile/tests/format_check_test.c delete mode 100644 libs/libsndfile/tests/generate.c delete mode 100644 libs/libsndfile/tests/generate.h delete mode 100644 libs/libsndfile/tests/header_test.c delete mode 100644 libs/libsndfile/tests/header_test.def delete mode 100644 libs/libsndfile/tests/header_test.tpl delete mode 100644 libs/libsndfile/tests/headerless_test.c delete mode 100644 libs/libsndfile/tests/largefile_test.c delete mode 100644 libs/libsndfile/tests/locale_test.c delete mode 100644 libs/libsndfile/tests/lossy_comp_test.c delete mode 100644 libs/libsndfile/tests/misc_test.c delete mode 100644 libs/libsndfile/tests/multi_file_test.c delete mode 100644 libs/libsndfile/tests/ogg_test.c delete mode 100644 libs/libsndfile/tests/open_fail_test.c delete mode 100644 libs/libsndfile/tests/pcm_test.c delete mode 100644 libs/libsndfile/tests/pcm_test.def delete mode 100644 libs/libsndfile/tests/pcm_test.tpl delete mode 100644 libs/libsndfile/tests/peak_chunk_test.c delete mode 100644 libs/libsndfile/tests/pedantic-header-test.sh.in delete mode 100644 libs/libsndfile/tests/pipe_test.c delete mode 100644 libs/libsndfile/tests/pipe_test.def delete mode 100644 libs/libsndfile/tests/pipe_test.tpl delete mode 100644 libs/libsndfile/tests/raw_test.c delete mode 100644 libs/libsndfile/tests/rdwr_test.def delete mode 100644 libs/libsndfile/tests/rdwr_test.tpl delete mode 100644 libs/libsndfile/tests/scale_clip_test.c delete mode 100644 libs/libsndfile/tests/scale_clip_test.def delete mode 100644 libs/libsndfile/tests/scale_clip_test.tpl delete mode 100644 libs/libsndfile/tests/sftest.c delete mode 100644 libs/libsndfile/tests/sfversion.c delete mode 100644 libs/libsndfile/tests/stdin_test.c delete mode 100644 libs/libsndfile/tests/stdio_test.c delete mode 100644 libs/libsndfile/tests/stdout_test.c delete mode 100644 libs/libsndfile/tests/string_test.c delete mode 100644 libs/libsndfile/tests/test_wrapper.sh.in delete mode 100644 libs/libsndfile/tests/ulaw_test.c delete mode 100644 libs/libsndfile/tests/utils.c delete mode 100644 libs/libsndfile/tests/utils.def delete mode 100644 libs/libsndfile/tests/utils.h delete mode 100644 libs/libsndfile/tests/utils.tpl delete mode 100644 libs/libsndfile/tests/virtual_io_test.c delete mode 100644 libs/libsndfile/tests/vorbis_test.c delete mode 100644 libs/libsndfile/tests/win32_ordinal_test.c delete mode 100644 libs/libsndfile/tests/win32_test.c delete mode 100644 libs/libsndfile/tests/write_read_test.c delete mode 100644 libs/libsndfile/tests/write_read_test.def delete mode 100644 libs/libsndfile/tests/write_read_test.tpl delete mode 100644 libs/win32/libsndfile/cleancount delete mode 100644 libs/win32/libsndfile/config.h delete mode 100644 libs/win32/libsndfile/libsndfile.2010.vcxproj.filters delete mode 100644 libs/win32/libsndfile/libsndfile.2015.vcxproj delete mode 100644 libs/win32/libsndfile/sndfile.h create mode 100644 w32/libsndfile-version.props create mode 100644 w32/libsndfile.props diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 955be84cc8..f0529beaca 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -232,8 +232,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\ap EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.2015.vcxproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.2015.vcxproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.2015.vcxproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.2015.vcxproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}" @@ -956,17 +954,6 @@ Global {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|x64 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.Build.0 = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|Win32.ActiveCfg = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|x64.ActiveCfg = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|x64.Build.0 = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.Build.0 = Debug|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.Build.0 = Release|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.ActiveCfg = Debug|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.ActiveCfg = Debug|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.Build.0 = Debug|x64 @@ -3005,7 +2992,6 @@ Global {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {3D0370CA-BED2-4657-A475-32375CBCB6E4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/libs/.gitignore b/libs/.gitignore index 49d7177e88..f66304d9f7 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -854,3 +854,5 @@ flite-*/ flite-* pcre-*/ pcre-* +libsndfile-*/ +libsndfile-* diff --git a/libs/libsndfile/.update b/libs/libsndfile/.update deleted file mode 100644 index cbf0edf709..0000000000 --- a/libs/libsndfile/.update +++ /dev/null @@ -1 +0,0 @@ -Fri Feb 28 03:45:32 CDT 2014 diff --git a/libs/libsndfile/AUTHORS b/libs/libsndfile/AUTHORS deleted file mode 100644 index b7e2232b95..0000000000 --- a/libs/libsndfile/AUTHORS +++ /dev/null @@ -1,14 +0,0 @@ -The main author of libsndfile is Erik de Castro Lopo -apart from code in the following directories: - - - src/GSM610 : Written by Jutta Degener and Carsten - Bormann . They should not be contacted in relation to - libsndfile or the GSM 6.10 code that is part of libsndfile. Their original - code can be found at: - - http://kbs.cs.tu-berlin.de/~jutta/toast.html - - - src/G72x : Released by Sun Microsystems, Inc. to the public domain. Minor - modifications were required to integrate these files into libsndfile. The - changes are listed in src/G72x/ChangeLog. - diff --git a/libs/libsndfile/COPYING b/libs/libsndfile/COPYING deleted file mode 100644 index c396169eea..0000000000 --- a/libs/libsndfile/COPYING +++ /dev/null @@ -1,503 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - diff --git a/libs/libsndfile/Cfg/.empty b/libs/libsndfile/Cfg/.empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libs/libsndfile/ChangeLog b/libs/libsndfile/ChangeLog deleted file mode 100644 index d22be00cd7..0000000000 --- a/libs/libsndfile/ChangeLog +++ /dev/null @@ -1,9764 +0,0 @@ -2013-04-05 Erik de Castro Lopo - - * Makefile.am - Make sure checkprograms are built as part of 'make test-tarball'. - Closes: https://github.com/erikd/libsndfile/issues/37 - -2013-03-29 Erik de Castro Lopo - - * tests/dft_cmp.c - Fix a buffer overflow detected using GCC 4.8's -fsantiize=address runtime - error checking functionality. This was a buffer overflow in libsndfile's - test suite, not in the actual library code. - -2013-03-09 Erik de Castro Lopo - - * M4/gcc_version.m4 - Fix to work with OpenBSD's sed. - -2013-03-07 Erik de Castro Lopo - - * src/ALAC/alac_encoder.c - Patch from Michael Pruett (author of libaudiofile) to add correct byte - swapping for the mChannelLayoutTag field. - -2013-03-02 Erik de Castro Lopo - - * doc/bugs.html - Bugs should bt reported on the github issue tracker. - -2013-02-22 Erik de Castro Lopo - - * configure.ac - Improve sanitization of FLAC_CFLAGS value. - -2013-02-21 Erik de Castro Lopo - - * src/Makefile.am - Call python interpreter instead of using '#!' in script. Thanks to Jan - Stary for reporting this. - - * doc/index.html doc/FAQ.html - Make internal links relative. Patch from Jan Stary. - -2013-02-13 Erik de Castro Lopo - - * src/test_endswap.def src/test_endswap.tpl - Add tests for psf_put_be32() and psf_put_be64(). - - * src/sfendian.h src/test_endswap.(def|tpl) - Add functions psf_get_be(16|32|64) with tests. - These are needed for platforms where un-aligned accesses cause bus faults. - - * src/ALAC/ag_enc.c src/ALAC/alac_decoder.c - Replace all un-aligned accesses with safe alternatives. - Closes: https://github.com/erikd/libsndfile/issues/19 - -2013-02-12 Erik de Castro Lopo - - * src/sfendian.h - Add big endian versions of H2BE_16 and H2BE_32. - -2013-02-11 Erik de Castro Lopo - - * src/ALAC/ - Replace Apple endswap routines with ones from libsndfile. - - * merge from libsndfile-cart repo - Add ability to set and get a cart chunk with WAV and RF64. - Orignal patch by Chris Roberts required a number of - tweaks. - -2013-02-10 Erik de Castro Lopo - - * src/common.h - Bump SF_HEADER_LEN from 8192 to 12292, the value it was in the 1.0.25 - release. - -2013-02-09 Erik de Castro Lopo - - * src/alac.c - Fix segfault when encoding 8 channel files. - Closes: https://github.com/erikd/libsndfile/issues/30 - -2013-02-07 Erik de Castro Lopo - - * src/ALAC/EndianPortable.c - Fall back to compiler's __BYTE_ORDER__ for endian-ness detection. - -2013-02-06 Erik de Castro Lopo - - * configure.ac src/common.h src/ima_adpcm.c src/ms_adpcm.c src/paf.c - Drop tests for and #ifdef hackery for C99 struct flexible array feature. - libsndfile assumes the compiler supports most of the ISO C99 standard. - - * src/alac.c - Fix valgrind invalid realloc. Reported by nu774. - Closes: https://github.com/erikd/libsndfile/issues/31 - -2013-02-05 Erik de Castro Lopo - - * src/alac.c - The 'pakt' chunk header should now be written correctly. - Closes: https://github.com/erikd/libsndfile/issues/24 - - * configure.ac Makefile.am - Use PKG_INSTALLDIR when it exists. Suggestion from Christoph Thompson. - Closes: https://github.com/erikd/libsndfile/pull/28 - -2013-02-03 Erik de Castro Lopo - - * src/common.h src/caf.c - Read the ALAC 'pakt' header and stash the values. - - * src/sfendian.h - Add functions psf_put_be64() and psf_put_be32(). - - * src/alac.c - Start work on filling on the 'pakt' chunk header. - -2013-02-02 Erik de Castro Lopo - - * doc/FAQ.html - Add missing opening

tag. - - * src/alac.c - Increase ALAC_BYTE_BUFFER_SIZE to 82000. - -2013-01-27 Erik de Castro Lopo - - * doc/FAQ.html - Improve question #8. - -2013-01-02 Erik de Castro Lopo - - * src/ogg_opus.c - Add skeleton implementation so someone else can run with it. - -2012-12-12 Erik de Castro Lopo - - * src/common.h src/dwd.c src/rx2.c src/txw.c - Fix for compiling when configured with --enable-experimental. Thanks to - Eric Wong for reporting this. - -2012-12-01 Erik de Castro Lopo - - * configure.ac programs/sndfile-play.c - OS X 10.8 uses a different audio API to previous versions. - Fix compile failure on by disabling sndfile-play on this version. - Someone needs to supply code for the new API. - -2012-11-30 Erik de Castro Lopo - - * Octave/Makefile.am Octave/octave_test.sh - Fix 'make distcheck'. - -2012-10-13 Erik de Castro Lopo - - * M4/octave.m4 - Relax constraints on Octave version. - -2012-10-11 Erik de Castro Lopo - - * tests/utils.tpl - Improve compare_*_or_die() functions. - - * src/command.c - Fix bug reported by Keiler Florian. When reading short or int data from a - file containing float data, and setting SFC_SET_SCALE_FLOAT_INT_READ to - SF_TRUE would fail 3, 5, 7 and other channels counts. Problem was that - psf_calc_signal_max() was not calculating the signal max correctly. - Calculation of the signal max was failing because it was trying to read - a sample count that was not an integer multiple of the channel count. - - * tests/channel_test.c tests/Makefile.am tests/test_wrapper.sh.in - Add test for the above. - -2012-09-25 Erik de Castro Lopo - - * src/sndfile.hh - Added a constructor to allow the use of SF_VIRTUAL_IO. Patch from - DannyDaemonic : https://github.com/erikd/libsndfile/pull/20 - -2012-08-23 Erik de Castro Lopo - - * doc/octave.html - Fix link to octave.sourceforge.net. Thanks to IOhannes m zmoelnig. - - * src/mat5.c - Allow reading of mat5 files without a specified sample rate (default to - 44.1kHz). Thanks to IOhannes m zmoelnig. - -2012-08-19 Erik de Castro Lopo - - * src/paf.c - Error out if channel count is zero. Bug report from William ELla via - launchpad: - https://bugs.launchpad.net/ubuntu/+source/libsndfile/+bug/1036831 - -2012-08-04 Erik de Castro Lopo - - * configure.ac programs/sndfile-play.c - Patch from Ricci Adams to use OSX's AudioQueues on OSX 10.7 and greater. - -2012-07-09 Erik de Castro Lopo - - * programs/common.c - Accept "ogg" as a file extention for Ogg/Vorbis files. - -2012-06-22 Erik de Castro Lopo - - * src/flac.c - Make sure any previously allocated FLAC stream encoder and stream decoder - objects are deleted before a new one is allocated. - -2012-06-20 Erik de Castro Lopo - - * tests/utils.tpl - Rename gen_lowpass_noise_float() to gen_lowpass_signal_float() and add a - sine wave component so that different FLAC compression levels can be - tested. - - * src/sndfile.h.in doc/command.html - Add SFC_SET_COMPRESSION_LEVEL and document it. - - * src/sndfile.c - Catch SFC_SET_VBR_ENCODING_QUALITY command and implement it as the inverse - of SFC_SET_COMPRESSION_LEVEL. - - * src/ogg_vorbis.c src/flac.c - Implement SFC_SET_COMPRESSION_LEVEL command. - - * tests/test_wrapper.sh.in tests/compression_size_test.c - Use the compression_size_test on FLAC as well. - -2012-06-19 Erik de Castro Lopo - - * tests/ - Rename vorbis_test.c -> compression_size_test.c so it can be extended to - test FLAC as well. - -2012-06-18 Erik de Castro Lopo - - * src/broadcast.c - Fix a bug where a file with a 'bext' chunk with a zero length coding - history field would get corrupted when the file was closed. - Reported by Paul Davis of the Ardour project. - - * src/test_broadcast_var.c - Add a test for the above. - -2012-05-19 Erik de Castro Lopo - - * src/sndfile.c - sf_format_check: For SF_FORMAT_AIFF, reject endian-ness setttings for - non-PCM formats. - -2012-04-12 Erik de Castro Lopo - - * src/aiff.c - Fix regression in handling of odd length SSND chunks. - Thanks Olivier Tristan for the example file. - - * src/aiff.c src/wav.c - Exit parser loop when marker == 0. - -2012-04-04 Erik de Castro Lopo - - * doc/FAQ.html - Fix text. Thanks to Richard Collins. - -2012-03-24 Erik de Castro Lopo - - * src/caf.c - Exit parse loop if the marker is zero. Pass jump offsets as size_t instead - of int. - -2012-03-20 Erik de Castro Lopo - - * src/alac.c - Fix segfault when decoding CAF/ALAC file with more than 4 channels. - Fixes github issue #8 reported by Charles Van Winkle. - -2012-03-20 Erik de Castro Lopo - - * src/common.h - Change 'typedef SF_CHUNK_ITERATOR { ... } SF_CHUNK_ITERATOR' into 'struct - SF_CHUNK_ITERATOR { ... }' to prevent older compilers from complaining of - re-typedef-ing of SF_CHUNK_ITERATOR. - - * configure.ac - Fix if test for empty $prefix. - -2012-03-18 Erik de Castro Lopo - - * src/*.c tests/chunk_test.c - Reworking of custom chunk handling code. - - Memory for the iterator is now attached to the SF_PRIVATE struct and - freed one sf_close(). - - Rename sf_create_chunk_iterator() -> sf_get_chunk_iterator(). - - Each SNDFILE handle never has more than one SF_CHUNK_ITERATOR handle. - - * tests/string_test.c - Fix un-initialised char buffer. - -2012-03-17 Erik de Castro Lopo - - * src/*.c tests/chunk_test.c - Add improved handling of custom chunk getting and settings. Set of patches - from IOhannes m zmoelnig submitted via github pull request #6. - - * src/alac.c - Fix calculated frame count for files with zero block length. - -2012-03-13 Erik de Castro Lopo - - * src/avr.c - Remove double assignment to psf->endian. Thanks Kao Dome. - - * src/gsm610.c - Fix clearing of buffers. Thanks Kao Dome. - - * src/paf.c - Remove duplicate code. Thanks Kao Dome. - - * src/test_strncpy_crlf.c - Fix minor error in test. Thanks Kao Dome. - - * src/common.h src/*.c - Fix a bunch of valgrind errors. - -2012-03-13 Erik de Castro Lopo - - * src/sndfile.c - Fix typo in error string 'Uknown' -> 'Unknown'. - - * tests/fix_this.c - Fix potential int overflow. - -2012-03-10 Erik de Castro Lopo - - * src/alac.c - Fix decoding of last block so that the decode length is not a multiple of - the block length. Fixes github issue #4 reported by Charles Van Winkle. - - * src/sfconfig.h src/sfendian.h - Fix for MinGW cross compiling. Use '#if (defined __*66__)' instead of - '#if __*86__' because the MinGW header use '#ifdef __x86_64__'. - -2012-03-10 Erik de Castro Lopo - - * src/ALAC/ src/alac.c - Unify the interface between libsndfile and Apple ALAC codec. Regardless of - file bit width samples are now passed between the two as int32_t that are - justified towards the most significant bit. Without this modification, 16 - conversion functions would have been needed between the libsndfile (short, - int, float, double) types and the ALAC types (16, 20, 24 and 32 bit). With - this mod, only 4 are needed. - - * tests/floating_point_test.tpl tests/write_read_test.(def|tpl) - Add tests for 20 and 24 bit ALAC/CAF files. - - * src/command.c - Add ALAC/CAF to the SFC_GET_FORMAT_* commands. Fixes github issue #5. - - * configure.ac - Only use automake AM_SLIENT_RULES where supported. Thanks Dave Yeo. - - * tests/pipe_test.tpl - Disable tests on OS/2. Thanks Dave Yeo. - -2012-03-09 Erik de Castro Lopo - - * configure.ac src/sfconfig.h src/sfendian.h - For GCC, use inline assembler for endian swapping. This should work with - older versions of GCC like the one currently used in OS/2. - -2012-03-06 Erik de Castro Lopo - - * src/alac.c - Make sure temp file gets opened in binary mode. - - * src/alac.c src/common.c src/common.h - Fix function alac_write16_d(). - - * tests/floating_point_test.tpl - Add tests for 16 bit ALAC/CAF. - - * src/alac.c src/common.c src/common.h - Add support for 32 bit ALAC/CAF files. - - * tests/floating_point_test.tpl tests/write_read_test.tpl - Add tests for 32 bit ALAC/CAF files. - -2012-03-05 Erik de Castro Lopo - - * src/ - Refactor chunk storage so it work on big as well as little endian CPUs. - - * tests/chunk_test.c - Clean up error messages. - - * src/sfendian.h src/*.c - Rename endian swapping macros and add ENDSWAP_64 and BE2H_64. - - * configure.ac - Detect presence of header file. - - * src/sfendian.h - Use intrinsics (ie for MinGW) when is not - present. - Make ENDSWAP_64() work with i686-w64-mingw32 compiler. - - * src/ALAC/EndianPortable.c - Add support for __powerpc__. - - * src/sfconfig.h - Make sure HAVE_X86INTRIN_H is either 1 or 0. - -2012-03-03 Erik de Castro Lopo - - * src/ALAC/* - Big dump of code for Apple's ALAC file format. The copyyright to this code - is owned by Apple who have released it under an Apache style license. A few - small modifications were made to allow this to be integrated into libsndfile - but unfortunately the history of those changes were lost because they were - developed in a Bzr tree and during that time libsndfile moved to Git. - - * src/alac.c src/caf.c src/common.[ch] src/Makefile.am src/sndfile.h.in - src/sndfile.c - Hook new ALAC codec in. - - * programs/sndfile-convert.c - Add support for alac codec. - - * tests/write_read_test.tpl - Expand tests to cover ALAC. - -2012-03-02 Erik de Castro Lopo - - * src/aiff.c src/wav.c - Fix a couple of regressions from version 1.0.25. - -2012-03-01 Erik de Castro Lopo - - * src/strings.c - Minor refactoring. Make sure that the memory allocation size if always > 0 - to avoid undefined behaviour. - -2012-02-29 Erik de Castro Lopo - - * src/chunk.c - Fix buffer overrun introduced in recently added chunk logging. This chunk - logging has not yet made it to a libsndfile release version. Thanks to - Olivier Tristan for providing an example file. - - * src/wav.c - Fix handling of odd sized chunks which was causing the parser to lose some - chunks. Thanks to Olivier Tristan for providing an example file. - -2012-02-26 Erik de Castro Lopo - - * tests/util.tpl - Used gnu_printf format checking with mingw-w64 compiler. - - * tests/header_test.tpl - Printf format fixes. - -2012-02-25 Erik de Castro Lopo - - * M4/extra_pkg.m4 - Update PKG_CHECK_MOD_VERSION macro to add an AC_TRY_LINK step. This fix - allows the configure process to catch attempts to link incompatible - libraries. For example, linking 32 bit version of eg libFLAC to a 64 bit - version of libsndfile will now fail. Similarly, when cross compiling - libsndfile from Linux to Windows linking the Linux versions of a library - to the Windows version of libsndfile will now also fail. - - * src/sndfile.h.in src/sndfile.c src/common.h src/create_symbols_file.py - Add API function sf_current_byterate(). - - * src/dwvw.c src/flac.c src/ogg_vorbis.c src/sds.c - Add codec specific handlers for current byterate. - - * tests/floating_point_test.tpl - Add initial test for sf_current_byterate(). - -2012-02-24 Erik de Castro Lopo - - * src/common.[ch] - Add function psf_decode_frame_count(). - - * src/dwvw.c - Fix a termnation bug that caused the decoder to go into an infinite loop. - -2012-02-24 Erik de Castro Lopo - - * src/wav.c - Fix a regression in the WAV header parser. Thanks to Olivier Tristan for - bug report and the example file. - -2012-02-21 Erik de Castro Lopo - - * src/sndfile.c - Return error when SF_BROADCAST_INFO struct has bad coding_history_size. - Thanks to Alex Weiss for the report. - -2012-02-20 Erik de Castro Lopo - - * src/au.c src/flac.c src/g72x.c src/ogg_vorbis.c src/wav_w64.c - Don't fake psf->bytewidth values. - -2012-02-19 Erik de Castro Lopo - - * tests/string_test.c - Fix valgrind warnings. - - * src/common.h src/sndfile.c src/strings.c - Make string storage dynamically allocated. - - * src/sndfile.c - Add extra validation for custom chunk handling. - -2012-02-18 Erik de Castro Lopo - - * src/wav.c - Improve handlling unknown chunk types. Thanks to Olivier Tristan for sending - example files. - - * src/utils.tpl - Add GCC specific testing for format string parameters for exit_if_true(). - - * tests/*.c tests/*.tpl - Fix all printf format warnings. - - * programs/sndfile-play.c - Remove un-needed OSX include . Thanks jamesfmilne for github - issue #3. - - * tests/chunk_test.c - Extend custom chunk test. - -2012-02-12 Erik de Castro Lopo - - * src/wav.c - Jump over some more chunk types while parsing. - -2012-02-04 Erik de Castro Lopo - - * src/common.h src/strings.c - Change way strings are stored in SF_PRIVATE in preparation for dynamically - allocating the storage. - -2012-02-02 Erik de Castro Lopo - - * src/common.h src*.c - Improve encapsulation of string data in SF_PRIVATE. - -2012-02-01 Erik de Castro Lopo - - * src/common.h src*.c - Remove the buffer union from SF_PRIVATE. Most uses of this have been - replaced with a BUF_UNION that is allocated on the stack. - -2012-01-31 Erik de Castro Lopo - - * src/common.h src*.c - Rename logbuffer field of SF_PRIVATE to parselog and reduce its size. - Put the parselog buffer and the index inside a struct within SF_PRIVATE. - -2012-01-26 Erik de Castro Lopo - - * configure.ac - Fix typo, FLAC_CLFAGS -> FLAC_CFLAGS. Thanks to Jeremy Friesner. - -2012-01-21 Erik de Castro Lopo - - * src/sndfile.c src/ogg.c - Fix misleading error message when trying to create an SF_FORMAT_OGG file - with anything other than SF_FORMAT_FILE. Thanks to Charles Van Winkle for - the bug report. Github issue #1. - -2012-01-20 Erik de Castro Lopo - - * src/sndfile.c src/wav.c - Allow files opened in RDWR mode with string data in the tailer to be - extended. Thanks to Bodo for the patch. - - * tests/string_test.c - Add tests for the above changes (patch from Bodo). - -2012-01-09 Erik de Castro Lopo - - * src/aiff.c - Refactor reading of chunk size and use of psf_store_read_chunk(). - - * src/(caf|wav).c - Correct storing of chunk offset. - -2012-01-05 Erik de Castro Lopo - - * src/aiff.c src/wav.c src/common.h - Refactor common code into src/common.h. - - * src/caf.c - Make custom chunks work for CAF files. - - * tests/chunk_test.c tests/test_wrapper.sh.in - Test CAF files with custom chunks. - - * src/sndfile.c - Prevent psf->codec_close() being called more than once. - -2012-01-04 Erik de Castro Lopo - - * programs/sndfile-cmp.c - Catch the case where the second file has more frames than the first. - -2012-01-02 Erik de Castro Lopo - - * src/create_symbols_file.py - Add sf_set_chunk/sf_get_chunk_size/sf_get_chunk_data. - -2011-12-31 Erik de Castro Lopo - - * tests/chunk_test.c tests/Makefile.am - New test for custom chunks. - - * src/aiff.c src/chunk.c src/common.h src/sndfile.c - Make custom chunks work on AIFF files. - - * src/wav.c - Make custom chunks work on WAV files (includes refactoring). - -2011-11-12 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c - Start working on setting/getting chunks. - -2011-11-24 Erik de Castro Lopo - - * src/binheader_writef_check.py src/create_symbols_file.py - Make it work for Python 2 and 3. Thanks Michael. - -2011-11-19 Erik de Castro Lopo - - * libsndfile.spec.in - Change field name 'URL' to 'Url'. - - * src/sndfile.h.in - Add SF_SEEK_SET/CUR/END. - -2011-11-05 Erik de Castro Lopo - - * src/id3.c - Fix a stack overflow that can occur when parsing a file with multiple - ID3 headers which would cause libsndfile to go into an infinite recursion - until it blew the stack. Thanks to Anders Svensson for supplying an example - file. - -2011-10-30 Erik de Castro Lopo - - * src/double64.c src/float32.c src/common.h - Make (float32|double_64)_(be|le)_read() functions const correct. - -2011-10-28 Erik de Castro Lopo - - * src/sfendian.h - Minor tweaking of types. Cast to ptr to correct final type rather void*. - - * programs/sndfile-play.c tests/utils.tpl - Fix compiler warnings with latest MinGW cross compiler. - -2011-10-13 Erik de Castro Lopo - - * src/file_io.c - Use the non-deprecated resource fork name on OSX. Thanks to Olivier Tristan. - -2011-10-12 Erik de Castro Lopo - - * src/wav.c - Jump over the 'olym' chunks when parsing. - -2011-10-06 Erik de Castro Lopo - - * tests/write_read_test.tpl - Remove windows only truncate() implementation. - -2011-09-04 Erik de Castro Lopo - - * src/sd2.c src/sndfile.c - Make sure 23 bit PCM SD2 files are readable/writeable. - - * tests/write_read_test.tpl - Add tests for 32 bit PCM SD2 files. - -2011-08-23 Erik de Castro Lopo - - * configure.ac - Use AC_SYS_LARGEFILE instead of AC_SYS_EXTRA_LARGEFILE as suggested by - Jan Willies. - -2011-08-07 Erik de Castro Lopo - - * configure.ac Makefile.am - Move ACLOCAL_AMFLAGS setup to Makefile.am. - -2011-07-15 Erik de Castro Lopo - - * doc/command.html - Merge two separate blocks of SFC_SET_VBR_ENCODING_QUALITY documentation. - - * src/paf.c - Replace ppaf24->samplesperblock with a compile time constant. - -2011-07-13 Erik de Castro Lopo - - * src/ogg_vorbis.c - Fix return value of SFC_SET_VBR_ENCODING_QUALITY command. - - * doc/command.html - Document SFC_SET_VBR_ENCODING_QUALITY, SFC_GET/SET_LOOP_INFO and - SFC_GET_INSTRUMENT. - - * NEWS README configure.ac doc/*.html - Updates for 1.0.25. - -2011-07-07 Erik de Castro Lopo - - * src/sfconfig.h - Add handling for HAVE_SYS_WAIT_H. - - * Makefile.am src/Makefile.am tests/Makefile.am - Add 'checkprograms' target. - -2011-07-05 Erik de Castro Lopo - - * src/common.h src/sndfile.c - Purge SF_ASSERT macro. Use standard C assert instead. - - * src/paf.c src/common.h src/sndfile.c - Fix for Secunia Advisory SA45125, heap overflow (heap gets overwritten with - byte value of 0) due to integer overflow if PAF file handler. - - * src/ima_adpcm.c src/ms_adpcm.c src/paf.c - Use calloc instead of malloc followed by memset. - - * tests/utils.tpl - Clean up use of memset. - -2011-07-05 Erik de Castro Lopo - - * src/ogg.c - Fix log message. - - * tests/format_check_test.c - Fix compiler warnings. - -2011-07-04 Erik de Castro Lopo - - * src/sndfile.c - Fix error message for erro code SFE_ZERO_MINOR_FORMAT. - - * tests/format_check_test.c - Add a test to for SF_FINFO format field validation. - - * src/ogg.c src/ogg_vorbis.c src/ogg.h src/ogg_pcm.c src/ogg_speex.c - src/common.h src/Makefile.am - Move vorbis specific code to ogg_vorbis.c, add new files for handling PCM - and Speex codecs in an Ogg container. The later two are only enabled with - ENABLE_EXPERIMENTAL_CODE config variable. - -2011-06-28 Erik de Castro Lopo - - * src/strings.c - Clean up and refactor storage of SF_STR_SOFTWARE. - -2011-06-23 Erik de Castro Lopo - - * src/sndfile.h.in doc/api.html - Fix definition of SF_STR_LAST and update SF_STR_* related docs. Thanks to - Tim van der Molen for the patch. - -2011-06-21 Erik de Castro Lopo - - * programs/sndfile-interleave.c - Fix handling of argc. Thanks to Marius Hennecke. - - * src/wav_w64.c - Accept broken WAV files with blockalign == 0. Thanks to Olivier Tristan for - providing example files. - - * src/wav.c - Jump over 'FLLR' chunks. - -2011-06-14 Erik de Castro Lopo - - * src/sndfile.h.in - Fix -Wundef warning due to ENABLE_SNDFILE_WINDOWS_PROTOTYPES. - - * configure.ac - Add -Wundef to CFLAGS. - - * src/ogg.c - Fix -Wunder warning. - -2011-05-18 Erik de Castro Lopo - - * configure.ac - Use int64_t instead of off_t when they are the same size. - - * src/Makefile.am tests/Makefile.am - Use check_PROGRAMS instead of noinst_PROGRAMS where appropriate. - -2011-05-08 Erik de Castro Lopo - - * src/wav.c - Don't allow unknown and/or un-editable chunks to prevent the file from being - opened in SFM_RDWR mode. - -2011-04-25 Erik de Castro Lopo - - * tests/format_check_test.c - Fix segfault in test program. - -2011-04-25 Erik de Castro Lopo - - * tests/format_check_test.c - New test program to check to make sure that sf_open() and sf_check_format() - agree as to what is a valid program. - - * tests/Makefile.am tests/test_wrapper.sh.in - Hook into build and test runner. - - * src/sndfile.c - Fix some sf_format_check() problems. Thanks to Charles Van Winkle for the - notification. - -2011-04-06 Erik de Castro Lopo - - * src/caf.c - Add validation to size of 'data' chunk and fix size of written 'data' - chunk. Thanks to Michael Pruett for reporting this. - -2011-03-28 Erik de Castro Lopo - - * src/* tests/* programs/* - Fix a bunch of compiler warnings with gcc-4.6. - -2011-03-25 Erik de Castro Lopo - - * tests/util.tpl - Add NOT macro to util.h. - - * src/strings.c - Fix handling of SF_STR_SOFTWARE that resulted in a segfault due to calling - strlen() on an unterminated string. Thanks to Francois Thibaud for reporting - this problem. - - * tests/string_test.c - Add test for SF_STR_SOFTWARE segfault bug. - - * configure.ac - Sanitize FLAC_CFLAGS value supplied by pkg-config which returns a value of - '-I${includedir}/FLAC'. However FLAC also provides an include file - which clashes with the Standard C header of the same name. The - solution is strip the 'FLAC' part off the end and include all FLAC headers - as . - - * configure.ac src/Makefile.am - Use non-recursive make in src/ directory. - -2011-03-23 Erik de Castro Lopo - - * NEWS README docs/*.html - Updates for 1.0.24 release. - -2011-03-22 Erik de Castro Lopo - - * configure.ac - Fix up usage of sed (should not assume GNU sed). - - * M4/add_(c|cxx)flags.m4 - Test flags in isolation. - - * tests/cpp_test.cc - Fix a broken test (test segfaults). Report by Dave Flogeras. - -2011-03-21 Erik de Castro Lopo - - * programs/common.[ch] - Add function program_name() which returns the program name minus the path - from argv [0]. - - * programs/*.c programs/Makefile.am - Use program_name() where appropriate. Fix build. - -2011-03-20 Erik de Castro Lopo - - * src/wav.c - For u-law and A-law files, write an 18 byte 'fmt ' chunk instead of a 16 - byte one. Win98 accepts files with a 16 but not 18 byte 'fmt' chunk. Later - version accept 18 byte but not 16 byte. - -2011-03-15 Erik de Castro Lopo - - * doc/FAQ.html - Add examples for question 12. - - * doc/libsndfile.css.in - Add tweaks for h4 element. - - * doc/api.html - Add documentation for virtual I/O functionality. Thanks to Uli Franke. - - * tests/util.tpl - Add static inline functions sf_info_clear() and sf_info_setup(). - - * tests/(alaw|dwvw|ulaw)_test.c - Use functions sf_info_clear() and sf_info_setup(). - -2011-03-08 Erik de Castro Lopo - - * configure.ac - Fail more gracefully if pkg-config is missing. Suggestion from Brian - Willoughby. - -2011-02-27 Erik de Castro Lopo - - * src/common.c - Use size_t instead of int for size params with varargs. - -2011-02-09 Erik de Castro Lopo - - * doc/index.html - Update supported platforms with more Debian platforms and Android. - -2011-01-27 Erik de Castro Lopo - - * src/sndfile.hh - Add an LPCWSTR version of the SndfileHandle constructor to the SndfileHandle - class definition. Thanks to Eric Eizenman for pointing out this was missing. - - * tests/cpp_test.cc - Add test for LPCWSTR version of the SndfileHandle constructor. - -2011-01-19 Erik de Castro Lopo - - * programs/sndfile-play.c - Remove cruft. - -2010-12-01 Erik de Castro Lopo - - * src/sndfile.hh - Add methods rawHandle() and takeOwnership(). Thanks to Tim Blechmann for - the patch. - - * tests/cpp_test.cc - Add tests for above two methods. Also supplied by Tim Blechmann. - -2010-11-11 Erik de Castro Lopo - - * doc/api.html - Add mention of use of sf_strerror() when sf_open() fails. - -2010-11-01 Erik de Castro Lopo - - * configure.ac - Make TYPEOF_SF_COUNT_T int64_t where possible. This may fix problems where - people are compiling on a 64 bit system with the GCC -m32 flag. - - * src/sndfile.h.in - Fix comments on sf_count_t. - -2010-10-26 Erik de Castro Lopo - - * src/aiff.c - Handle non-zero offset field in SSND chunk. Thanks to Michael Chinen. - -2010-10-20 Erik de Castro Lopo - - * configure.ac - Sed fix for FreeBSD. Thanks Tony Theodore. - -2010-10-14 Erik de Castro Lopo - - * shave.in M4/shave.m4 - Fix shave invocation of windres compiler. Thanks Damien Lespiau (upstream - shave author). - - * configure.ac M4/shave.m4 shave-libtool.in shave.in - Switch from shave to automake-1.11's AM_SILENT_RULES. - -2010-10-13 Erik de Castro Lopo - - * shave-libtool.in shave.in - Sync to upstream version. - - * src/rf64.c - More work to make the parser more robust and accepting of mal-formed files. - -2010-10-12 Erik de Castro Lopo - - * src/common.h - Add functions psf_strlcpy() and psf_strlcat(). - - * src/broadcast.c src/sndfile.c src/strings.c src/test_main.c - src/test_main.h src/test_strncpy_crlf.c - Use functions psf_strlcpy() and psf_strlcat() as appropriate. - - * tests/string_test.c - Add tests for SF_STR_GENRE and SF_STR_TRACKNUMBER. - - * src/rf64.c - Fix size of 'ds64' chunk when writing RF64. - -2010-10-10 Erik de Castro Lopo - - * programs/*.c - Add the libsndfile version to the usage message of all programs. - -2010-10-10 Erik de Castro Lopo - - * configure.ac src/version-metadata.rc.in src/Makefile.am - Add version string resources to the windows DLL. - - * doc/api.html - Update to add missing SF_FORMAT_* values. Closed Debian bug #545257. - - * NEWS README configure.ac doc/*.html - Updates for 1.0.23 release. - -2010-10-09 Erik de Castro Lopo - - * tests/pedantic-header-test.sh.in - Handle unusual values of CC environment variable. - - * src/rf64.c - Minor tweaks and additional sanity checking. - - * src/Makefile.am src/binheader_writef_check.py - Use python 2.6. - -2010-10-08 Erik de Castro Lopo - - * src/sndfile.hh - Add a missing 'inline' before a constructor defintion. - -2010-10-06 Erik de Castro Lopo - - * src/common.h - Add macro NOT. - - * src/rf64.c - Minor tweaks. - - * Makefile.am */Makefile.am - Add *~ to CLEANFILES. - -2010-10-05 Erik de Castro Lopo - - * src/sndfile.c - Fix a typo in the error string for SFE_OPEN_PIPE_RDWR. Thanks to Charles - Van Winkle for the report. - -2010-10-04 Erik de Castro Lopo - - * src/flac.c src/ogg.c src/sndfile.h.in src/strings.c src/wav.c - Add ability to read/write tracknumber and genre to flac/ogg/wav files. - Thanks to Matti Nykyri for the patch. - - * src/common.h src/broadcast.c src/strings.c - Add function psf_safe_strncpy() and use where appropriate. - -2010-10-04 Erik de Castro Lopo - - * NEWS README configure.ac doc/*.html - Updates for 1.0.22 release. - -2010-10-03 Erik de Castro Lopo - - * src/common.h src/broadcast.c src/rf64.c src/sndfile.c src/wav.c - Rewrite of SF_BROADCAST_INFO handling. - - * src/test_broadcast_var.c tests/command_test.c - Tweak SF_BROADCAST_INFO tests. - - * src/test_broadcast_var.c - Fix OSX stack check error. - -2010-09-30 Erik de Castro Lopo - - * src/sds.c - Set sustain_loop_end to 0 as suggested by Brian Lewis. - -2010-09-29 Erik de Castro Lopo - - * src/sds.c - Make sure the correct frame count gets written into the header. - - * tests/write_read_test.tpl - Don't allow SDS files to have a long frame count. - -2010-09-17 Erik de Castro Lopo - - * src/sds.c - Apply a pair of patches from Brian Lewis to fix the packet number location - and the checksum. - -2010-09-10 Erik de Castro Lopo - - * src/aiff.c src/file_io.c src/ogg.c src/rf64.c src/sndfile.c - src/strings.c src/test_audio_detect.c src/test_strncpy_crlf.c - src/wav.c tests/pcm_test.tpl - Fix a bunch of minor issues found using static analysis. - -2010-08-23 Erik de Castro Lopo - - * src/test_broadcast_var.c - New file containing tests for broadcast_set_var(). - - * src/Makefile.am src/test_main.[ch] - Hook test_broadcast_var.c into tests. - -2010-08-22 Erik de Castro Lopo - - * src/broadcast.c src/common.(c|h) - Move function strncpy_crlf() to src/common.c so the function can be tested - in isolation. - - * src/test_strncpy_crlf.c - New file. - - * src/Makefile.am src/test_main.[ch] - Hook test_strncpy_crlf.c into tests. - -2010-08-18 Erik de Castro Lopo - - * src/common.h - Move code around to make comments make sense. - - * src/broadcast.c - Add debugging code that is disabled by default. - -2010-08-02 Erik de Castro Lopo - - * src/flac.c - When the file meta data says the file has zero frames set psf->sf.frames - to SF_COUNT_MAX. Fixes Debian bug #590752. - - * programs/sndfile-info.c - Print 'unknown' if frame count == SF_COUNT_MAX. - -2010-06-27 Erik de Castro Lopo - - * src/sndfile.c - Only support writing mono SVX files. Multichannel SVX files are not - interleaved and there is no support infrastructure to cache and write - multiple channels to create a non-interleaved file. - - * src/file_io.c - Don't call close() on a file descriptor of -1. Thanks to Jeremy Friesner - for the bug report. - -2010-06-09 Erik de Castro Lopo - - * src/common.h - Add macro SF_ASSERT. - - * src/sndfile.c - Use SF_ASSERT to ensure sizeof (sf_count_t) == 8. - - * src/svx.c - Add support for reading and writing stereo SVX files. - -2010-05-07 Erik de Castro Lopo - - * configure.ac - When compiling with x86_64-w64-mingw32-gcc link with -static-libgcc flags. - - * programs/common.c programs/sndfile-metadata-set.c - Update metadata after the audio data is copied. Other minor fixes. Patch - from Marius Hennecke. - -2010-05-04 Erik de Castro Lopo - - * src/nist.c - Fix a regression reported by Hugh Secker-Walker. - - * src/api.html - Add comment about sf_open_fd() not working on Windows if the application - and the libsndfile DLL are linked to different versions of the Microsoft - C runtime DLL. - -2010-04-23 Erik de Castro Lopo - - * tests/pedantic-header-test.sh.in - Fix 'make distcheck'. - -2010-04-21 Erik de Castro Lopo - - * tests/pedantic-header-test.sh.in - New file to test whether sndfile.h can be compiled with gcc's -pedantic - flag. - - * configure.ac tests/test_wrapper.sh.in - Hook pedantic-header-test into test suite. - - * src/sndfile.h.in - Fix -pedantic warning. - -2010-04-19 Erik de Castro Lopo - - * programs/sndfile-salvage.c programs/Makefile.am - New program to salvage the audio data from WAV/WAVEX/AIFF files which are - greater than 4Gig in size. - -2010-04-09 Erik de Castro Lopo - - * programs/sndfile-convert.c - Fix valgrind warning. - -2010-04-06 Erik de Castro Lopo - - * programs/sndfile-cmp.c - When files differ in the PCM data, also print the difference offset. - Minor cleanup. - -2010-03-19 Erik de Castro Lopo - - * src/aiff.c - Don't use the 'twos' marker for 24 and 32 bit PCM, use 'in24' and 'in32' - instead. Thanks to Paul Davis (Ardour) for this suggestion. - -2010-02-28 Erik de Castro Lopo - - * configure.ac - Clean up configure report. - - * tests/utils.tpl - Add functions test_read_raw_or_die and test_write_raw_or_die. - - * tests/rdwr_test.(def|tpl) tests/Makefile.am - Add new test program and hook into build. - - * src/sndfile.c - Fix minor issues with sf_read/write_raw(). Bug reported by Milan Křápek. - - * tests/test_wrapper.sh.in - Add rdwr_test to the test wrapper script. - -2010-02-22 Erik de Castro Lopo - - * configure.ac - Remove -fpascal-strings from OSX's OS_SPECIFIC_CFLAGS. - - * programs/common.[ch] programs/sndfile-metadata-set.c - Apply a patch from Robin Gareus allowing the setting of the time reference - field of the BEXT chunk. - -2010-02-06 Erik de Castro Lopo - - * src/ima_adpcm.c - Add a fix from Jonatan Liljedahl to handle predictor overflow when decoding - IMA4. - -2010-01-26 Erik de Castro Lopo - - * src/sndfile.hh - Add a constructor which takes an existing file descriptor and then calls - sf_open_fd(). Patch from Sakari Bergen. - -2010-01-10 Erik de Castro Lopo - - * programs/sndfile-deinterleave.c programs/sndfile-interleave.c - Improve usage messages. - -2010-01-09 Erik de Castro Lopo - - * src/id3.c src/Makefile.am - Add new file src/id3.c and hook into build. - - * src/sndfile.c src/common.h - Detect and skip and ID3 header at the start of the file. - -2010-01-07 Erik de Castro Lopo - - * programs/common.c - Fix update_strings() copyright, comment, album and license are correctly - written. Thanks to Todd Allen for reporting this. - - * man/Makefile.am - Change GNU makeism to something more widely supported. Thanks to Christian - Weisgerber for reporting this. - - * configure.ac programs/Makefile.am programs/sndfile-play.c - Apply patch from Christian Weisgerber and Jacob Meuserto add support for - OpenBSD's sndio. - -2010-01-05 Erik de Castro Lopo - - * doc/api.html - Discourage the use of sf_read/write_raw(). - -2009-12-28 Erik de Castro Lopo - - * configure.ac - Test for Unix pipe() and waitpid() functions. - - * src/sfconfig.h tests/pipe_test.tpl - Disable pipe_test if pipe() and waitpid() aren't available. - -2009-12-16 Erik de Castro Lopo - - * configure.ac src/Makefile.am src/create_symbols_file.py - src/make-static-lib-hidden-privates.sh - Change name of generated file src/Symbols.linux to Symbols.gnu-binutils and - and use the same symbols file for other systems which use GNU binutils like - Debian's kfreebsd. - - * M4/shave.m4 shave.in - Update shave files from upstream. - -2009-12-15 Erik de Castro Lopo - - * man/sndfile-metadata-get.1 - Fix typo. - - * man/sndfile-interleave.1 man/Makefile.am - New man page. - -2009-12-13 Erik de Castro Lopo - - * src/ogg.c - When decoding to short or int, clip the decoded signal to [-1.0, 1.0] if - its too hot. Thanks to Dmitry Baikov for suggesting this. - - * NEWS README doc/*.html - Updates for 1.0.21. - -2009-12-09 Erik de Castro Lopo - - * programs/sndfile-jackplay.c man/sndfile-jackplay.1 - Remove these which will now be in found in the sndfile-tools package. - - * programs/Makefile.am man/Makefile.am - Remove build rules for sndfile-jackplay. - - * configure.ac - Remove detection of JACK Audio Connect Kit. - - * programs/sndfile-concat.c man/sndfile-concat.1 - Add new program with man page. - - * man/Makefile.am programs/Makefile.am - Hook sndfile-concat into build system. - -2009-12-08 Erik de Castro Lopo - - * tests/error_test.c - Don't terminate when sf_close() returns zero in error_close_test(). - It seems that Windows 7 behaves differently from earlier versions of - Windows. - -2009-12-03 Erik de Castro Lopo - - * configure.ac M4/*.m4 - Rename all custom macros from AC_* to MN_*. - - * programs/sndfile-interleave.c - Make it actually work. - -2009-12-02 Erik de Castro Lopo - - * doc/*.html configure.ac - Corrections and clarifications courtesy of Robin Forder. - - * programs/sndfile-convert.c programs/common.[ch] - Move some code from convert to common for reuse. - - * programs/sndfile-interleave.c programs/sndfile-interleave.c - Add new programs sndfile-interleave and sndfile-deinterleave. - - * programs/Makefile.am - Hook new programs into build. - -2009-12-01 Erik de Castro Lopo - - * src/create_symbols_file.py tests/stdio_test.c tests/win32_test.c - Minor OS/2 tweaks as suggested by David Yeo. - - * tests/multi_file_test.c - Fix file creation flags on windows. Thanks to Bruce Sharpe. - - * src/sf_unistd.h - Set all group and other file create permssions to zero. - - * tests/win32_test.c - Add a new test. - -2009-11-30 Erik de Castro Lopo - - * doc/print.css doc/*.html - Add a print stylesheet and update all HTML documents to reference it. - Thanks to Aditya Bhargava for suggesting this. - - * doc/index.html - Minor corrections. - -2009-11-29 Erik de Castro Lopo - - * sndfile.pc.in - Add a Libs.private entry to assist with static linking. - -2009-11-28 Erik de Castro Lopo - - * src/make-static-lib-hidden-privates.sh src/Makefile.am - Add a script to hide all non-public symbols in the libsndfile.a static - library. - -2009-11-22 Erik de Castro Lopo - - * tests/locale_test.c - Correct usage of ENABLE_SNDFILE_WINDOWS_PROTOTYPES. - -2009-11-20 Erik de Castro Lopo - - * src/windows.c - Correct usage of ENABLE_SNDFILE_WINDOWS_PROTOTYPES. - -2009-11-16 Erik de Castro Lopo - - * programs/sndfile-convert.c - Allow the program to read from stdin by specifying '-' on the command line - as the input file. - - * src/sndfile.h.in - Hash define ENABLE_SNDFILE_WINDOWS_PROTOTYPES to 1 for greater safety. - - * tests/virtual_io_test.c - Add a PAF/PCM_24 test and verify the file length is not negative - immediately after openning the file for write. - -2009-10-18 Erik de Castro Lopo - - * src/wav.c - When writing loop lengths, adjust the end position by one to make up for - Microsoft's screwed up spec. Thanks to Olivier Tristan for the patch. - -2009-10-14 Erik de Castro Lopo - - * src/flac.c - Apply patch from Uli Franke allowing FLAC files to be encoded at any sample - rate. - -2009-10-09 Erik de Castro Lopo - - * src/nist.c - Fix parsing of odd ulaw encoded file provided by Jan Silovsky. - - * configure.ac - Insist on libvorbis >= 1.2.3. Earlier verions have bugs that cause the - libsndfile test suite to fail on MIPS, PowerPC and others. - See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899 - -2009-10-06 Erik de Castro Lopo - - * man/sndfile-convert.1 - Fix warning from Debian's lintian checks. - - * man/sndfile-cmp.1 man/sndfile-jackplay.1 man/sndfile-metadata-get.1 - man/Makefile.am - Add three new minimal manpages and hook into build. - -2009-10-05 Erik de Castro Lopo - - * tests/test_wrapper.sh.in - Don't run cpp_test on x86_64-w64-mingw32. - -2009-09-28 Erik de Castro Lopo - - * tests/utils.tpl - On windows, make sure the open() function doesn't get called with a third - parameter of 0 which fails for no good reason. Also make sure this third - parameter doesn't get called with S_IRGRP when compiling for windows because - Wine complains. - - * src/sndfile.hh - Add a SndfileHandle constructor for windows that takes a 'const wchar_t *' - string. - - * doc/FAQ.html - Add Q/A : I'm cross compiling libsndfile for another platform. How can I - run the test suite? - - * src/create_symbols_file.py src/Makefile.am - Add Symbols.static target, a list of symbols, one per line. - -2009-09-27 Erik de Castro Lopo - - * tests/test_wrapper.sh.in - Update to allow all tests to be gathered up into a testsuite tarball and - then be run using this script. - - * build-test-tarball.mk.in - Add a Make script to build a tarball of all the test binaries and the test - wrapper script. This is useful for cross compiling; you can build the - binaries, build test test tarball and transfer the test tarball to the - target machine for testing. - -2009-09-26 Erik de Castro Lopo - - * src/common.h src/*.c - Modify SF_FILE struct to allow it to carry either 8-bit or 16-bit strings - for the file path, directory and name. Fixes for this change throughout. - - * src/windows.c src/Makefile.am - New file defining new windows only public function sf_wchar_open() which - takes a 'const wchar_t *' string (LPCWSTR) for the file name parameter. - - * src/sndfile.h.in - Add SF_CHANNEL_MAP_ABISONIC_* entries. - Add windows only defintion for sf_wchar_open(). - - * src/create_symbols_file.py - Add sf_wchar_open() to the list of public symbols (windows only). - - * tests/locale_test.c - Add a wchar_test() to test sf_wchar_open(). - -2009-09-25 Erik de Castro Lopo - - * src/common.h src/*.c - Split file stuff into PSF_FILE struct within the SF_PRIVATE struct. - -2009-09-23 Erik de Castro Lopo - - * src/aiff.c src/voc.c - When a byte is needed, use unsigned char. - - * src/ima_oki_adpcm.c src/broadcast.c src/test_ima_oki_adpcm.c - Include sfconfig.h to prevent compile errors with MinGW compilers. - - * configure.ac - Remove AM_CONFIG_HEADER due to warnings from autoconf 2.64. - - * tests/locale_test.c - Update to work with xx_XX.UTF-8 style locales. Refactoring. - -2009-09-22 Erik de Castro Lopo - - * configure.ac - Set __USE_MINGW_ANSI_STDIO to 1 when compiling using MinGW compilers. - Remove unneeded AC_SUBST. - Report Host CPU/OS/vendor. - -2009-09-19 Erik de Castro Lopo - - * src/sndfile.c - Fix error message string. - - * src/flac.c - Add 88200 to the list of supported sample rates. - - * src/ogg.c - Fix compiler warning when using gcc-4.5.0. - - * programs/sndfile-info.c tests/utils.tpl - Remove WIN32 snprintf #define. - - * src/ima_adpcm.c - Fix minor bug in aiff_ima_encode_block. Thanks to Denis Fileev for finding - this. - -2009-09-16 Erik de Castro Lopo - - * src/caf.c - Use the correct C99 format specifier for int64_t. - - * M4/endian.m4 - Fix detection of CPU endian-ness when cross compiling. Thanks to Pierre - Ossman for the bug report. - - * src/caf.c src/sndfile.c - Fix reading and writing of PEAK chunks in CAF files. - - * tests/peak_chunk_test.c tests/test_wrapper.sh.in - Run peak_chunk_test on CAF files. - -2009-09-15 Erik de Castro Lopo - - * src/aiff.c src/wav.c - Use the correct C99 format specifier for int64_t. - -2009-08-30 Erik de Castro Lopo - - * src/rf64.c src/sndfile.c src/wav.c src/wav_w64.h - Apply a patch (massaged slightly) from Uli Franke adding handling of the - BEXT chunk in RF64 files. - - * tests/command_test.c - Update channel_map_test() function so WAV test passes. - - * src/rf64.c - Add channel mapping and ambisonic support. - - * src/sndfile.h - Add comments showing correspondance between libsndfile channel map - defintiions and those used by Apple and MS. - - Add handling of reading/writing channel map info. - - * tests/command_test.c tests/test_wrapper.sh.in - Update channel map tests. - -2009-07-29 Erik de Castro Lopo - - * src/common.h - Add function psf_isprint() a replacement for the standard C isprint() - function which ignores any locale settings and treats all input as ASCII. - - * src/(aiff|common|rf64|sd2|strings|svx|wav).c - Use psf_isprint() instead of isprint(). - -2009-07-13 Erik de Castro Lopo - - * src/command.c - Add string descriptions for SF_FORMAT_RF64 and SF_FORMAT_MPC2K. - -2009-06-30 Erik de Castro Lopo - - * programs/sndfile-play.c - Allow use of Open Sound System audio output under FreeBSD. - -2009-06-24 Erik de Castro Lopo - - * configure.ac - Add patch from Conrad Parker to add --disable-jack. - -2009-05-28 Erik de Castro Lopo - - * src/alaw.c src/float32.c src/htk.c src/pcm.c src/sds.c src/ulaw.c - Fix bugs where invalid files can cause a divide by zero error (SIGFPE). - Thanks to Sami Liedes for reporting this a Debian bug #530831. - -2009-05-26 Erik de Castro Lopo - - * src/chanmap.[ch] - New files for channel map decoding/encoding. - -2009-05-25 Erik de Castro Lopo - - * configure.ac src/sndfile.h.in - Fix MSVC definition of sf_count_t. - -2009-05-24 Erik de Castro Lopo - - * src/wav_w64.[ch] - Add wavex_channelmask to WAV_PRIVATE struct and add a function to convert - an array of SF_CHANNEL_MASK_* values into a bit mask for use in WAV files. - - * src/wav.c - Add ability to write the channel mask. - -2009-05-23 Erik de Castro Lopo - - * programs/sndfile-info.c - Add -c command line option to dump the channel map information. - - * src/wav_w64.c - Don't bail from parser if channel map bitmask is faulty. - - * src/common.h src/sndfile.c - Remove error code SFE_W64_BAD_CHANNEL_MAP which is not needed any more. - - * src/sndfile.c - On SFC_SET_CHANNEL_MAP_INFO pass the channel map command down to container's - command handler. - -2009-05-22 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c src/wav_w64.c - Apply a patch from Lennart Poettering (PulseAudio) to allow reading of - channel data in WAV and W64 files. - Add a test for the above. - -2009-05-20 Erik de Castro Lopo - - * src/FAQ.html - Update the section about pre-compiled binaries for Win64. - -2009-05-14 Erik de Castro Lopo - - * src/common.h src/test_conversions.c - Be more careful when including so compiling on pre-C99 platforms - (hello Slowlaris) might actually work. - - * NEWS README doc/*.html - Updates for 1.0.20. - -2009-04-21 Erik de Castro Lopo - - * src/voc.c - Fix a bug whereby opening a specially crafted VOC file could result in a - heap overflow. Thanks to Tobias Klein (http://www.trapkit.de) for reporting - this issue. - - * src/aiff.c - Fix potential (heap) buffer overflow when parsing 'MARK' chunk. - -2009-04-12 Erik de Castro Lopo - - * tests/stdin_test.c - Check psf->error after opening file. - - * src/file_io.c - Fix obscure seeking bug reported by Hugh Secker-Walker. - - * tests/utils.tpl - Add check of sf_error to test_open_file_or_die(). - - * src/sndfile.c - Clear error if opening resource fork fails. - -2009-04-11 Erik de Castro Lopo - - * tests/alaw_test.c tests/locale_test.c tests/ulaw_test.c - Cleanup output. - -2009-03-25 Erik de Castro Lopo - - * src/float32.c - Fix f2s_clip_array. - -2009-03-24 Erik de Castro Lopo - - * src/float32.c - In host_read_f2s call convert instead of f2s_array. - - * src/ima_adpcm.c - Remove dead code. - - * src/test_ima_oki_adpcm.c examples/generate.c tests/dither_test.c - tests/dwvw_test.c tests/fix_this.c tests/generate.c - tests/multi_file_test.c - Minor fixes. - -2009-03-23 Erik de Castro Lopo - - * M4/shave.m4 shave.in - Pulled update from upstream. - -2009-03-19 Erik de Castro Lopo - - * doc/api.html - Add pointers to example programs in source code tarball. - -2009-03-17 Erik de Castro Lopo - - * src/common.h - Define SF_PLATFORM_S64 for non-gcc compilers with 'long long' type. - - * configure.ac - Add documentation for --disable-external-libs and improve error handling - for that option. - - * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py - Add public function sf_version_string. - - * tests/sfversion.c - Test function sf_version_string. - - * M4/shave.m4 shave-libtool.in shave.in - Add new files from 'git clone git://git.lespiau.name/shave'. - - * configure.ac - Enable shave. - - * src/Makefile.am src/binheader_writef_check.py Octave/* - Shave related tweaks. - -2009-03-15 Erik de Castro Lopo - - * src/common.h src/caf.c src/sndfile.c - Add SF_MAX_CHANNELS (set to 256) and use it. - - * src/sndfile.h.in - Check for either _MSCVER or _MSC_VER being defined. - -2009-03-04 Erik de Castro Lopo - - * tests/vorbis_test.c - Relax test slighly to allow test to pass on more CPUs etc. - -2009-03-03 Erik de Castro Lopo - - * configure.ac - Detect vorbis_version_string() correctly. - -2009-03-02 Erik de Castro Lopo - - * doc/index.html - Add a 'See Also' section with a link to sndfile-tools. - - * NEWS README doc/*.html - Updates for 1.0.19 release. - - * configure.ac - Fix --enable-external-libs logic. - -2009-03-01 Erik de Castro Lopo - - * src/aiff.c - Fix resource leak and potential read beyond end of buffer. - - * src/nist.c - Fix reading of header value sample_n_bytes. - - * src/sd2.c src/wav.c - Fix potential read beyond end of buffer. - - * src/sndfile.c src/svx.c - Check return values of file_io functions. - - * tests/win32_test.c - Fix resource leak. - - * configure.ac - Detect the presence/absence of vorbis_version_string() in libvorbis. - - * src/ogg.c - Only call vorbis_version_string() from libvorbis if present. - -2009-02-24 Erik de Castro Lopo - - * tests/win32_test.c - Don't use sprintf, even on windows. - - * src/aiff.c src/rf64.c src/wav.c - Eliminate dead code, more validation of data read from file. - -2009-02-22 Erik de Castro Lopo - - * src/ima_adpcm.c - Clamp values to a valid range before indexing ima_step_size array. - - * src/GSM610/*.c tests/*c programs/*.c src/audio_detect.c - Don't include un-needed headers. - - * programs/sndfile-info.c - Remove dead code. - - * tests/test_wrapper.sh.in - Add 'set -e' so the script exits on error. - - * src/test_ima_oki_adpcm.c - Fix read beyond end of array. - - * tests/win32_test.c - Add missing close on file descriptor. - - * src/nist.c programs/sndfile-metadata-set.c - Fix 'unused variable' warnings. - - * src/aiff.c - Fix potential memory leak in handling of 'MARK' chunk. - Remove un-needed test (unsigned > 0). - - * src/sd2.c - Improve handling of heap allocated buffer. - - * src/sndfile.c - Remove un-needed test (always true). - - * src/wav.c src/rf64.c - Ifdef out dead code that will be resurected some time in the future. - - * src/wav.c src/w64.c src/xi.c - Handle error return values from psf_ftell. - - * src/wav_w64.c - Fix handling and error checking of MSADPCM coefficient arrays. - - * regtest/*.c - Bunch of fixes. - - * src/test_file_io.c - Use snprintf instead of strncpy in test program. - -2009-02-21 Erik de Castro Lopo - - * src/sd2.c - Validate data before using. - - * src/caf.c - Validate channels per frame value before using, fixing a possible integer - overflow bug, leading to a possible heap overflow. Found by Alin Rad Pop of - Secunia Research (CVE-2009-0186). - -2009-02-20 Erik de Castro Lopo - - * Octave/octave_test.sh - Unset TERM environment variable and export LD_LIBRARY_PATH. - -2009-02-16 Erik de Castro Lopo - - * src/file_io.c - In windows code, cast LPVOID to 'char*' in printf. - -2009-02-15 Erik de Castro Lopo - - * M4/octave.m4 - Clear the TERM environment before evaluating anything in Octave. This works - around problems that might occur if a users TERM settings are incorrect. - Thanks to Rob Til Freedmen for helping to debug this. - - * src/wav.c - Handle four zero bytes as a marker within a LIST or INFO chunk. - Thanks to Rogério Brito for supplying an example file. - -2009-02-14 Erik de Castro Lopo - - * src/common.h src/*.c - Use C99 snprintf everywhere. - -2009-02-11 Erik de Castro Lopo - - * tests/test_wrapper.sh.in - New file to act as the template for the test wrapper script. - - * configure.ac - Generate tests/test_wrapper.sh from the template. - - * tests/Makefile.am - Replace all tests with a single invocation of the test wrapper script. - -2009-02-09 Erik de Castro Lopo - - * src/ogg.c - Record vorbis library version string. - - * configure.ac - Require libvorbis >= 1.2.2. - - * M4/endian.m4 - Fix bracketing of function for autoconf 2.63. Thanks to Richard Ash. - - * M4/octave.m4 M4/mkoctfile_version.m4 - Clean up AC_WITH_ARG usage using AC_HELP_STRING. - -2009-02-08 Erik de Castro Lopo - - * Octave/Makefile.am - Use $(top_buildir) instead of $(builddir) which may not be defined. - - * M4/octave.m4 - Improve logic and status reporting. - -2009-02-07 Erik de Castro Lopo - - * configure.ac AUTHORS NEWS README doc/*.html - Final tweaks for 1.0.18 release. - -2009-02-03 Erik de Castro Lopo - - * programs/sndfile-convert.c - Add 'htk' to the list of convert formats. - - * programs/sndfile-info.c - Simplify get_signal_max using SFC_CALC_SIGNAL_MAX command. - Increase size of files for which signal max will be calculated. - -2009-01-14 Erik de Castro Lopo - - * doc/index.html - Fix links for SoX and WavPlay. Thanks to Daniel Griscom. - -2009-01-11 Erik de Castro Lopo - - * programs/sndfile-metadata-get.c - Make valgrind clean. - Clean up temp string array usage. - Error out if trying to update coding history in RDWR mode. - -2009-01-10 Erik de Castro Lopo - - * doc/index.html - Fix links to versions of the LGPL. - -2008-12-14 Erik de Castro Lopo - - * tests/string_test.c - Add test for RDWR mode where the file ends up shorter than when it was - opened. - - * src/wav.c - Truncate the file on close for RDWR mode where the file ends up shorter - than when it was opened. - -2008-11-30 Erik de Castro Lopo - - * M4/add_cflags.m4 - Fix problem with quoting of '#include'. - - * M4/add_cxxflags.m4 configure.ac - Add new file M4/add_cxxflags.m4 and use it in configure.ac. - -2008-11-19 Erik de Castro Lopo - - * programs/sndfile-info.c - Apply patch from Conrad Parker to calculate and display total duration when - more than one file is dumped. - -2008-11-10 Erik de Castro Lopo - - * configure.ac src/Makefile.am - Tweaks to generation of Symbols files. - - * tests/win32_ordinal_test.c - Update tests for above changes. - -2008-11-06 Erik de Castro Lopo - - * programs/common.c - When merging broadcast info, make sure to clear the destination field - before copying in the new data. - - * programs/test-sndfile-metadata-set.py - Add test for the above. - - * src/broadcast.c - Fix checking of required coding_history_size. - -2008-10-28 Erik de Castro Lopo - - * tests/command_test.c - Add test to detect if coding history is truncated. - - * src/broadcast.c - Fix truncation of coding history. - -2008-10-27 Erik de Castro Lopo - - * tests/command_test.c - Add broadcast_coding_history_size test. - - * programs/*.[ch] - Use SF_BROADCAST_INFO_VAR to manipulate larger 'bext' chunks. - - * src/rf64.c - Add code to prevent infinite loop on malformed file. - - * src/common.h src/sndfile.c src/w64.c src/wav_w64.c - Rationalize and improve error handling when parsing 'fmt ' chunk. - - * M4/octave.m4 - Simplify and remove cruft. - Check for correct Octave version. - - * Octave/* - Reduce 3 C++ files to one, fix build for octave 3.0, fix build. - - * Octave/sndfile.cc Octave/PKG_ADD - Add Octave function sfversion which returns the libsndfile version that the - module is linked against. - - * Octave/Makefile.am - Bunch of build and 'make distcheck' fixes. - -2008-10-26 Erik de Castro Lopo - - * programs/common.c - Return 1 if SFC_SET_BROADCAST_INFO fails. - - * programs/test-sndfile-metadata-set.py - Update for new programs directory, exit on any error. - - * tests/error_test.c - Fix failure behaviour in error_number_test. - - * src/common.h src/sndfile.c - Add error number SFE_BAD_BROADCAST_INFO_SIZE. - - * src/* - Reimplement handling of broadcast extentioon chunk in WAV/WAVEX files. - - * src/broadcast.c - Fix generation of added coding history. - -2008-10-25 Erik de Castro Lopo - - * programs/sndfile-metadata-get.c programs/sndfile-info.c - Exit with non-zero on errors. - -2008-10-21 Erik de Castro Lopo - - * examples/sndfile-to-text.c examples/Makefile.am - Add a new example program and hook it into the build. - - * examples/ programs/ - Add a new directory programs and move sndfile-info, sndfile-play and other - real programs to the new directory, leaving example programs where they - were. - -2008-10-20 Erik de Castro Lopo - - * tests/Makefile.am - Automake 1.10 MinGW cross compiling fixes. - -2008-10-19 Erik de Castro Lopo - - * examples/sndfile-play.c - Remove call to deprecated function snd_pcm_sw_params_get_xfer_align. - Fix gcc-4.3 compiler warnings. - - * tests/command_test.c - Fix a valgrind warning. - - * tests/error_test.c tests/multi_file_test.c tests/peak_chunk_test.c - tests/pipe_test.tpl tests/stdio_test.c tests/win32_test.c - Fix gcc-4.3 compiler warnings. - -2008-10-17 Erik de Castro Lopo - - * src/broadcast.c - Fix termination of desitination string in strncpy_crlf. - When copying BROADCAST_INFO chunk, make sure destination gets correct line - endings. - - * examples/common.c - Fix copying of BROADCAST_INFO coding_history field. - -2008-10-13 Erik de Castro Lopo - - * tests/command_test.c - Add test function instrument_rw_test, but don't hook it into the testing - yet. - - * src/common.h src/command.c src/sndfile.c src/flac.c - Error code rationalization. - - * src/common.h src/sndfile.c - Set psf->error to SFE_CMD_HAS_DATA when adding metadata via sf_command() - fails due to psf->have_written being true. - - * doc/command.html - Document the SFC_GET/SET_BROADCAST_INFO comamnds. - -2008-10-10 Erik de Castro Lopo - - * tests/command_test.c - Improve error reporting when '\0' is found in coding history. - Fix false failure. - -2008-10-09 Erik de Castro Lopo - - * src/broadcast.c - Convert all coding history line endings to \r\n. - - * tests/command_test.c - Add test to make sure all line endings are converted to \r\n. - -2008-10-08 Erik de Castro Lopo - - * src/broadcast.c - Changed the order of coding history fields. - - * tests/command_test.c - Update bextch test to cope with previous change. - - * examples/common.c - Add extra length check when copying broadcast info data. - -2008-10-05 Erik de Castro Lopo - - * tests/utils.tpl tests/pcm_test.tpl - Update check_file_hash_or_die to use 64 bit hash. - - * tests/checksum_test.c tests/Makefile.am - Add new checksum_test specifically for lossy compression of headerless - files. - -2008-10-04 Erik de Castro Lopo - - * src/gsm610.c - Seek to psf->dataoffset before decoding first block. - - * src/sndfile.c - Fix detection of mpc2k files on big endian systems. - -2008-10-03 Erik de Castro Lopo - - * src/broadcast.c - Use '\r\n' newlines in Coding History as required by spec. - -2008-10-02 Erik de Castro Lopo - - * src/test_conversions.c - Use int64_t instead of 'long long'. - -2008-10-01 Erik de Castro Lopo - - * examples/sndfile-metadata-set.c - Remove --bext-coding-history-append command line option because it didn't - really make sense. - - * examples/sndfile-metadata-(get|set).c - Add usage messages. - - * examples/test-sndfile-metadata-set.py - Start work on test coding history. - -2008-09-30 Erik de Castro Lopo - - * README doc/win32.html - Bring these up to date. - - * src/aiff.c - Fix parsing of REX files. - -2008-09-29 Erik de Castro Lopo - - * src/file_io.c - Use intptr_t instead of long for return value of _get_osfhandle. - - * src/test_conversions.c src/test_endswap.tpl - Fix printing of int64_t values. - - * examples/sndfile-play.c - Fix win64 issues. - - * tests/win32_ordinal_test.c - Fix calling of GetProcAddress with ordinal under win64. - - * tests/utils.tpl - Fix win64 issues. - -2008-09-25 Erik de Castro Lopo - - * examples/* - Rename copy_data.[ch] to common.[ch]. Fix build. - Move code from sndfile-metadata-set.c to common.c. - - * examples/Makefile.am tests/Makefile.am regtest/Makefile.am - Clean paths. - -2008-09-19 Erik de Castro Lopo - - * doc/tutorial.html doc/Makefile.am - Add file doc/tutorial.html and hook into build/dist system. - -2008-09-14 Erik de Castro Lopo - - * examples/sndfile-metadata-set.c - Clean up handling of bext command line params. - -2008-09-13 Erik de Castro Lopo - - * src/w64.c - Add handling/skipping of a couple of new chunk types. - -2008-09-09 Erik de Castro Lopo - - * configure.ac - Add -funsigned-char to CFLAGS if the compiler supports it. - - * examples/sndfile-metadata-(get|set).c - Add handling for more metadata types. - -2008-09-04 Erik de Castro Lopo - - * src/common.h - Add macros SF_CONTAINER, SF_CODEC and SF_ENDIAN useful for splitting format - field of SF_INFO into component parts. - - * src/*.c - Use new macros everywhere it is appropriate. - -2008-09-02 Erik de Castro Lopo - - * examples/sndfile-bwf-set.c - Massive reworking. - -2008-08-24 Erik de Castro Lopo - - * examples/sndfile-bwf-set.c - Add --info-auto-create-date command line option. - - * examples/sndfile-metadata-set.c examples/sndfile-metadata-get.c - examples/Makefile.am examples/test-sndfile-bwf-set.py - Rename sndfile-bwf-(set|get).c to sndfile-metadata-(set|get).c. - Change command line args. - -2008-08-23 Erik de Castro Lopo - - * src/wav.c - Allow 'PAD ' chunk to be modified in RDWR mode. - - * src/sndfile.h.in src/sndfile.c - Add handling (incomplete) for SFC_SET_ADD_HEADER_PAD_CHUNK. - - * tests/Makefile.am tests/write_read_test.tpl tests/header_test.tpl - tests/misc_test.c - Add tests for RF64. - - * src/rf64.c - Fixes to make sure all tests pass. - - * tests/Makefile.am tests/string_test.c - Add string tests (not yet passing). - -2008-08-22 Erik de Castro Lopo - - * src/rf64.c - First pass at writing RF64 now working. - -2008-08-21 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add SF_FORMAT_RF64 to format_map. - - * src/common.h src/sndfile.c - More RF64 support code. - - * examples/sndfile-bwf-set.c - Fix the month number in autogenerated date string and use hypen in date - instead of slash. - - * examples/test-sndfile-bwf-set.py - Update tests. - - * examples/sndfile-info.c - When called with -i or -b option, operate on all files on command line, not - just the first. - -2008-08-19 Erik de Castro Lopo - - * src/rf64.c - New file to handle RF64 (WAV like format supportting > 4Gig files). - - * src/sndfile.h.in src/common.h src/sndfile.c src/Makefile.am - Hook the above into build so hacking can begin. - - * src/pcm.c - Improve log message when pcm_init fails. - - * src/sndfile-info.c - Only calculate and print 'Signal Max' if file is less than 10 megabytes in - length. - -2008-08-18 Erik de Castro Lopo - - * tests/string_test.c - Polish string_multi_set_test. - - * src/wav.c - In RDWR mode, pad the header if necessary (ie LIST chunk has moved or - length has changed). - Minor fixes in wav_write_strings. - Write PAD chunk with default endian-ness, not a specific endian-ness. - - * examples/test-sndfile-bwf-set.py - Add Python script to test sndfile-bwf-set/get. - - * examples/sndfile-bwf-set.c - Clean up and fixes. - - * src/wav.c - Merge function wavex_write_header into wav_write_header, deleting about 70 - lines of code. - - * src/common.h - Double value of SF_MAX_STRINGS. - - * tests/string_test.c - Add string tests for WAVEX and RIFX files. - - * tests/command_test.c - Add broadcast test for WAVEX files. - -2008-08-17 Erik de Castro Lopo - - * tests/string_test.c - Add a new string_rdwr_test (currently failing for WAV). - Add a new string_multi_set_test (currently failing). - - * tests/command_test.c - Add new broadcast_rdwr_test (currently failing). - - * src/wav.c - Fix to WAV parser to allow 'bext' chunk to be updated in place. - In wav_write_tailer, seek to psf->dataend if its greater than zero. - - * src/sndfile.c - Make sure psf->have_written gets set correctly in mode SFM_RDWR. - - * configure.ac - Test for and gettimeofday. - - * src/common.c - Use gettimeofday() to initialize psf_rand_int32. - - * src/common.h src/sndfile.c - Add unique_id field to SF_PRIVATE struct. - - * src/common.h src/sndfile.c src/wav.c src/wav_w64.[ch] - Move wavex_ambisonic field from SF_PRIVATE struct to WAV_PRIVATE struct. - - * src/common.h src/strings.c - Add function psf_location_string_count. - -2008-08-16 Erik de Castro Lopo - - * configure.ac - Test for localtime and localtime_r. - - * examples/sndfile-convert.c - In function copy_metadata(), copy broadcast info if present. - - * examples/copy_data.[ch] examples/Makefile.am - Break some functionality out of sndfile-convert.c so it can be used in - examples/sndfile-bwf-set.c. - - * tests/utils.tpl - Add new function create_short_sndfile(). - - * examples/sndfile-bwf-set.c examples/sndfile-bwf-get.c - examples/Makefile.am - Add new files and hook into build. - -2008-08-11 Erik de Castro Lopo - - * src/sndfile.h.in - Fix comments. Patch from Mark Glines. - -2008-07-30 Erik de Castro Lopo - - * tests/misc_test.c - Use zero_data_test on Ogg/Vorbis files. - - * src/ogg.c - Fix segfault when closing an Ogg/Vorbis file that has been opened for write - but had no actual data written to it. Bug reported by Chinoy Gupta. - - * tests/Makefile.am - Make sure to run mist_test on Ogg/Vorbis files. - -2008-07-19 Erik de Castro Lopo - - * regtest/Makefile.am - Use SQLITE3_CFLAGS to locate sqlite headers. - -2008-07-10 Erik de Castro Lopo - - * doc/index.html doc/FAQ.html - Add notes about which versions of windows libsndfile works on. - -2008-07-03 Erik de Castro Lopo - - * tests/misc_test.c - Add a test for correct handling of Ambisonic files. Thanks to Fons - Adriaensen for the test. - - * src/wav.c src/wav_w64.c - Fix handling of Ambisonic files. Thanks to Fons Adriaensen for the patch. - -2008-06-29 Erik de Castro Lopo - - * configure.ac - Fix detection/enabling of external libs. - - * M4/extra_pkg.m4 M4/Makefile.am - Add m4 macro PKG_CHECK_MOD_VERSION which is a hacked version - PKG_CHECK_MODULES. The new macro prints the version number of the package - it is searching for. - -2008-06-14 Erik de Castro Lopo - - * src/aiff.c - Apply a fix from Axel Röbel where if the second loop in the instrument - chunk is none, the loop mode is written into the first loop. - -2008-05-31 Erik de Castro Lopo - - * src/test_float.c src/test_main.(c|h) src/Makefile.am - Add new file to test functions float32_(le|be)_(read|write) and - double64_(le|be)_(read|write). Hook into build and testsuite. - - * src/double64.c src/float32.c - Fix bugs in functions found by test added above. Thanks to Nicolas Castagne - for reporting this bug. - - * src/sndfile.h.in - Change time_reference_(low|high) entries of SF_BROADCAST_INFO struct to - unsigned. - - * examples/sndfile-info.c - Print out the BEXT time reference in a sensible format. - -2008-05-21 Erik de Castro Lopo - - * src/*.c - Fuzz fixes. - - * src/ogg.c - Add call to ogg_stream_clear to fix valgrind warning. - - * src/aiff.c - Fix x86_64 compile issue. - - * configure.ac src/Makefile.am src/flac.c src/ogg.c - Link to external versions of FLAC, Ogg and Vorbis. - - * tests/lossy_comp_test.c tests/ogg_test.c tests/string_test.c - tests/vorbis_test.c tests/write_read_test.tpl - Fix tests when configured with --disable-external-libs. - - * tests/external_libs_test.c tests/Makefile.am - Add new test and hook into build and test suite. - - * src/command.c - Use HAVE_EXTERNAL_LIBS to ensure that the SFC_GET_FORMAT_* commands return - the right data when external libs are disabled. - -2008-05-11 Erik de Castro Lopo - - * tests/write_read_test.tpl - Add a test for extending a file during write by seeking past the current - end of file. - - * src/sndfile.c - Allow seeking past end of file during write. - -2008-05-10 Erik de Castro Lopo - - * doc/api.html doc/command.html - Move all information about the sf_command function to command.html and add - a link from documentation of the sf_read/write_raw function to the - SFC_RAW_NEEDS_ENDSWAP command. - - * doc/index.html doc/FAQ.html doc/libsndfile.css - Minor documentation tweaks. - -2008-05-09 Erik de Castro Lopo - - * configure.ac - Add AM_PROG_CC_C_O. - -2008-04-27 Erik de Castro Lopo - - * tests/error_test.c - Add a test to make sure if file opened with sf_open_fd, and then the file - descriptor is closed, then sf_close will return an error code. Thanks to - Dave Flogeras for the bug report. - - * src/sndfile.c - Make sf_close return an error is the file descriptor is already closed. - -2008-04-19 Erik de Castro Lopo - - * configure.ac - Set object format to aout for OS/2. Thanks to David Yeo. - - * src/mpc2k.c src/sndfile.c src/sndfile.h.in src/common.h src/Makefile.am - Add ability to read MPC 2000 file. - - * tests/write_read_test.tpl tests/misc_test.c tests/header_test.tpl - tests/Makefile.am - Add tests for MPC 2000 file format. - - * examples/sndfile-convert.c - Allow conversion to MPC 2000 file format. - -2008-04-17 Erik de Castro Lopo - - * src/VORBIS/lib/codebook.c - Sync from upstream SVN. - - * autogen.sh configure.ac - Minor tweaks. - -2008-04-13 Erik de Castro Lopo - - * src/ogg.c - Add a patch that fixes finding the length in samples of an Ogg/Vorbis file. - The patch as supplied segfaulted and required many hours of debugging. - - * src/OGG/bitwise.c - Sync from upstream SVN. - -2008-04-09 Erik de Castro Lopo - - * src/aiff.c - Fix up handling of 'APPL' chunk. Thanks to Axel Röbel for bringing up - this issue. - -2008-04-06 Erik de Castro Lopo - - * tests/*.c - Add calls to sf_close() where needed. - - * tests/utils.tpl tests/multi_file_test.c - Always pass 0 as the third argument to open when OS_IS_WIN32. - -2008-04-03 Erik de Castro Lopo - - * src/test_* - Add files test_main.[ch]. - Collapse all tests into a single executable. - -2008-03-30 Erik de Castro Lopo - - * src/FLAC - Sync to upstream CVS. - -2008-03-25 Erik de Castro Lopo - - * src/common.h - Make SF_MIN and SF_MAX macros MinGW friendly. - - * examples/sndfile-(info|play).c - Use Sleep function from instead of _sleep. - - * tests/locale_test.c - Disable some tests when OS_IS_WIN32. - - * src/FLAC/src/share/replaygain_anal/replaygain_analysis.c - src/FLAC/src/share/utf8/utf8.c - MinGW fixes. - -2008-03-11 Erik de Castro Lopo - - * doc/FAQ.html - Tweaks to pcm16 <-> float conversion answer. - -2008-02-10 Erik de Castro Lopo - - * src/OGG - Sync to SVN upstream. - - * Makefile.am - Add 'DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror'. - -2008-02-05 Erik de Castro Lopo - - * examples/sndfile-jackplay.c - Minor tweaks to warning message printed when compiled without libjack. - -2008-01-27 Erik de Castro Lopo - - * tests/peak_chunk_test.c - Improve read_write_peak_test to find more errors. Inspired by example - provided by Nicolas Castagne. - - * src/aiff.c - Another SFM_RDWR fix shown up by above test. - -2008-01-24 Erik de Castro Lopo - - * src/aiff.c - Fix reading of COMM encoding string. - - * src/chunk.c src/common.h src/Makefile.am - New file for storing and retrieving info about header chunks. Hook into - build. - - * src/aiff.c - Use new chunk logging to fix problem with AIFF in RDWR mode. - -2008-01-22 Erik de Castro Lopo - - * src/command.c - Add WVE to the list of major formats. - - * tests/aiff_rw_test.c - Fix error reporting. - -2008-01-21 Erik de Castro Lopo - - * src/common.[ch] - Add internal functions str_of_major_format, str_of_minor_format, - str_of_open_mode and str_of_endianness. - - * tests/write_read_test.tpl - Fix reporting of errors in new_rdwr_XXXX_test. - -2008-01-20 Erik de Castro Lopo - - * examples/sndfile-play.c - Apply patch from Yair K. to fix compiles with OSS v4. - - * src/common.h src/float32.c src/double64.c - Rename psf->float_enswap to psf->data_endswap. - - * src/sndfile.h.in src/sndfile.c src/pcm.c - Add command SFC_RAW_NEEDS_ENDSWAP. - - * tests/command.c - Add test for SFC_RAW_NEEDS_ENDSWAP. - - * doc/command.html - Document SFC_RAW_NEEDS_ENDSWAP. - - * tests/peak_chunk_test.c - Add test function read_write_peak_test. Thanks to Nicolas Castagne for the - bug report. - -2008-01-09 Erik de Castro Lopo - - * examples/sndfile-cmp.c - Add new example program contributed by Conrad Parker. - - * examples/Makefile.am - Hook into build. - - * doc/development.html - Change use or reconfigure.mk to autogen.sh. - -2008-01-08 Erik de Castro Lopo - - * tests/win32_test.c - Add another win32 test. - - * tests/util.tpl - Add function file_length_fd which wraps fstat. - - * tests/Makefile.am - Run the multi_file_test on AU files. - - * tests/multi_file_test.c - Use function file_length_fd() instead of file_length() to overcome stupid - win32 bug. Fscking hell Microsoft sucks so much. - -2008-01-05 Erik de Castro Lopo - - * src/sd2.c - Fix a rsrc parsing bug. Example file supplied by Uli Franke. - -2007-12-28 Erik de Castro Lopo - - * doc/index.html - Allow use of either LGPL v2.1 or LGPL v3. - - * tests/header_test.tpl - Add header_shrink_test from Axel Röbel. - - * src/wav.c - Add fix from Axel Röbel for writing files with float data but no peak - chunk (ie peak chunk gets removed after the file is opened). - - * src/aiff.c tests/header_test.tpl - Apply similar fix to above for AIFF files. - - * src/wav.c tests/header_test.tpl - Apply similar fix to above for WAVEX files. - - * src/command.c - Add Ogg/Vorbis to 'get format' commands. - -2007-12-16 Erik de Castro Lopo - - * src/ogg.c - Fix seeking on multichannel Ogg Vorbis files. Reported by Bodo. - Set the default encoding quality to 0.4 instead of 4.0 (Bodo again). - - * tests/ogg_test.c - Add stereo seek tests. - -2007-12-14 Erik de Castro Lopo - - * tests/ogg_test.c - Add a test (currently failing) for stereo seeking on Ogg Vorbis files. Test - case supplied by Bodo. - - * tests/utils.(def|tpl) - Add compare_XXX_or_die functions. - -2007-12-05 Erik de Castro Lopo - - * src/aiff.c - Fix a bug where ignoring ssnd_fmt.offset and ssnd_fmt.blocksize caused - misaligned reading of 24 bit data. Thanks to Uli Franke for reporting this. - -2007-12-03 Erik de Castro Lopo - - * src/vox_adpcm.c src/ima_oki_adpcm.[ch] src/Makefile.am - Merge in code from the vox-patch branch. Thanks to Robs for the patch - which fixes a long standing bug in the VOX codec. - -2007-12-01 Erik de Castro Lopo - - * examples/sndfile-convert.c - Fix handling of -override-sample-rate=X option. - -2007-11-25 Erik de Castro Lopo - - * src/ogg.c src/VORBIS - Merge in Ogg Vorbis support from John ffitch of the Csound project. - -2007-11-24 Erik de Castro Lopo - - * src/sndfile.c - Recognise files with 'vox6' extension as 6kHz OKI VOX ADPCM files. Also - recognise 'vox8' as and 'vox' as 8kHz files. - - * configure.ac - Detect libjack (JACK Audio Connect Kit). - - * examples/sndfile-jackplay.c examples/Makefile.am - Add new example program to play sound files using the JACK audio server. - Thanks to Jonatan Liljedahl for allowing this to be included. - -2007-11-21 Erik de Castro Lopo - - * doc/index.html - Update support table with SD2 and FLAC. - -2007-11-17 Erik de Castro Lopo - - * src/sndfile.c - Fix calculation of internal value psf->read_current when attempting to read - past end of audio data. - Remove redundant code. - - * tests/lossy_comp_test.c - Add read_raw_test to check that raw reads do not go past the end of the - audio data section. - Clean up error output messages. - - * src/sndfile.c - Add code to prevent sf_read_raw from reading past the end of the audio data. - - * tests/Makefile.am - Add the wav_pcm lossy_comp_test. - -2007-11-16 Erik de Castro Lopo - - * configure.ac src/Makefile.am src/create_symbols_file.py - More OS/2 fixes from David Yeo. - -2007-11-12 Erik de Castro Lopo - - * src/file_io.c tests/utils.tpl tests/benchmark.tpl - Improve handling of requirements for O_BINARY as suggested by Ed Schouten. - -2007-11-11 Erik de Castro Lopo - - * src/common.h - Fix symbol class when SF_MIN is nested inside SF_MAX or vice versa. - - * src/create_symbols_file.py - Add support for OS/2 contributed by David Yeo. - -2007-11-05 Erik de Castro Lopo - - * M4/gcc_version.m4 - Add macro AC_GCC_VERSION to detect GCC_MAJOR_VERSION and GCC_MINOR_VERSION. - - * configure.ac - Use AC_GCC_VERSION to work around gcc-4.2 inline warning stupidity. - See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 - Use -fgnu-inline to prevent stupid warnings. - -2007-11-03 Erik de Castro Lopo - - * tests/util.tpl - Increase the printing width for print_test_name(). - - * tests/command_test.c tests/Makefile.am - Add tests for correct updating of broadcast WAV coding history. - - * examples/sndfilehandle.cc examples/Makefile.am - Add example program using the C++ SndfileHandle class. - -2007-10-29 Erik de Castro Lopo - - * src/common.h src/sndfile.c - Add error codes SFE_ZERO_MAJOR_FORMAT and SFE_ZERO_MINOR_FORMAT. - -2007-10-26 Erik de Castro Lopo - - * src/sd2.c - Identify sample-rate/sample-size/channels by resource id. - -2007-10-25 Erik de Castro Lopo - - * src/broadcast.c src/common.h src/sndfile.c - Improvements to handling of broadcast info in WAV files. Thanks to Frederic - Cornu and other for their input. - -2007-10-24 Erik de Castro Lopo - - * src/FLAC/include/share/alloc.h - Mingw fix for SIZE_T_MAX from Uli Franke. - -2007-10-23 Erik de Castro Lopo - - * tests/open_fail_test.c tests/error_test.c tests/Makefile.am - Move tests from open_fail_test.c to error_test.c and remove the former. - -2007-10-22 Erik de Castro Lopo - - * tests/scale_clip_test.(def|tpl) - Add tests for SFC_SET_INT_FLOAT_WRITE command. - - * doc/command.html - Add docs for SFC_SET_INT_FLOAT_WRITE command. - - * examples/sndfile-play.c tests/dft_cmp.c - Fix gcc-4.2 warning messages. - -2007-10-21 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Add command SFC_GET_CURRENT_SF_INFO. - - * src/sndfile.h.in src/sndfile.c src/create_symbols_file.py - Remove function sf_get_info (only ever in pre-release code). - - * tests/command_test.c - Add test for SFC_GET_CURRENT_SF_INFO. - -2007-10-15 Erik de Castro Lopo - - * src/wav.c - Add parsing of 'exif' chunks. Originally coded by Trent Apted. - - * configure.ac - Put config stuff in Cfg directory. - Remove check for inttypes.h. - -2007-10-10 Erik de Castro Lopo - - * src/w64.c - Fix writing of 'riff' chunk length and check for correct value in parser. - -2007-09-20 Erik de Castro Lopo - - * doc/index.html - Link to MP3 FAQ entry. - -2007-09-18 Erik de Castro Lopo - - * src/flac.c - Move the blocksize check to an earlier stage of flac_buffer_copy. - -2007-09-12 Erik de Castro Lopo - - * src/FLAC - Huge merge from FLAC upstream. - -2007-09-10 Erik de Castro Lopo - - * examples/*.c - Change license to all example programs to BSD. - -2007-09-08 Erik de Castro Lopo - - * src/FLAC/include/FLAC/metadata.h - Include to prevent compile error on OSX. - - * Octave/octave_test.sh - Disable test on OSX. Can't get it to work. - - * src/flac.c - Check the blocksize returned from the FLAC decoder to prevent buffer - overruns. Reported by Jeremy Friesner. Thanks. - -2007-09-07 Erik de Castro Lopo - - * Makefile.am M4/octave.m4 - Fix build when Octave headers are not present. - -2007-08-27 Erik de Castro Lopo - - * doc/development.html - Add note about bzr repository directory looking empty. - -2007-08-26 Erik de Castro Lopo - - * configure.ac Octave/* M4/octave_* - Bunch of changes to add ability to build GNU Octave modules to read/write - sound files using libsndfile from Octave. - -2007-08-23 Erik de Castro Lopo - - * acinclude.m4 configure.ac ... - Get rid of acinclude.m4 and replace it with an M4 directory. - -2007-08-21 Erik de Castro Lopo - - * src/sndfile.h.in - Remove crufty Metrowerks compiler support. Allow header file to be compiled - on windows with both GCC and microsoft compiler. - -2007-08-19 Erik de Castro Lopo - - * tests/dft_cmp.[ch] tests/floating_point_test.tpl - Clean up floating point tests. - -2007-08-14 Erik de Castro Lopo - - * src/aiff.c - Fix segfault when COMM chunk length is byte swapped. - -2007-08-09 Erik de Castro Lopo - - * src/common.h src/mat4.c src/mat5.c src/sndfile.c - Add a generic SFE_CHANNEL_COUNT_ZERO error, remove format specific errors. - - * src/au.c - Fix crash on AU files with zero channel count. Reported by Ben Alison. - -2007-08-08 Erik de Castro Lopo - - * src/voc.c - Fix bug in handling file supplied by Matt Olenik. - -2007-07-31 Erik de Castro Lopo - - * src/OGG - Merge from OGG upstream sources. - -2007-07-25 Erik de Castro Lopo - - * src/FLAC - Merge from FLAC upstream sources. - -2007-07-15 Erik de Castro Lopo - - * src/flac.c - Fix memory leak; set copy parameter to FALSE in call to - FLAC__metadata_object_vorbiscomment_append_comment. - - * src/common.[ch] - Add function psf_rand_int32(). - -2007-07-14 Erik de Castro Lopo - - * src/FLAC - Merge from FLAC upstream sources. - - * src/strings.c tests/string_test.c tests/Makefile.am - Make sure string tests for SF_STR_LICENSE actually works. - -2007-07-13 Erik de Castro Lopo - - * tests/string_test.c - Add ability to test strings stored in metadata secion of FLAC files. - - * src/string.c - Fix logic for testing if audio data has been written and string is added. - Make sure SF_STR_ALBUM actually works. - - * src/flac.c - Finalize reading/writing string metadata. Tests pass. - - * src/sndfile.h.in tests/string_test.c src/flac.c - Add string type SF_STR_LICENSE, update test and use for FLAC files. - - * src/sndfile.h.in - Add definition for SFC_SET_SCALE_FLOAT_INT_WRITE command. - - * src/common.h src/double64.c src/float32.c src/sndfile.c - Add support for SFC_SET_SCALE_FLOAT_INT_WRITE (still needs testing). - -2007-07-12 Erik de Castro Lopo - - * src/flac.c - Apply patch from Ed Schouten to read artist and title metadata from FLAC - files. - Improve reporting of FLAC metadata. - - * src/sndfile.h.in tests/string_test.c src/flac.c - Add string type SF_STR_ALBUM, update test and use for FLAC files. - -2007-06-28 Erik de Castro Lopo - - * src/FLAC/* - Merge from upstream CVS. - -2007-06-16 Erik de Castro Lopo - - * src/FLAC/* - Update from upstream CVS. - -2007-06-14 Erik de Castro Lopo - - * tests/cpp_test.cc - Add extra tests for when the SndfileHandle constructor fails. - - * src/sndfile.hh - Make sure failure to open the file in the constructor does not allow later - calls to other methods to fail. - -2007-06-10 Erik de Castro Lopo - - * tests/util.tpl - Add function write_mono_file. - - * tests/generate.[ch] tests/Makefile.am - Add files generate.[ch] and hook into build. - - * tests/write_read_test.tpl - Add multi_seek_test. - - * src/flac.c - Fix buffer overflow bug. Test provided by Jeremy Friesner and fix provided - by David Viens. - -2007-06-07 Erik de Castro Lopo - - * doc/FAQ.html - Minor update. - - * configure.ac src/FLAC/src/libFLAC/ia32/Makefile.am src/Makefile.am - Apply patch from Trent Apted make it compile on Intel MacOSX. Thanks Trent. - -2007-05-28 Erik de Castro Lopo - - * src/wav.c - Fix writing of MSGUID subtypes. Thanks to Bruce Sharpe. - -2007-05-22 Erik de Castro Lopo - - * src/wav.c - Fix array indexing bug raised by Bruce Sharpe. - -2007-05-12 Erik de Castro Lopo - - * src/FLAC/src/share/getopt/getopt.c - Fix Mac OSX / PowerPC compile warnings. - - * configure.ac - Make sure WORDS_BIGENDIAN gets correctly defined for FLAC code. - -2007-05-04 Erik de Castro Lopo - - * doc/FAQ.html - Add Q/A about MP3 support. - -2007-05-03 Erik de Castro Lopo - - * doc/new_file_type.HOWTO - Minor updates. - -2007-05-02 Erik de Castro Lopo - - * src/wve.c - Fix a couple bad parameters with psf_log_printf. - - * src/pcm.c - Improve error reporting. - - * src/common.h src/common.c - Constify psf_hexdump. - -2007-04-30 Erik de Castro Lopo - - * src/FLAC - Ditch and re-import required FLAC code. - - * configure.ac - Force FLAC__HAS_OGG variable to 1. - - * src/FLAC/src/libFLAC/stream_encoder.c - Fix compiler warnings. - -2007-04-23 Erik de Castro Lopo - - * configure.ac tests/win32_ordinal_test.c - Detect if win32 DLL is beging generated and only run win32_ordinal_test if - true. - - * src/G72x/Makefile.am src/Makefile.am - Use $(EXEEXT) where possible. - -2007-04-18 Erik de Castro Lopo - - * src/wve.c src/common.h src/sndfile.c - Complete definition of SfE_WVE_NO_WVE error message. - - * src/wve.c - Fix error in files generated on big endian systems. Robustify parsing. - -2007-04-16 Erik de Castro Lopo - - * src/double64.c - Fix clipping of double to short conversions on 64 bit systems. - - * src/flac.c regtest/database.c tests/cpp_test.cc - Fix compile warnings for 64 bit systems. - -2007-04-15 Erik de Castro Lopo - - * src/wav.c src/wav_w64.c - Use audio detect function when 'fmt ' chunk data is suspicious. - - * configure.ac - Add ugly hack to remove -Werror from some Makefiles. - -2007-04-14 Erik de Castro Lopo - - * src/GSM610/long_term.c src/macbinary3.c tests/cpp_test.cc - Add patch from André Pang to clean up compiles on OSX. - - * src/wve.c src/common.h src/sndfile.c src/sndfile.h.in - examples/sndfile-convert.c - Merge changes from Reuben Thomas to improve WVE support. - - * tests/lossy_comp_test.c tests/Makefile.am - Add tests for WVE files. - -2007-04-11 Erik de Castro Lopo - - * src/sndfile.hh - Add a static SndfileHandle::formatCheck method as suggested by Jorge - Jiménez. - -2007-04-09 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_error() where the function itself was being compared - against zero. Add a check for a NULL return from peak_info_calloc. Fix a - possible NULL dereference. - -2007-04-07 Erik de Castro Lopo - - * src/flac.c - Turn off seekable flag when writing, return SFE_BAD_RDWR_FORMAT when - opening file for RDWR. - - * src/sndfile.c - Improve error message for SFE_BAD_RDWR_FORMAT. - - * src/mat4.c - Fix array indexing issue. Thanks to Ben Allison (Nullsoft) for alerting me. - -2007-03-05 Erik de Castro Lopo - - * doc/FAQ.html - Add Q/A 19 on project files. - -2007-03-01 Erik de Castro Lopo - - * src/sndfile.c - Guard agains MacOSX universal binary compiles. - - * doc/FAQ.html - Add Q/A 18 and clean up Q3. - -2007-02-22 Erik de Castro Lopo - - * src/aiff.c - Add support for 'in24' files. - -2007-02-13 Erik de Castro Lopo - - * src/wav.c src/wav_w64.c src/wav_w64.h - Start work towards detecting ausio codec type from the actual audio data. - - * src/audio_detect.c src/test_audio_detect.c - Add new file and its unit test. - -2007-02-07 Erik de Castro Lopo - - * examples/cooledit-fixer.c examples/Makefile.am - Remove old broken example program. - -2007-02-06 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py - Add function sf_get_info. - -2007-01-25 Erik de Castro Lopo - - * examples/sndfile-play.c - For ALSA, use the 'default' device instead of 'plughw:0'. - -2007-01-22 Erik de Castro Lopo - - * src/sndfile.c - Allow writing of WAV/WAVEX 'BEXT' chunks in SFM_RDWR mode. - -2007-01-21 Erik de Castro Lopo - - * doc/development.html doc/embedded_files.html man/sndfile-play.1 - Minor documentation fixes. Thanks Reuben Thomas. - -2006-12-16 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add -override-sample-rate command line option. - -2006-11-19 Erik de Castro Lopo - - * tests/misc_test.c - Force errno to zero at start of some tests. - - * src/sndfile.c - Minor clean up of error handling. - - * configure.ac - Remove an assembler test which was failing on OSX. - -2006-11-15 Erik de Castro Lopo - - * src/common.h - Fix the definition of SF_PLATFORM_S64 for MinGW. - - * src/FLAC/Makefile.am src/FLAC/share/grabbag/Makefile.am - Fix path problems for MinGW. - -2006-11-13 Erik de Castro Lopo - - * src/sfendian.h - Add include guard. - - * src/Makefile.am src/flac.c - Clean up include paths. - - * src/test_conversions.c - New file to test psf_binheader_readf/writef functions. - - * src/Makefile.am src/test_file_io.c src/test_log_printf.c src/common.c - Clean up unit testing. - - * src/common.c - Fix a bug reading/writing 64 bit header fields. Thanks to Jonathan Woithe - for reporting this. - - * src/test_conversions.c - Complete unit test for above fix. - -2006-11-11 Erik de Castro Lopo - - * src/sndfile.c - More refactoring to clean up psf_open_file() and vairous sf_open() - functions. - -2006-11-09 Erik de Castro Lopo - - * src/wav.c - Apply a patch from Jonathan Woithe to allow opening of (malformed) WAV - files of over 4 gigabytes. - -2006-11-05 Erik de Castro Lopo - - * src/sndfile.c - Refactor function psf_open_file() to provide a single return point. - - * tests/misc_test.c - Fix permission_test to ensure that read only file can be created. - -2006-11-03 Erik de Castro Lopo - - * src/common.h - Add SF_PLATFORM_S64 macro as a platform independant way of doing signed 64 - bit integers. - - * src/aiff.c src/svx.c src/wav.c - Add warning in log if files are larger than 4 gigabytes in size. - -2006-11-01 Erik de Castro Lopo - - * src/FLAC src/OGG confgure.ac src/Makefile.am - Pull in all required FLAC and OGG code so external libraries are not - needed. This makes compiling on stupid fscking Windoze easier. - -2006-10-27 Erik de Castro Lopo - - * src/sd2.c - Add workaround for switched sample rate and sample size. - - * src/wav.c - Add workaround for excessively long coding history in the 'bext' chunk. - -2006-10-23 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c src/wav.c doc/command.html - Use SF_AMBISONIC_* instead of SF_TRUE/SF_FALSE. - -2006-10-22 Erik de Castro Lopo - - * src/sndfile.h.in src/wav.c src/wav_w64.c src/common.h doc/command.html - Apply a patch from Fons Adriaensen to allow writing on WAVEX Ambisonic - files. Still needs a little tweaking before its ready for release. - - * src/*.c - Use the UNUSED macro to prevent compiler warnings. - -2006-10-19 Erik de Castro Lopo - - * src/aiff.c - Fix a bug in parsing AIFF files with a slightly unusual 'basc' chunk. Thanks - to David Viens for providing two example files. - - * src/common.(c|h) src/aiff.c - Add a function psf_sanitize_string and use it in aiff.c. - -2006-10-18 Erik de Castro Lopo - - * src/wav_w64.c - Apply a patch from Fons Adriaensen which fixes a minor WAVEX GUID issue. - -2006-10-17 Erik de Castro Lopo - - * src/Makefile.am - Fix problem related to recent test coverage changes. - -2006-10-15 Erik de Castro Lopo - - * configure.ac tests/Makefile.am - Add --enable-test-coverage configure option. - -2006-10-05 Erik de Castro Lopo - - * src/sndfile.hh - Add an std::string SndfileHandle constructor. - - * tests/scale_clip_test.tpl - Fix the 'make distcheck' target. - -2006-10-03 Erik de Castro Lopo - - * src/double64.c src/float32.c - Add optional clipping on float file data to int read data conversions. - - * tests/tests/scale_clip_test.(def|tpl) - Add test for above new code. - -2006-09-06 Erik de Castro Lopo - - * tests/aiff_rw_test.c - Add 'MARK' chunks to make sure they are parsed correctly. - -2006-09-05 Erik de Castro Lopo - - * src/aiff.c - Fix parsing of MARK chunks. Many thanks to Sciss for generating files to - help debug the problem. - -2006-09-02 Erik de Castro Lopo - - * src/common.h - Make the SF_MIN and SF_MAX macros at least partially type safe. - - * tests/lossy_comp_test.c - Fix overflow problems when ensuring that signalis not zero. - -2006-08-31 Erik de Castro Lopo - - * configure.ac docs/*.html - Changes for release 1.0.17. - -2006-08-08 Erik de Castro Lopo - - * src/flac.c - Remove inline from functions called by pointer. Thanks to Sampo Savolainen - for notifying me of this. - -2006-07-31 Erik de Castro Lopo - - * src/sndfile.hh - Add writeSync method. - Add copy constructor and assignment operator (thanks Daniel Schmitt). - Add methods readRaw and writeRaw. - Make read/write/readf/writef simple overlaods instead of templates (thanks - to Trent Apted for suggesting this). - - * tests/cpp_test.cc - Cleanup. Add tests. - -2006-07-30 Erik de Castro Lopo - - * src/sndfile.hh - Templatize the read/write/readf/writef methods as suggested by Lars Luthman. - Prevent the potential leak of SNDFILE* pointers in the openRead/openWrite/ - openReadWrite methods. - Add const to SF_INFO pointer in Sndfile constructor. - Make the destrictor call the close() method. - - * tests/cpp_test.cc - Add more tests. - -2006-07-29 Erik de Castro Lopo - - * tests/cpp_test.cc - Remove the generated file so "make distcheck" passes. - - * src/Makefile.am - Add sndfile.hh to distributed header files. - - * src/sndfile.hh - Change the license for the C++ wrapper to modified BSD. - -2006-07-28 Erik de Castro Lopo - - * src/sndfile.hh - Complete it. - - * tests/cpp_test.cc - Add more tests. - -2006-07-27 Erik de Castro Lopo - - * tests/utils.tpl - Add extern C to generated header file. - - * src/sndfile.hh - Work towards completing this. - - * tests/cpp_test.cc tests/Makefile.am - Add a C++ test and hook into build. - - * configure.ac - Add appropriate CXXFLAGS. - -2006-07-26 Erik de Castro Lopo - - * configure.ac - Test if compiler supports -Wpointer-arith. - - * src/common.c - Fix a warning resulting from -Wpointer-arith. - -2006-07-15 Erik de Castro Lopo - - * examples/sndfile-play.c - Explicitly set endian-ness as well as setting 16 bit output. - - * examples/sndfile-info.c - Make sure to parse info if file fails to open. - - * src/sndfile.c - Handle parse error a little better. - - * src/wav_w64.[ch] - Minor clean up, add detection of IPP ITU G723.1. - -2006-06-23 Erik de Castro Lopo - - * src/sndfile.c - Make sure psf->dataoffset gets reset to zero when openning headersless - files based on the file name extension. - -2006-06-21 Erik de Castro Lopo - - * tests/(command|lossy_comp|pcm|scale_clip)_test.c tests/fix_this.c - tests/write_read_test.(tpl|def) - Fix gcc-4.1 compiler warnings about "dereferencing type-punned pointer will - break strict-aliasing rules". - - * examples/cooledit-fixer.c - More fixes like above. - -2006-06-20 Erik de Castro Lopo - - * src/file_io.c - Fix a windows bug where the syserr string of SF_PRIVATE was not being set - correctly. - - * src/sndfile.c - Fixed a logic bug in sf_seek(). Thanks to Paul Davis for finding this. - -2006-06-04 Erik de Castro Lopo - - * configure.ac - Fixed detection of S_IRGRP. - -2006-05-30 Erik de Castro Lopo - - * sndfile-convert.c - Add conversion SF_INSTRUMENT data when present. - -2006-05-22 Erik de Castro Lopo - - * doc/development.html - Removed references to tla on windows. - - * src/common.h src/sndfile.c - Add separate void pointers for file containter and file codec data to - SF_PRIVATE struct. Still need to move all existing fdata pointers. - - * tests/write_read_test.tpl - Change the order of some tests. - - * src/aiff.c - When writing 'AIFC' files, make sure get an 'FVER' gets added. - - * src/common.h src/(dwvw|flac|g72x|gsm610|ima_adpcm|ms_adpcm|paf|sds).c - src/(sndfile|voc|vox_adpcm|xi).c - Remove fdata field from SF_PRIVATE struct and replace it with codec_data. - -2006-05-10 Erik de Castro Lopo - - * Win32/testprog.c Win32/Makefile.am - Add a minimal win32 test program. - - * Win32/README-precompiled-dll.txt Mingw-make-dist.sh - Update readme and Mingw build script. - -2006-05-09 Erik de Castro Lopo - - * configure.ac acinclude.m4 - Minor fixes for Solaris. - -2006-05-05 Erik de Castro Lopo - - * src/test_endswap.(def|tpl) - Fix printf formatting for int64_t on 64 bit machines. - -2006-05-04 Erik de Castro Lopo - - * src/binhead_check.py - New file to check for bad parameters passed to psf_binheader_writef(). - - * src/Makefile.am - Hook into test suite. - - * src/voc.c src/caf.c src/wav.c src/mat5.c src/mat4.c - Fix bugs found by new test program. - - * src/double64.c - Clean up double64_get_capability(). - -2006-05-03 Erik de Castro Lopo - - * src/wav_w64.c - Fix a bug on x86_64 where an int was being passed via stdargs and being - read using size_t which is 64 bits. Thenks to John ffitch for giving me a - login on his box. - -2006-05-02 Erik de Castro Lopo - - * src/caf.c src/double64.c examples/sndfile-info.c tests/virtual_io_test.c - tests/utils.tpl - Fix a couple of signed/unsigned problems. - -2006-05-01 Erik de Castro Lopo - - * tests/command_test.c - Add channel map tests. - - * src/common.h src/sndfile.c - Add a pointer the the SF_PRIVATE struct and make sure it gets freed in - sf_close(). - -2006-04-30 Erik de Castro Lopo - - * configure.ac doc/(command|index|api).html NEWS README - Updates for 1.0.16 release. - - * src/sndfile.h.in - Define enums for channel mapping. - - * examples/sndfile-info.c - Clean up usage of SF_INFO struct. - -2006-04-29 Erik de Castro Lopo - - * tests/util.tpl - Add function testing function exit_if_true(). - - * tests/floating_point_test.tpl - Fix a problem where the test program was not exiting when the test failed. - -2006-04-15 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.c - Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS. - - * doc/commands.html - Document new commands. Other minor updates. - - * tests/peak_chunk_test.c - Update tests for new commands. - -2006-04-02 Erik de Castro Lopo - - * tests/peak_chunk_test.c - Add test for RIFX and WAVEX files. - Try and confuse the PEAK chunk writing by enabling and disabling it. - - * src/sndfile.c - Fix a bug where enabling and disabling PEAK chunk was screwing up. - -2006-03-31 Erik de Castro Lopo - - * src/sndfile.h.in - Add the block of 190 reserved bytes into this struct to allow for - future expansion. - - * src/wav.c src/sndfile.c src/broadcast.c - Significant cleanup of broadcast wave stuff. - - * examples/sndfile-info.c - Fix print message. - - * tests/command_test.c tests/Makefile.am - Complete bext tests, hook test in test suite. - -2006-03-30 Erik de Castro Lopo - - * src/sndfile.h.in - Make coding_history field of SF_BROADCAST_INFO struct a char array instead - of a char pointer. - - * src/sndfile.c src/common.h src/wav.c - Clean up knock on effects of above chnage. - - * examples/sndfile-info.c - Add -b command line option to usage message. - Clean up output of broadcast wave info. - - * src/wav.c - Ignore and skip the 'levl' chunk. - -2006-03-26 Erik de Castro Lopo - - * configure.ac - Fix handling of --enable and --disable configure args. Thanks to Diego - 'Flameeyes' Pettenò who sent the patch. - -2006-03-22 Erik de Castro Lopo - - * doc/win32.html - Make it really clear that although the MSVC++ cannot compile libsndfile, - the precompiled DLL can be used in C++ programs compiled with MSVC++. - -2006-03-18 Erik de Castro Lopo - - * src/aiff.c - Fix bug in writing of INST chunk in AIFF files. - Fix potential bug in writing MARK chunks. - - * src/sndfile.c - Make sure the instrument chunk can only be written at the start of the file. - - * tests/command_test.c - Add check of log buffer. - - * tests/utils.tpl - Add usage of space character to psf_binheader_writef. - -2006-03-17 Erik de Castro Lopo - - * src/Makefile.am tests/Makefile.am - Remove --source-time argument from autogen command lines. - - * src/broadcast.c - New file for EBU Broadcast chunk in WAV files. - - * src/sndfile.c src/sndfile.h.in src/wav.c src/common.h - Add patch from Paul Davis implementing read/write of the BEXT chunk. - -2006-03-16 Erik de Castro Lopo - - * Win32/README-precompiled-dll.txt - New file descibing how to use the precompiled DLL. - - * Win32/Makefile.am - Add Win32/README-precompiled-dll.txt to EXTRA_DIST files. - - * configure.ac - Bump version to 1.0.15. - -2006-03-11 Erik de Castro Lopo - - * src/wav.c - On read, only add the endian flag if the file is big endian. - - * src/ms_adpcm.c - Fixed writing of APDCM coeffs in RIFX files. - - * tests/write_read_test.tpl tests/lossy_comp_test.c - Add tests for RIFX files. - -2006-03-10 Erik de Castro Lopo - - * Mingw-make-dist.sh - Bunch of improvements. - - * doc/win32.html - Update MinGW program versions. - -2006-03-09 Erik de Castro Lopo - - * src/create_symbols_file.py - Fix the library name in created win32 DEF file. Add correct DLL name for - Cygwin DLL. - - * Win32/Makefile.am tests/Makefile.am - Remove redundant files, add win32_ordinal_test to test suite. - - * tests/win32_ordinal_test.c - Update to do test in cygsndfile-1.dll as well. - - * doc/win32.html - Fix typo, mention that -mno-cygwin with the Cygwin compiler does not work. - - * src/wav.c src/wav_w64.c src/sndfile.c src/sndfile.h.in - Apply large patch from Jesse Chappell which adds support for RIFX files. - -2006-03-08 Erik de Castro Lopo - - * Makefile.am - Add Mingw-make-dist.sh to the extra dist files. - - * configure.ac - Fix setting SHLIB_VERSION_ARG for MinGW. - - * tests/win32_ordinal_test.c - New test program to test that the win32 DLL ordinals agree with the DEF - file. - -2006-03-04 Erik de Castro Lopo - - * src/common.h - Add a static inline function to convert an int to a size_t. This will be - a compile to nothing on 32 bit CPUs and a sign extension on 64 bit CPUs. - - * src/aiff.c src/avr.c src/common.c src/xi.c src/gsm610.c - Fix an ia64 problem where a varargs function was being passed an int in - some places and a size_t in other places. - - * src/sd2.c - Add a workaround for situations where OSX seems to add an extra 0x52 bytes - to the start of the resource fork. - -2006-02-19 Erik de Castro Lopo - - * Mingw-make-dist.sh - Add a shell script to build the windows binary/source ZIP file. - - * doc/index.html - Add download link for windows binary/source ZIP file. Add links for GPG - signatures. - - * doc/win32.html - Remove info about building using microsoft compiler. - - * configure.ac - Bump version to 1.0.14. - -2006-02-11 Erik de Castro Lopo - - * src/sd2.c - Improve logging of errors in resource fork parser. - -2006-01-31 Erik de Castro Lopo - - * Win32/Makefile.msvc - Replace au_g72x.* with g72x.*. Thanks to ussell Borogove. - -2006-01-29 Erik de Castro Lopo - - * src/common.c - Make sure return values are initialised header buffer is full. - - * src/wav.c - Add workarounds for messed up WAV files. - -2006-01-21 Erik de Castro Lopo - - * Win32/config.h - Undef HAVE_INTTYPES_H for win32. - - * tests/command_test.c - Don't exit on error in instrument test for XI files. - - * configure.ac - Bump version to 1.0.13. - - * doc/*.html NEWS README - Update version numbers. - -2006-01-19 Erik de Castro Lopo - - * src/xi.c - Start work on add read/write of instrument chunks. - - * src/command_test.c - Add tests for XI instrument chunk. - - * tests/largefile_test.c tests/Makefile.am - Add new test and hook it into the build system. This test will not be run - automatically because it requires 3 Gig of disk space and takes 3 minutes - to run. - -2006-01-10 Erik de Castro Lopo - - * examples/sndfile-play.c - Fix calculation of samples remaining in win32 code. Thanks Axel Röbel. - - * src/common.h - Make sure length of header buffer can hold header plus strings. Thanks Axel - Röbel. - -2006-01-09 Erik de Castro Lopo - - * src/sndfile.h.in src/aiff.c src/wav.c - Apply a patch from John ffitch (Csound project). - Add detune field to SF_INSTRUMENT struct. - Add reading/writing instrument chunks to WAV files. - - * tests/command_test.c - Update SF_INSTRUMENT tests. - - * tests/Makefile.am - Hook instrument tests into test suite. - -2006-01-05 Erik de Castro Lopo - - * configure.ac - Check for because some broken systems (like Solaris) don't have - which is the 1999 ISO C standard file containing int64_t. - - * src/sfendian.h src/common.h - Use if is not available. - -2005-12-30 Erik de Castro Lopo - - * tests/peak_chunk_test.c - Extend and clean up tests. - - * src/sndfile.c - Fix a bug that prevented the turning off of PEAK chunks. - -2005-12-29 Erik de Castro Lopo - - * tests/error_test.c - Make the test distclean correct. - - * src/file_io.c - Fix an SD2 MacOSX bug (reported by vince schwarzinger). - -2005-12-28 Erik de Castro Lopo - - * src/aiff.c tests/command_test.c - Apply a big patch from John ffitch (Csound project) to add reading and - writing of instrument chunks to AIFF files. Also update the test. - -2005-12-10 Erik de Castro Lopo - - * tests/aiff_rw_test.c tests/virtual_io_test.c tests/utils.tpl - Move test function dump_data_to_file() to utils.tpl. - - * tests/error_test.c tests/Makefile.am - Updates, including a new test to test that sf_error() returns a valid error - number. - -2005-12-07 Erik de Castro Lopo - - * examples/list_formats.c - Make sure the SF_INFO struct is memset to all zero before being used. - Thanks to Stephen F. Booth. - - * src/sndfile.c - Make the return value of sf_error() match the API documentation. - -2005-11-19 Erik de Castro Lopo - - * examples/sndfile-convert.c - Allow conversion to raw gsm610. - - * src/common.h src/sndfile.c src/au.c - Remove au_nh_open() and all references to it (wasn't working anyway). - - * tests/headerless_test.c - Add new test for file extension based detection. - - * src/sndfile.c - Rejig file extension based file type detection. - -2005-11-16 Erik de Castro Lopo - - * src/sndfile.c - Add "gsm" as a recognised file extension when no magic number can be found. - - * tests/lossy_comp_test.c tests/Makefile.am - Test headerless GSM610. - -2005-11-13 Erik de Castro Lopo - - * doc/api.html - Fix a minor typo and a minor error. Thanks Christoph Kobe and John Pavel. - -2005-10-30 Erik de Castro Lopo - - * src/wav_w64.c - Add more reporting of 'fmt ' chunk for G721 encoded files. - - * src/wav.c - Gernerate a more correct 20 byte 'fmt ' chunk rather than a 16 byte one. - -2005-10-29 Erik de Castro Lopo - - * src/G72x/g72x.[ch] - Minor cleanup of interface. - -2005-10-28 Erik de Castro Lopo - - * src/ogg.c - Removed the horribly broken and non-functional OGG implementation when - --enable-experimental was enabled. When OGG does finally work it will be - merged. - - * src/caf.c - Fix a memory leak. - -2005-10-27 Erik de Castro Lopo - - * src/g72x.c src/G72x/*.(c|h) src/common.h src/sndfile.c src/wav.c src/au.c - Add support for G721 encoded WAV files. - - * doc/index.html - Update support matrix. - - * tests/lossy_comp_test.c - For file formats that support it, add string data after the audio data and - make sure it isn't treated as audio data on read. - - * src/gsm610.c - Add code to ensure that the container close function (ie for WAV files) gets - called after the codec's close function. This allows GSM610 encoded WAV files - to have string data following the audio data. - Add an AIFF specific check on psf->datalength. - - * src/wav.c - Simplify wav_close function. - - * src/aiff.c - Make sure the tailer data gets written at an even file offset. Pad if - necessary. - - * src/common.h - Replace the close function pointer in SF_PRIVATE with separate functions - codec_close and container_close. The former is always called first. - - * src/*.c - Fix knock on effects of above. - -2005-10-26 Erik de Castro Lopo - - * examples/sndfile-info.c - Complete dumping SF_INSTRUMENT data. - - * src/dwvw.c src/ima_adpcm.c src/gsm610.c src/ms_adpcm.c - Add extra checks in *_init function. - - * tests/lossy_comp_test.c - Add a string comment to the end of the files to make sure that the decoder - doesn't decode beyond the end of the audio data section. - -2005-10-25 Erik de Castro Lopo - - * examples/sndfile-info.c - Minor code cleanup. - Start work on dumping SF_INSTRUMENT data. - -2005-10-23 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/common.c - Update definition of SF_INSTRUMENT struct and create a function to allocate - and initialize the struct (input from David Viens). - Clean up definition of SF_INSTRUMENT struct. - - * src/wav.c src/wav_w64.c - Add support for Ambisoncs B WAVEX files (David Viens). - - * src/aiff.c src/wav.c src/wav_w64.c - Start work on reading/writing the SF_INSTRUMENT data. - - * src/sndfile.c - Add code to get and set SF_INSTRUMENT data. - - * tests/command_test.* tests/Makefile.am - Add test for set and getof SF_INSTRUMENT data. - The file command_test.c is no longer autogen generated. - -2005-10-15 Erik de Castro Lopo - - * src/gsm610.c - Minor cleanup. - -2005-10-14 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Minor cleanup. - -2005-10-13 Erik de Castro Lopo - - * src/*.c - Ensure sfconfig.h is included before any other header file. - - * src/file_io.c - Add comments documenting the three sections of the file. - - * src/gsm610.c - Make sure SF_FORMAT_WAVEX are handled correctly. - -2005-10-07 Erik de Castro Lopo - - * configure.ac - Add options to allow disabling of FLAC and ALSA. Suggested by Ben Greear. - -2005-09-30 Erik de Castro Lopo - - * tests/locale_test.c - Modify the way the unicode strings were encoded so that older compilers - do not complain. Thanks Axel Röbel. - - * configure.ac - Bump the version to 1.0.12 for release. - - * NEWS README Win32/config.h doc/(FAQ|index.html|command|api).html - Update version numbers. - -2005-09-26 Erik de Castro Lopo - - * src/flac.c - Fix valgrind error and minor cleanup. - -2005-09-25 Erik de Castro Lopo - - * src/(au|paf|aiff|w64|wav|svx).c - Make sure structs are initialised. - -2005-09-24 Erik de Castro Lopo - - * configure.ac - Make -Wdeclaration-after-statement work with --enable-gcc-werror configure - option. - Add -std=gnu99 (C99 plus posix style stuff like gmtime_r) to CFLAGS if the - compiler supports it. - -2005-09-23 Erik de Castro Lopo - - * configure.ac acinclude.m4 - Add -Wdeclaration-after-statement to CFLAGS if the compilers supports it. - -2005-09-22 Erik de Castro Lopo - - * tests/util.(tpl|def) - Make the test_write_*_or_die() functions const safe. - -2005-09-21 Erik de Castro Lopo - - * src/nist.c - Make sure the data offset is read from the file header. Thanks to - David A. van Leeuwen for a patch. - -2005-09-20 Erik de Castro Lopo - - * configure.ac src/sfconfig.h - Check for and the function setlocale(). - Set config variables to zero if not found. - - * tests/locale_test.c tests/Makefile.am - Add new test program and hook into build/test system. - -2005-09-18 Erik de Castro Lopo - - * src/common.h src/file_io.c - On windows, use windows specific types for file handles. - Add functions psf_init_files() and psf_use_rsrc(). - - * src/sd2.c - Make resource fork handling independant of file desciptor/handles. - - * src/sndfile.c src/test_file_io.c - Fix knock on effects. - -2005-09-06 Erik de Castro Lopo - - * src/float_cast.h - The lrint and lrintf implementations in Cygwin are both buggy and slow. - Add replacements which were pulled from the Public Domain MinGW math.h - header file. - -2005-09-05 Erik de Castro Lopo - - * tests/(lossy_comp_test|virtual_io_test).c - More Valgrind fixups. - - * configure.ac - Simplify and correct configuring for Cygwin. - - * Win32/config.h Win32/sndfile.h Win32/Makefile.msvc - Update build for MSVC. - -2005-09-04 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Make sure to close SNDFILE when exiting test when file format is not seekable. - - * tests/(aiff_rw_test|virtual_io_test).c - Do a few valgrind fix ups. - -2005-09-03 Erik de Castro Lopo - - * src/float32.c src/double64.c - Replace floating point equality comparisons with greater/less comparisons. - Found by John Pavel using the Intel compiler. - - * src/sfconfig.h - New file to clean up issues surrounding autoconf generated preprocessor - symbols. - - * src/*.(c|h) tests/*.(c|tpl) examples/*.c - Fixed a bunch of other stuff found by John Pavel using the Intel compiler. - - * src/file_io.c - Remove Mac OS9 Metrowerks compiler specific hacks. - -2005-08-31 Erik de Castro Lopo - - * src/w64.c - Cast integer literal to sf_count_t in call to psf_binheader_writef() to - prevent Valgrind error. - -2005-08-30 Erik de Castro Lopo - - * doc/command.html - Improve documentation of SF_GET_FORMAT_SUBTYPE. - -2005-08-26 Erik de Castro Lopo - - * examples/sndfile-convert.c - Allow files to be converted to SD2 format. - - * src/sd2.c - Fix a bug in reading and writing of SD2 files on little endian CPUs. - Thanks to Matthew Willis for finding this. - -2005-08-25 Erik de Castro Lopo - - * doc/api.html - Update Note2 to point to SFC_SET_SCALE_FLOAT_INT_READ. - -2005-08-16 Erik de Castro Lopo - - * configure.ac - Use $host_os instead of $target_os (thanks to Mo De Jong). - -2005-08-15 Erik de Castro Lopo - - * src/Makefile.am - Apply a patch from Mo DeJong to allow building outside of the source dir. - - * src/file_io.c - Fix psf_fsync() for win32. - - * src/wav.c src/wav_w64.(c|h) - Move some code from wav.c to wav_w64.c to improve the log output of files of - type WAVE_FORMAT_EXTENSIBLE. - -2005-08-10 Erik de Castro Lopo - - * src/create_symbols_file.py - Make sure sf_write_fsync is an exported symbol. - - * examples/sndfile-convert.c - Add support for writing VOX adpcm files. - -2005-07-31 Erik de Castro Lopo - - * doc/api.html - Document the new function sf_write_sync(). - - * doc/FAQ.html - Do you plan to support XYZ codec. - -2005-07-28 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Add function sf_write_sync() to the API. - - * src/common.h src/file_io.c - Low level implementation (win32 not done yet). - - * tests/write_read_test.tpl - Use the new function in the tests. - -2005-07-24 Erik de Castro Lopo - - * src/common.h src/double64.c src/float32.c src/sndfile.c - Change the way PEAK chunk info is stored. Peaks now stored as an sf_count_t - for position and a double as the value. - - * src/aiff.c src/caf.c src/wav.c - Fix knock on effects of above changes. - - * src/caf.c - Implement 'peak' chunk for file wuth data in SF_FORMAT_FLOAT or - SF_FORMAT_DOUBLE format. - -2005-07-23 Erik de Castro Lopo - - * src/nist.c - Fix a bug where a variable was being used without being initialized. - - * src/flac.c - Add extra debug in sf_flac_meta_callback. - Make a bunch of private functions static. - - * src/aiff.c src/wav.c - Fix allocation for PEAK_CHUNK (bug found using valgrind). - -2005-07-21 Erik de Castro Lopo - - * src/common.h - Move the peak_loc field of SF_PRIVATE to the PEAK_CHUNK struct. - Remove had_peak field of SF_PRIVATE, use pchunk != NULL instead. - Rename PEAK_CHUNK and PEAK_POS to PEAK_CHUNK_32 and PEAK_POS_32. - - * src/aiff.c src/caf.c src/wav.c src/float32.c src/double64.c - Fix knock on effects from above. - -2005-07-19 Erik de Castro Lopo - - * src/wav.c - Prevent files with unknown chunks from being opened read/write. - -2005-07-14 Erik de Castro Lopo - - * src/flac.c - Do not use psf->end_of_file because it never gets set to anything. - - * src/common.h - Remove unused SF_PRIVATE field end_of_file. - -2005-07-12 Erik de Castro Lopo - - * src/common.c - Change the 'S' format specifier of psf_binheader_writef() to write AIFF - style strings (no terminating character). - - * src/aiff.c - Move to new (correct) AIFF string style. Thanks to Axel Röbel for being - so persistent on this issue. - -2005-07-11 Erik de Castro Lopo - - * src/sndfile.c - Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open(). - - * doc/api.html doc/command.html - Documentation updates (thanks to Kyroz for promoting these updates). - - * src/mat5.c - Modify the way the header is written. - -2005-07-10 Erik de Castro Lopo - - * src/caf.c - Add a 'free' chunk to the written file so that the audio data starts at - an offset of 0x1000. - - * src/sndfile.c - Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open(). - -2005-07-09 Erik de Castro Lopo - - * src/caf.c src/sndfile.c - Add support for signed 8 bit integers. - - * tests/write_read_test.tpl - Add test for signed 8 bit integers in CAF files. - - * doc/index.html - Update matrix for signed 8 bit integers in CAF files. - -2005-07-08 Erik de Castro Lopo - - * src/sndfile.c - Update sf_check_format() to support CAF. - - * examples/sndfile-convert.c - Add support for ".caf" file extension. - - * doc/index.html - Add Apple CAF to the support matrix. - - * src/caf.c - Add file write support. - - * src/common.c - Fix printing of Frames. - - * tests/Makefile.am tests/write_read_test.tpl tests/lossy_comp_test.c - tests/header_test.tpl misc_test.c - Add tests for CAF files. - -2005-07-07 Erik de Castro Lopo - - * doc/FAQ.html - Fix Q/A about reading/writing memory buffers. - - * src/caf.c - Bunch of work to support reading of CAF files. - -2005-07-04 Erik de Castro Lopo - - * src/(aiff|ima_adpcm|mat4|mat5|ms_adpcm).c examples/sndfile-play.c - Fix sign conversion errors reported by gcc-4.0. - - * src/caf.c - New file for Apple's Core Audio File format. - - * src/sndfile.c src/common.h src/sndfile.h.in src/Makefile.am - Hook new file into build system. - -2005-06-21 Erik de Castro Lopo - - * src_wav_w64.c - Fix handling of stupidly large 'fmt ' chunks. Thanks to Vadim Berezniker - for supplying an example file. - - * src/common.h src/sndfile.c - Remove redundant error code SFE_WAV_FMT_TOO_BIG. - -2005-06-20 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c - Add public error value SF_ERR_MALFORMED_FILE. - - * src/sndfile.c - When parsing a file header fails and we don't have a system error, then set - the error number to SF_ERR_MALFORMED_FILE (suggested by Kyroz). - - * configure.ac - Allow sqlite support to be disabled in configure script. - - * regtest/database.c regtest/sndfile-regtest.c - Fix compiling when sqlite is missing. - -2005-06-11 Erik de Castro Lopo - - * src/file_io.c - Fix psf_is_pipe() and return value of psf_fread() when using virtual i/o. - - * src/sndfile.c - Fix VALIDATE_AND_ASSIGN_PSF macro for virtual i/o. - - * tests/virtual_io_test.c - Fill in skeleton test program. - - * tests/Makefile.am - Move virtual i/o tests to end of tests with stdio/pipe tests. - - * src/(sndfile.h.in|file_io.c|common.h|sndfile.c) tests/virtual_io_test.c - Rename some of the virtual i/o functions and data types. - -2005-06-10 Erik de Castro Lopo - - * src/sndfile.c - Fix the return values of sf_commands : SFC_SET_NORM_DOUBLE, - SFC_SET_NORM_FLOAT, SFC_GET_LIB_VERSION and SFC_GET_LOG_INFO. Thanks to - Kyroz for pointing out these errors. - - * doc/command.html - Correct documented return values for SFC_SET_NORM_DOUBLE and - SFC_SET_NORM_FLOAT. Thanks to Kyroz again. - -2005-05-17 Erik de Castro Lopo - - * regtest/* - Add new files for sndfile-regtest program. - - * configure.ac Makefile.am - Hook regetest into build. - - * src/wav.c src/common.c - Fix a regression where long ICMT chunks were causing the WAV parser - to exit. - -2005-05-15 Erik de Castro Lopo - - * libsndfile.spec.in - Add html docs to the files section as suggested by Karsten Jeppesen. - - * src/aiff.c - Fix parsing of odd length ANNO chunks. - -2005-05-13 Erik de Castro Lopo - - * src/common.h - Change the include guard to prevent clashes with other code. - -2005-05-12 Erik de Castro Lopo - - * examples/sndfile-play.c - Improve error handling in code for playback under Linux/ALSA. - -2005-05-10 Erik de Castro Lopo - - * src/ircam.c - Fix writing of IRCAM files on big endian systems (thanks to Axel Röbel). - - * src/wav.c - Add workaround for files created by the Peak audio editor on Mac which can - produce files with very short LIST chunks (thanks to Jonathan Segel who - supplied the file). - -2005-04-30 Erik de Castro Lopo - - * src/aiff.c - Apply a patch From David Viens to make the parsing of basc chunks more - robust. - - * src/wav.c - Another patch from David Viens to write correct wavex channel masks for - the most common channel configurations. - -2005-04-08 Erik de Castro Lopo - - * src/command.c - Only allow FLAC in the format arrays if FLAC is enabled. Thanks to - Leigh Smith. - -2005-03-09 Erik de Castro Lopo - - * src/common.h - Add a directory field for storing the file directory to the SF_PRIVATE - struct. - - * src/sndfile.c - Grab the directory name when copying the file path. - - * src/file_io.c - Cleanup psf_open_rsrc() and also check for resource fork in - .AppleDouble/filename. - -2005-03-01 Erik de Castro Lopo - - * src/svx.c - Fix a bug in the printing of the channel count. Bug reported by Michael - Schwendt. Thanks. - -2005-01-26 Erik de Castro Lopo - - * src/paf.c - Fix a seek bug for 24 bit PAF files. - - * tests/write_read_test.tpl - Update write_read_test to trigger the previously hidden PAF seek bug. - -2005-01-25 Erik de Castro Lopo - - * src/aiff.c src/w64.c src/wav.c - Do not return a header parse error when the log buffer overflows. - Continuing parsing works even on files where the log buffer does overflow. - This avoids a bug on some weirdo WAV (and other) files. - - * src/common.h src/sndfile.c - Remove SFE_LOG_OVERRIN error and its associated error message. - - * src/file_io.c - Fix a rsrc fork problem on MacOSX. - -2004-12-31 Erik de Castro Lopo - - * src/sndfile-play.c - In the ALSA output code, added call to snd_pcm_drain() just before - snd_pcm_close() as suggested by Thomas Kaeding. - In the OSS output code, added two ioctls (SNDCTL_DSP_POST and - SNDCTL_DSP_SYNC) just before the close of the audio device. - - * tests/virtual_io_test.c tests/Makefile.am - Add a new test program (currently empty) and add it to the build. - -2004-12-29 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.h src/common.h src/file_io.c - src/create_symbols_file.py - Apply patch from Steve Baker which is the beginnings of a virtual - I/O interface. - -2004-12-23 Erik de Castro Lopo - - * src/*.c src/sndfile.h.in - Const-ify the write path throughout the library. - -2004-12-14 Erik de Castro Lopo - - * doc/development.html - Minor improvements. - -2004-11-29 Erik de Castro Lopo - - * doc/bugs.html - Minor improvements. - -2004-11-18 Erik de Castro Lopo - - * src/aiff.c - Add workaround for Logic Platinum AIFF files with broken COMT chunks. - -2004-11-16 Erik de Castro Lopo - - * doc/FAQ.html - Remove some ambiguities in the SD2 FAQ answer. - -2004-11-15 Erik de Castro Lopo - - * Win32/sndfile.h Win32/config.h MacOS9/sndfile.h MacOS9/config.h - Updates from autoconfig versions. - -2004-11-13 Erik de Castro Lopo - - * src/aiff.c - Fix parsing of COMT chunks. Store SF_STR_COMMENT data in ANNO chunks - instead of COMT chunk. - -2004-11-07 Erik de Castro Lopo - - * src/file_io.c src/common.h - Change the ptr argument to psf_write() from "void*" to a "const void*". - Thanks to Tobias Gehrig for suggesting this. - -2004-10-31 Erik de Castro Lopo - - * src/file_io.c src/common.h - Add functions psf_close_rsrc() and read length of resourse fork into - rsrclength field of SF_PRIVATE. - - * src/sd2.c - Make sure resource fork gets closed. - - * tests/util.tpl - Add functions to check for file descriptor leakage. - - * src/write_read_test.tpl - Use the file descriptor leak checks. - - * src/sndfile.h.in - Add SFC_GET_LOOP_INFO and SF_LOOP_INFO struct. - - * src/common.h - Add SF_LOOP_INFO pointer to SF_PRIVATE. - - * src/wav.c src/aiff.c - Improve and add parsing of 'ACID' and 'basc' chunks, filling in - SF_LOOP_INFO data in SF_PRIVATE. - -2004-10-30 Erik de Castro Lopo - - * src/sd2.c - Further cleanup: remove printfs, change snprintf to LSF_SNPRINTF. - - * Win32/config.h Win32/sndfile.h - Updates. - - * tests/util.tpl - Add win32 macro for snprintf. - -2004-10-29 Erik de Castro Lopo - - * src/sfendian.h - Add macros : H2BE_SHORT, H2BE_INT, H2LE_SHORT and H2LE_INT. - - * src/sd2.c - Use macros to make sure writing SD2 files on little endian machines works - correctly. - - * tests/util.tpl - Add a delete_file() function which also deletes the resource fork of SD2 - files. - - * tests/write_read_test.tpl - Use delete_file() so that "make distcheck" works. - -2004-10-28 Erik de Castro Lopo - - * src/sndfile.c src/file_io.c - Move resource filename construction and testing to psf_open_rsrc(). - - * src/common.h src/sndfile.c - Add error SFE_SD2_FD_DISALLOWED. - - * tests/util.tpl tests/*.(c|tpl) - Add and allow_fd parameter to test_open_file_or_die() so that use of - sf_open_fd() can be avoided when opening SD2 files. - -2004-10-27 Erik de Castro Lopo - - * src/wav.c - Update ACID chunk parsing. - - * src/sd2.c - More fixes for files with large resource forks. - -2004-10-23 Erik de Castro Lopo - - * src/common.h src/sndfile.c - Add error numbers and messages for sd2 files. - - * src/sd2.c - Reading of sd2 (resource fork version) now seems to be working. - -2004-10-17 Erik de Castro Lopo - - * src/file_io.h - Update file_io.c to include win32 psf_rsrc_open(). - - * tests/floating_point_test.tpl - Remove use of __func__ in test programs (MSVC++ doesn't grok this). - - * Win32/(config|sndfile).h MacOS9/(config|sndfile).h - Updates. - -2004-10-13 Erik de Castro Lopo - - * src/sfendian.h - Fix endswap_int64_t_(array|copy). - - * src/test_endswap.(tpl|def) - Add tests for above and inprove all tests. - -2004-10-12 Erik de Castro Lopo - - * src/sfendian.h - Improve type safety, add endswap_double_array(). - - * src/double64.c - Use endswap_double_array() instead of endswap_long_array(). - - * src/test_endswap.(tpl|def) src/Makefile.am - Add preliminary endswap tests and hook into build system. - -2004-10-06 Erik de Castro Lopo - - * src/configure.ac src/makefile.am - Finally fix the bulding of DLLs on Win32/MinGW. - - * tests/makefile.am - Fix running of tests on Win32/MinGW. - -2004-10-01 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c tests/floating_point_test.tpl - Rename SFC_SET_FLOAT_INT_MULTIPLIER to SFC_SET_SCALE_FLOAT_INT_READ. - - * doc/command.html - Document SFC_SET_SCALE_FLOAT_INT_READ. - -2004-09-30 Erik de Castro Lopo - - * tests/floating_point_test.(tpl|def) - Derived from floating_point_test.c. - Add (float|double)_(short|int)_test functions. - - * tests/util.(tpl|def) - Make separate float and double versions of gen_windowed_sine(). - - * tests/write_read_test.tpl - Fix after changes to gen_windowed_sine(). - - * src/(float32|double64).c - Implement SFC_SET_FLOAT_INT_MULTIPPLIER. - -2004-09-29 Erik de Castro Lopo - - * acinclude.m4 - Fix warnings from automake 1.8 and later. - - * examples/sndfile-info.c - Add a "fflush (stdout)" after printing Win32 message. - -2004-09-28 Erik de Castro Lopo - - * Win32/Makefile.mingw.in - Add a "make install" target. - -2004-09-24 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c src/command.c - Start work on adding command SFC_SET_FLOAT_INT_MULTIPLIER. - -2004-09-22 Erik de Castro Lopo - - * examples/sndfile-convert.c - Fix a bug converting stereo integer PCM files to float. - -2004-09-22 Erik de Castro Lopo - - * examples/sndfile-play.c - Appy patch from Conrad Parker to make Mac OSX error messages more - consistent and informative. - - * doc/api.html - Fix a HTML HREF which was wrong. - - * doc/win32.html - Add information about when nmake fails. - -2004-09-05 Erik de Castro Lopo - - * examples/sndfile-play.c - Another patch from Denis Cote to prevent race conditions. - -2004-09-02 Erik de Castro Lopo - - * src/common.h src/ms_adpcm.c src/ima_adpcm.c - Fix alternative to ISO standard flexible struct array feature for broken - compilers. - -2004-08-31 Erik de Castro Lopo - - * src/common.h src/string.c src/sndfile.c - Make sf_set_string() return an error if trying to set a string when in - read mode. - -2004-08-29 Erik de Castro Lopo - - * src/common.h - Change the unnamed union into a named union so gcc-2.95 will compile it. - - * src/*.c - Fixes to allow for the above change. - -2004-08-20 Erik de Castro Lopo - - * examples/sndfile-play.c - Fixes for Win32. Thanks to Denis Cote. - - * Win32/Win32/Makefile.(msvc|mingw.in) - Fix build system after removal of sfendian.h. - Build sndfile-convert. - - * src/Makefile.am - Remove sfendian.c from dependancies. - -2004-08-10 Erik de Castro Lopo - - * src/sndfile.h.in - Fix typo in comments (thanks Tommi Sakari Uimonen). - -2004-07-31 Erik de Castro Lopo - - * tests/(a|u)law_test.c - Minor cleanup. - -2004-07-29 Erik de Castro Lopo - - * src/(pcm|float|double64|ulaw|alaw|xi).c - Optimise read/write loops by removing a redundant variable. - -2004-07-24 Erik de Castro Lopo - - * src/file_io.c - Remove call to fsync() in psf_close(). - -2004-07-19 Erik de Castro Lopo - - * src/pcm.c - Inline x2y_array() functions where possible. - - * configure.ac - Detect presence of type int64_t. - - * src/sfendian.c src/sfendian.h - Move functions in the first file to the sfendian.h as static inline - functions. - Improve endswap_long_*() where possible. - -2004-07-17 Erik de Castro Lopo - - * src/pcm.c - When converting from unsigned char to float or double, subtract 128 before - converting to float/double rather than after to save a floating point - operation as suggested by Stefan Briesenick. - - * src/(pcm|sfendian|alaw|ulaw|double64|float32).c - Optimize inner loops by changing the loop counting slightly as suggested - by Stefan Briesenick. - - * configure.ac - Detect presence of . - - * src/sfendian.h - Use if present as suggested by Stefan Briesenick. - - * src/pcm.c - Update bytewapping. - -2004-07-02 Erik de Castro Lopo - - * src/common.h src/*.c - Change the psf->buffer field of SF_PRIVATE into a more type safe union with - double, float, int etc elements. - -2004-06-28 Erik de Castro Lopo - - * examples/sndfile-play.c - Merge slightly modifed patch from Stanko Juzbasic which allows playback of - mono files on MacOSX. - -2004-06-25 Erik de Castro Lopo - - * examples/sndfile-convert.c - Move copy_metadata() after the second sf_open(). - -2004-06-21 Erik de Castro Lopo - - * examples/sndfile-convert.c - Fix a bug which caused the program to go into an infinite loop if the source - file has no meta-data. Thanks to Ron Parker for reporting this. - - * src/sndfile.h.in - Add SF_STR_FIRST and SF_STR_LAST to allow enumeration of string types. - - * Win32/sndfile.h MacOS9/sndfile.h - Update these as per the above file. - -2004-06-17 Erik de Castro Lopo - - * configure.ac src/common.h src/ogg.c src/sndfile.c src/sndfile.h.in - src/Makefile.am - Apply large patch from Conrad Parker implementing Ogg Vorbis, Ogg Speex and - Annodex support via liboggz and libfishsound. Thanks Conrad. - -2004-06-15 Erik de Castro Lopo - - * src/avr.c src/ircam.c src/nist.c src/paf.c src/xi.c - Add cast to size_t for some parameters passed to psf_binheader_writef. This - is Debian bug number 253490. Thanks to Anand Kumria and Andreas Jochens. - - * src/w64.c - Found and fixed a bug resulting from use of size_t when writing W64 'fmt ' - chunk. - -2004-06-14 Erik de Castro Lopo - - * configure.ac - Bump version to 1.0.10 ready for release. - - * Makefile.am - Remove redundant files (check_libsndfile.py libsndfile_version_convert.py) - from distribution tarball. - - * tests/header_test.tpl - Fix uninitialised variable. - - * src/GSM610/short_term.c - Fix compiler warning on MSVC++. - -2004-05-23 Erik de Castro Lopo - - * src/wav.c - Improve record keeping of chunks seen and return an error if a file with - unusual chunks is opened in mode SFM_RDWR. - - * src/mmreg.h - This file not needed so remove it. - -2004-05-22 Erik de Castro Lopo - - * tests/header_test.tpl - Add extra_header_test(). - - * src/common.h src/sndfile.c - Add SFE_RDWR_BAD_HEADER error number and string. - -2004-05-21 Erik de Castro Lopo - - * tests/utils.tpl tests/*.c tests/*.tpl - Add a line number argument to check_log_buffer_or_die() and update all - files that use that function. - - * tests/header_test.tpl - Modify/update tests for files opened SFM_RDWR and SFC_UPDATE_HEADER_AUTO. - - * src/aiff.c src/wav.c - Fix another bug in AIFF and WAV files opened in SFM_RDWR and using - SFC_UPDATE_HEADER_AUTO. - - * src/test_file_io.c - Add a test for psf_ftruncate() function. - -2004-05-19 Erik de Castro Lopo - - * src/sndfile.c - Fix another weird corner case bug found by Martin Rumori. Thanks. - - * tests/header_test.(tpl|def) - Two new files to test for the absence of the above bug and include tests - moved from tests/misc_test.c. - - * tests/Makefile.am - Hook new tests into build/test system. - - * tests/misc_test.c - Remove update_header_test() which has been moved to the new files above. - -2004-05-16 Erik de Castro Lopo - - * src/aiff.c - Fixed a bug reported by Martin Rumori on the LAD list. If a file created - with a format of SF_FORMAT_FLOAT and then closed before any data is written - to it, the header can get screwed up (PEAK chunk gets overwritten). - - * tests/write_read_test.tpl - Add a test (empty_file_test) for the above bug. - -2004-05-13 Erik de Castro Lopo - - * Win32/Makefile.mingw.in - Added a Makefile for MinGW (needs to be processed by configure). - - * src/mmsystem.h src/mmreg.h - Add files from the Wine project (under the LGPL) to allow build of - sndfile-play.exe under MinGW. - -2004-05-12 Erik de Castro Lopo - - * src/GSM610/gsm610_priv.h - Replace ugly macros with inline functions. - - * src/GSM610/*.c - Remove temporary variables used by macros and other minor fixes required by - above change. - -2004-05-10 Erik de Castro Lopo - - * tests/pipe_test.tpl tests/stdio_test.c Win32/Makefile.msvc - Make sure these programs compile (even though they do nothing) on Win32 - and add them to the "make check" target. - - * src/sfendian.h - Fix warning on Sparc CPU and code cleanup. - -2004-05-09 Erik de Castro Lopo - - * src/file_io.c - Fix warning messages when compiling under MinGW. - -2004-05-01 Erik de Castro Lopo - - * configure.ac - Set HAVE_FLEXIBLE_ARRAY in src/config.h depending on whether the compiler - accepts the flexible array struct member as per 1999 ISO C standard. - - * src/common.h src/ima_adpcm.c src/paf.c src/ms_adpcm.c - Added ugly #if HAVE_FLEXIBLE_ARRAY and provided a non-standards compliant - hack for non 1999 ISO C compliant compilers. - -2004-04-26 Erik de Castro Lopo - - * src/strings.c - If adding an SF_STR_SOFTWARE string, only append libsndfile-X.Y.Z if the - string does not already have libsndfile in the string. Thanks to Conrad - Parker. - - * tests/string_test.c - Add test to verify the above. - - * examples/sndfile-convert.c - Add ability to transcode meta data as well (Conrad Parker). - -2004-04-25 Erik de Castro Lopo - - * doc/command.html - Fix minor error. Thanks to Simon Burton. - - * doc/win32.html - Started adding instructions for compiling libsndfile under MinGW. - - * configure.ac - Add --enable-bow-docs to enable black text on a white background HTML docs. - - * doc/libsndfile.css.in - This is now a template file for configure which sets the foreground and - background colours. - -2004-04-20 Erik de Castro Lopo - - * configure.ac - Do some MinGW fixes. - - * configure.ac doc/Makefile.am - Install HTML docs when doing make install. - -2004-04-19 Erik de Castro Lopo - - * examples/sndfile-info.c - Print out the dB level with the signal max. - -2004-04-15 Erik de Castro Lopo - - * src/file_io.c - Define S_ISSOCK in src/file_io.c if required. - -2004-04-03 Erik de Castro Lopo - - * configure.ac - Improve printout configuration summary (as suggested by Axel Röbel). - - * doc/index.html - Add link to pre-release location. - - * src/sndfile.h.in - Remove comma after last element of enum. - - * src/float32.c src/double64.c - Fix read/write of float/double encoded raw files to/from pipes. - - * tests/pipe_test.c tests/pipe_test.tpl tests/pipe_test.def - Turn pipe_test.c into an autogenerated file and add tests for reading/ - writing floats and doubles. - - * tests/Makefile.am - Hook tests/pipe_test.* into build system. - -2004-04-02 Erik de Castro Lopo - - * configure.ac acinclude.m4 - Rename AC_C_STRUCT_HACK macro to AC_C99_FLEXIBLE_ARRAY. - -2004-03-31 Erik de Castro Lopo - - * tests/misc_test.c - Perform update_header_test in RDWR mode as well. - - * src/aiff.c - Fix problems when updating header in RDWR mode. - -2004-03-30 Erik de Castro Lopo - - * src/wav.c src/w64.c src/wav_w64.c - Integrate code supplied by David Viens for supporting microsoft's - WAVEFORMATEXTENSIBLE stuff. Thanks David for supplying this. - - * configure.ac doc/*.html - Bump version to 1.0.9. - -2004-03-28 Erik de Castro Lopo - - * src/command.c src/sndfile.c src/sndfile.h.in src/wav.c - Started work on supporting microsoft's WAVEFORMATEXTENSIBLE gunk. - -2004-03-26 Erik de Castro Lopo - - * src/avr.c - New file to handle Audio Visual Resaerch files. - - * src/sndfile.h.in src/common.h src/sndfile.c src/command.c - Hook AVR into everything else. - - * tests/Makefile.am tests/write_read_test.tpl tests/misc_test.c - Add testing for AVR files. - -2004-03-22 Erik de Castro Lopo - - * src/file_io.c - Fix psf_set_file() for win32. Thanks to Vincent Trussart (Plogue Art et - Technologie) for coming up with the solution. - -2004-03-21 Erik de Castro Lopo - - * tests/write_read_test.tpl - Fixed a bug that was causing valgrind to report a memory leak. The bug was - in the test code itself, not the library. - -2004-03-20 Erik de Castro Lopo - - * examples/generate.cs - An example showing how to use libsndfile from C#. Thanks to James Robson - for providing this. - -2004-03-19 Erik de Castro Lopo - - * src/common.c - Fix problems with WAV files containing large chunks after the 'data' - chunk. Thanks to Koen Tanghe for providing a sample file. - -2004-03-17 Erik de Castro Lopo - - * configure.ac - Detect presense of ALSA (Advanced Linux Sound Architecture). - - * examples/sndfile-play.c - Add ALSA output support. - - * examples/Makefile.am - Add ALSA_LIBS to link line of sndfile-play.c. - -2004-03-15 Erik de Castro Lopo - - * acinclude.m4 - Add new macro (AC_C_STRUCT_HACK) to detect whether the C compiler allows - the use of the what is known as the struct hack introduced by the 1999 ISO - C Standard. - - * configure.ac - The last release would not compile with gcc-2.95 due to the use of features - (ie struct hack) introduced by the 1999 ISO C Standard. - Add check to make sure compiler handles this and bomb out if it doesn't. - -2004-03-14 Erik de Castro Lopo - - * tests/write_read_test.tpl - Fix compiler warning on Win32. - - * src/file_io.c - Fix use of an un-initialised variable in Win32 stuff. - - * Win32/config.h examples/sndfile-play.c - Win32 fixes. - -2004-03-10 Erik de Castro Lopo - - * configure.ac - Fix bug which occurres when configuring for MinGW. - If compiler is gcc and cross compiling use -nostdinc. - -2004-03-09 Erik de Castro Lopo - - * src/common.h src/aiff.c src/wav.c src/float32.c src/double64.c - src/sndfile.c - Fix a bug with PEAK chunk handling for files with more than 16 channels. - Thanks to Remy Bruno for finding this. - -2004-03-08 Erik de Castro Lopo - - * src/common.c - Fix a bug which was preventing WAV files being openned correctly if the - file had a very large header. Thanks to Eldad Zack for finding this. - -2004-03-04 Erik de Castro Lopo - - * configure.ac src/file_io.c - Fix cross-compiling from Linux to Win32 using the MinGW tools. - -2004-03-01 Erik de Castro Lopo - - * src/create_symbols_file.sh - Christian Weisgerber pointed out that the shell script did not run on a - real Bourne shell although it did run under Bash in Bourne shell mode. - - * src/create_symbols_file.py - Rewrite of above in Python. Also add support for writing Win32 .def files. - The Python script generates Symbols.linux, Symbols.darwin and - libsndfile.def (Win32 version). These files get shipped with the tarball - so there should not be necessary to run the Python script when building - the code from the tarball. - - * configure.ac src/Makefile.am Win32/Makefile.am - Hook new Python script into the build system. - -2004-02-25 Erik de Castro Lopo - - * src/configure.ac - Add --enable-gcc-werror option and move GCC specific stuff down. - -2004-02-24 Erik de Castro Lopo - - * acinclude.m4 configure.ac - Fix clip mode detection (tested in one of HP's testdrive Itanium II boxes). - - * src/file_io.c - Added check for sizeof (off_t) != sizeof (sf_count_t) to prevent recurrence - of missing large file support on Linux and Solaris. - -2004-02-19 Erik de Castro Lopo - - * examples/sndfile-play.c - Fix a MacOSX specific bug which was caused by a space being inserted in - the middle of a file name. - - * configure.ac src/Makefile.am examples/Makefile.am - Fix a couple of MacOSX build issues. - -2004-02-17 Erik de Castro Lopo - - * doc/command.html - Document SFC_SET_CLIPPING and SFC_GET_CLIPPING. - -2004-02-14 Erik de Castro Lopo - - * doc/*.html - Applied patch from Frank Neumann (author of lakai) which fixes many minor - typos in documentation. Thanks Frank. - -2004-02-13 Erik de Castro Lopo - - * ChangeLog - Changed my email address throughout source and docs. - -2004-02-08 Erik de Castro Lopo - - * src/file_io.c - Make sure config.h is included before stdio.h to make sure large file - support is enabled on Linux (and Solaris). - - * tests/misc_test.c - Disable update_header test on Win32. This should work but doesn't and - I'm not sure why. - - * Make.bat Win32/Makefile.msvc - Updates. - -2004-01-07 Erik de Castro Lopo - - * src/common.h - Changed logindex, headindex and headend files of SF_PRIVATE from unsigned - int to int to prevent weird arithmetic bugs. - - * src/common.c src/aiff.c src/wav.c src/w64.c - Fixed compiler warnings resulting from above change. - -2004-01-06 Erik de Castro Lopo - - * src/common.c - Fixed a bug in header reader for some files with data after the sample data. - -2003-12-29 Erik de Castro Lopo - - * tests/lossy_comp_test.c tests/Makefile.am - Add tests for AIFF/IMA files. - -2003-12-26 Erik de Castro Lopo - - * src/macbinary3.c src/macos.c - Two new files required for handling SD2 files. - - * src/common.h - Add prototypes for functions in above two files. - - * src/Makefile.am - Hook new files into build system. - -2003-12-21 Erik de Castro Lopo - - * configure.ac - Add checks for mmap() and getpagesize() which might be used at some time - for faster file reads. - Add detection of MacOSX. - -2003-12-13 Erik de Castro Lopo - - * doc/FAQ.html - Minor mods to pkg-config section. - -2003-12-12 Erik de Castro Lopo - - * src/create_symbols_file.sh - Andre Pang (also known as Ozone) pointed out that on MacOSX, all non - static symbols are exported causing troubles when trying to link - libsndfile with another library which has any of the same symbols. - He fixed this by supplying the MacOSX linker with a file containing - all the public symbols so that only they would be exported and then - supplied a patch for libsndfile. - This wasn't quite ideal, because I would have to maintain two (3 if - you include Win32) separate files containing the exported symbols. - A better solution was to create this script which can generate a - Symbols file for Linux, MacoSX and any other OS that supports - minimising the number of exported symbols. - - * configure.ac src/Makefile.am - Hook the new script into the build process. - -2003-12-10 Erik de Castro Lopo - - * doc/index.html - Added comments about Steve Dekorte's SoundConverter scam. - -2003-12-07 Erik de Castro Lopo - - * src/file_io.c - Axel Röbel pointed out that on Mac OSX a pipe is not considered a fifo - (S_ISFIFO (st.st_mode) is false) but a socket (S_ISSOCK (st.st_mode) is - true). The test has therefore been changed to is S_ISREG and anything - which which does not return true for S_ISREG is considered a pipe. - -2003-11-25 Erik de Castro Lopo - - * tests/misc_test.c - Fix update_header_test to pass SDS. - - * src/sds.c - More minor fixes. - - * tests/floating_point_test.c - Add test for SDS files. - - * src/command.c - Add SDS to major_formats array. - -2003-11-24 Erik de Castro Lopo - - * tests/write_read_test.tpl tests/misc_test.c - Add tests for SDS files. - - * src/sds.c - Fix a bug in header update code. - -2003-11-23 Erik de Castro Lopo - - * src/sds.c - Get file write working. - - * src/paf.c - Fix a potential bug in paf24_seek(). - -2003-11-04 Erik de Castro Lopo - - * doc/FAQ.html - Add Q/A about u-law encoded WAV files. - - * Win32/*.h - Updated so it compiles on Win32. - -2003-11-03 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add -alaw and -ulaw command line arguments. - - * configure.ac - Add library versioning comments. - Add arguments to AC_INIT. - -2003-10-28 Erik de Castro Lopo - - * src/file_io.c - Ross Bencina has contributed code to replace all of the (mostly broken) - Win32 POSIX emulation calls with calls the native Win32 file I/O API. - This code still needs testing but is likely to be a huge improvemnt - of support for Win32. Thanks Ross. - -2003-10-27 Erik de Castro Lopo - - * src/dwvw.c - Removed filedes field from the DWVW_PRIVATE struct. - - * src/file_io.c - Change psf_fopen() so it returns psf->error instead of the file descriptor. - Add new functions psf_set_stdio() and psf_set_file(). - - * src/sndfile.c - Change these to work with changed psf_fopen() return value. - Remove all uses of psf->filedes from sndfile, making it easier to slot native - Win32 API file handling functions. - - * src/test_file_io.c - Minor changes to make it compile with new file_io.c stuff. - -2003-10-26 Erik de Castro Lopo - - * src/gsm610.h - Rename a variable from true to true_flag. As Ross Bencina points out, - true is defined in the C99 header . - - * src/file_io.c - If fstat() fails, return SF_TRUE instead of -1 (Ross Bencina). - -2003-10-09 Erik de Castro Lopo - - * src/common.h - Increase the size of SF_BUFFER_LEN and SF_HEADER_LEN. - - * src/sndfile.c - Fix sf_read/write_raw which were dividing by psf->bytwidth and - psf->blockwidth which can both be zero. - - * examples/sndfile-info.c - Increase size of BUFFER_LEN. - -2003-09-21 Erik de Castro Lopo - - * configure.ac - Add checks for and ssize_t. - Other Win32/MinGW checks. - - * src/aiff.c src/au_g72x.c src/file_io.c src/gsm610.c src/interleave.c - src/paf.c src/sds.c src/svx.c src/voc.c src/w64.c src/wav.c src/xi.c - Fix compiler warnings. - -2003-09-20 Erik de Castro Lopo - - * tests/scale_clip_test.tpl - Add definition of M_PI if needed. - -2003-09-19 Erik de Castro Lopo - - * configure.ac - Detect if S_IRGRP is declared in . - - * src/file_io.c tests/*.tpl tests/*.c - More fixes for Win32/MSVC++ and MinGW. MinGW does have but that - file doesn't declare S_IRGRP. - -2003-10-18 Erik de Castro Lopo - - * src/config.h.in - Add comment stating that the sf_count_t typedef is determined when - libsndfile is being compiled. - - * tests/utils.tpl - Modified so that utils.c gets one copy of the GPL and not two. - - -2003-09-17 Erik de Castro Lopo - - * Win32/unistd.h src/sf_unistd.h - Move first file to the second. This will help for Win32/MSVC++ and MinGW. - - * Win32/Makefile.am src/Makefile.am - Changed in line with above. - - * Win32/Makefile.msvc - Removed "/I Win32" which is no longer required. - - * src/file_io.c src/test_file_io.c tests/*.tpl tests/*.c - If HAVE_UNISTD_H include else include . This should - work for Win32, MinGW and other fakes Unix-like OSes. - - * src/*.c - Removed #include from files which didn't need it. - -2003-09-16 Erik de Castro Lopo - - * libsndfile.spec.in - Apply fix from Andrew Schultz. - -2003-09-07 Erik de Castro Lopo - - * src/vox_adpcm.c - Only set psf->sf.samplerate if the existing value is invalid. - -2003-09-06 Erik de Castro Lopo - - * examples/sndfile-play.c - Started adding support for ALSA output. - -2003-09-04 Erik de Castro Lopo - - * src/sndfile.h.in - Removed from sndfile.h. - - * src/*.c examples/*.c tests/*.c tests/*.tpl - Added where needed. - -2003-09-02 Erik de Castro Lopo - - * src/common.h - Added ARRAY_LEN, SF_MAX and SF_MIN macros. - -2003-08-19 Erik de Castro Lopo - - * doc/index.html - Remove statements about alternative licensing arrangements. - -2003-08-17 Erik de Castro Lopo - - * MacOS MacOS9 Makefile.am configure.ac - Change directory name from MacOS to MacOS9 - - * MacOS9/MacOS9-readme.txt - Change name to make it really obvious, add text to top of file to make it - still more obvious again. - -2003-08-16 Erik de Castro Lopo - - * src/test_log_printf.c - Add tests for %u conversions. - - * src/common.c - Fix psf_log_printf() %u conversions. - -2003-08-15 Erik de Castro Lopo - - * src/aiff.c - Fixed a bug where opening a file with a non-trival header in SFM_RDWR mode - would over-write part of the header. Thanks to Axel Röbel for pointing - this out. Axel also provided a patch to fix this but I came up with a - neater and more general solution. - Return error when openning an AIFF file with data after the SSND chunk - (Thanks Axel Röbel). - - * tests/aiff_rw_test.c - Improvements to test program which will later allow it to be generalised to - test WAV, SVX and others as required. - -2003-08-14 Erik de Castro Lopo - - * tests/pipe_test.c - Add useek_pipe_rw_test() submitted by Russell Francis. - - * src/sndfile.c - In sf_open_fd(), check if input file descriptor is a pipe. - - * src/sndfile.[ch] - Fix typo in variable name do_not_close_descriptor. - -2003-08-13 Erik de Castro Lopo - - * src/test_log_printf.c - Improve the tests for %d and %s conversions. - - * src/common.c - Fixed a few problems in psf_log_printf() found using new tests. - -2003-08-06 Erik de Castro Lopo - - * configure.ac - Add -Wwrite-strings warning to CFLAGS if the compiler is GCC. Thanks to - Peter Miller (Aegis author) for suggesting this and supplying a patch. - - * src/*.c examples/*.c tests/*.c - Fix all compiler warnings arising from the above. - -2003-08-02 Erik de Castro Lopo - - * tests/aiff_rw_test.c tests/Makefile.am - New test program to check for errors re-writing the headers of AIFC files - opened in mode SFM_RDWR. - -2003-07-21 Erik de Castro Lopo - - * examples/sndfile-play.c - Applied a patch from Tero Pelander to allow this program to run on systems - using devfs which used /dev/sound/dsp instead of /dev/dsp. - -2003-07-11 Erik de Castro Lopo - - * doc/new_file_type.HOWTO - Updated document. Still incomplete. - -2003-06-29 Erik de Castro Lopo - - * src/sndfile.c - Fix VALIDATE_SNDFILE_AND_ASSIGN_PSF which was returning an error rather - than saving it and returning zero. - -2003-06-25 Erik de Castro Lopo - - * src/file_io.c - Two fixes for Mac OS9. - Fix all casts from sf_count_t to ssize_t (not size_t). - -2003-06-22 Erik de Castro Lopo - - * src/wav.c - Fix for reading files with RIFF length of 8 and data length of 0. - -2003-06-14 Erik de Castro Lopo - - * src/*.c tests/*.c tests/*.tpl - Added comments to mark code for removal when make Lite version of - libsndfile. - -2003-06-09 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add extra error checking for unrecognised arguments. - -2003-06-08 Erik de Castro Lopo - - * src/ima_adpcm.c - Started adding code to write IMA ADPCM encoded AIFF files. - - * src/test_log_printf.c src/Makefile.am - New file to test psf_log_printf() function and add hooks into build system. - - * src/common.c - Move psf_log_printf() function to top of the file and only compile the rest - of the file if if PSF_LOG_PRINTF_ONLY is not defined. - -2003-06-03 Erik de Castro Lopo - - * Win32/config.h Win32/sndfile.h - Updated with new config variables. - - * Win32/unistd.h src/file_io.c - Added implementation of S_ISFIFO macro which Win32 seems to lack and is - used in src/file_io.c. - - * tests/utils.tpl - Added #include to pull in Win32/unistd.h so it compiles for - Win32. - - * src/Makefile.msvc - Added src\test_file_io.exe build target and run this as the very first - test. - - * tests/win32_test.c - Add support for testing Cygwin32. - - * configure.ac - Detect POSIX fsync() and fdatasync() functions. - - * src/file_io.c - If compiling for Cygwin, call fsync() before calling fstat() to retrieve - file length. - - * tests/pcm_test.tpl - Add a test for lrintf() function. This was required to detect a really - broken lrint() and lrintf() on Cygwin. - - * tests/misc_test.c - Don't run permission test when compiling under Cygwin. - - * src/float_cast.h - Fix fallback macro for lrint() and lrintf() to cast to long instead of int - to match official function prototypes. - -2003-06-02 Erik de Castro Lopo - - * examples/sndfile-convert.c - Modifications to improve accuracy of conversions; use double data for - floating point and int for everything else. - - * src/ima_apdcm.c - Completed work on decoding IMA ADPCM encoded AIFF files. Still need to - get encoding working. - -2003-05-28 Erik de Castro Lopo - - * src/aiff.c src/ima_adpcm.c - Start working on getting IMA ADPCM encoded AIFF files working. - -2003-05-27 Erik de Castro Lopo - - * configure.ac - Fixed the touch command for when the autogen program is not found (Matt - Flax). - - * src/ulaw.c src/alaw.c - Made these pipe-able. - -2003-05-24 Erik de Castro Lopo - - * src/paf.c src/ircam.c - Fixed writing to pipe. - - * src/wav.c src/aiff.c src/nist.c src/mat*.c src/svx.c src/w64.c - Return SFE_NO_PIPE_WRITE if an attempt is made to write to a pipe. - -2003-05-23 Erik de Castro Lopo - - * examples/sndfile-info.c - Modified to detect unknown file lengths. - - * src/mat4.c - Fix reading from a pipe. - -2003-05-22 Erik de Castro Lopo - - * tests/pipe_test.c - Add more file types to tests. - - * src/mat4.c - Removed explicit setting of psf->sf.seekable to SF_TRUE. - - * tests/utils.tpl - Add macro for generating and check data in the stdio and pipe tests. - - * tests/stdout_test.c tests/stdin_test.c - Use the above macro to generate known data on output and check data on - input. - - * src/voc.c src/htk.c common.h sndfile.c - Disallow reading/writing VOC and HTK files from/to pipes be returning new - error values. - - * src/w64.c - Fixes to allow reading from a pipe. - -2003-05-21 Erik de Castro Lopo - - * configure.ac src/sndfile.h.in - When the configure script determines the sizeof (sf_count_t), also set the - value of SF_COUNT_MAX in sndfile.h. - - * configure.ac - Remove -pedantic flag from default GCC compiler flags. - - * tests/pipe_test.c - Add a pipe_read_test() before doing pipe_write_test(). - - * tests/scale_clip_test.c - Add test to make sure non-normalized values also clip in the right way. - -2003-05-18 Erik de Castro Lopo - - * configure.ac - Add test to detect processor clipping capabilities. - - * tests/stdin_test.c tests/stdout_test.c - Fix a pair of compiler warnings. - - * src/common.h - Add new pipeoffset field to SF_PRIVATE. This will contain the current file - offset when operating on a pipe. - - * src/common.c - Removed direct calls to psf_fread()/psf_fseek()/psf_fgets() etc from - psf_binheader_readf and redirect them to new buffered versions - header_read(), header_seek() and header_gets(). - Add "G" format specifier to emulate fgets() functionality with buffering. - This will allow reading some file types from pipes. - - * src/file_io.c - When the file descriptor is a pipe, manintain psf->pipeoffset. - - * src/pvf.c - Change use of psf_fgets() to psf_binheader_readf() as required but changes to header re - - * src/au.c - Fix reading from a pipe. - -2003-05-17 Erik de Castro Lopo - - * src/pcm.c - Add clipping versions of the f2XXX_array() functions to allow option of - clipping data that would otherwise overflow. - - * tests/scale_clip_test.tpl tests/scale_clip_test.def - New files test that clipping option does actually work. - -2003-05-14 Erik de Castro Lopo - - * doc/index.html - Fixed a typo ("OS(" instead of "OS9"). - -2003-05-13 Erik de Castro Lopo - - * tests/open_fail_test.c - Include to prevent warning message of missing declaration of - memset(). - -2003-05-12 Erik de Castro Lopo - - * src/common.h - Add new "add_clipping" field to SF_PRIVATE. - - * src/sndfile.h.in src/sndfile.c - Add command SFC_SET_CLIPPING which sets/resets add_clipping field. - -2003-05-11 Erik de Castro Lopo - - * doc/api.html - Add docs for sf_set_string() and sf_get_string(). - - * src/common.h src/sndfile.c - Add new SFE_STR_BAD_STRING error. - - * tests/stdin_test.c tests/stdout_test.c - Removed all non-error print statements. - - * tests/stdio_test.c tests/pipe_test.c tests/Makefile.am - Add print statements removed from two files above. - -2003-05-10 Erik de Castro Lopo - - * libsndfile.spec.in - Fixed a coulpe of minor errors discovered by someone calling themselves - Agent Smith. - - * src/common.c src/common.h src/file_io.h - Added is_pipe field to SF_PRIVATE and declaration of psf_is_pipe() - function. (Axel Röbel) - - * src/sndfile.c - Fixed determination of whether the file is a pipe. (Axel Röbel) - - * src/paf.c - Force paf24 to start with undefined mode. (Axel Röbel) - - * tests/pipe_test.c - Mods to make this test work and actually do the test on RAW files. (Axel - Röbel). - -2003-05-05 Erik de Castro Lopo - - * src/sndfile.c - Fixed a potential bug where psf->sf.seekable was being set to FALSE when - operating on stdin or stdout but then the default initialiser was reseting - it to TRUE. Thanks to Axel Röbel. - - * src/aiff.c - Fixed a bug in the header parser where it was not handling an odd length - COMM chunk correctly. Thanks to Axel Röbel. - - * src/test_file_io.c - Add more tests. - - * tests/win32_test.c - New file for showing the bugs in the Win32 implementation of the POSIX API. - It also runs on Linux for sanity checking. - - * tests/Makefile.am Win32/Makefile.msvc - Hook the new test program into the build system. - -2003-05-04 Erik de Castro Lopo - - * src/test_file_io.c - New test program to test operation of functions defined in file_io.c. This - should make supporting win32 significantly easier. - - * src/Makefile.am - Hook new test program into the build system. - - * src/file_io.c - Add compile/run time check that sizeof statbuf.st_size and sf_count_t are - the same. - - * src/common.h src/sndfile.c - Added new error code and error message for new check. - - * tests/benchmark.tpl - Fix to use frames instead of samples in SF_INFO. - -2003-05-03 Erik de Castro Lopo - - * src/file_io.c - More stuffing about working around PLAIN OLD-FASHIONED **BUGS** in Win32. - - * examples/sndfile-info.c - Applied patch from Conrad Parker to add "--help" and "-h" options as - well as an improved usage message. - -2003-05-02 Erik de Castro Lopo - - * src/au.c - Added embedded file support. - - * tests/multi_file_test.c - Added tests for embedded AU files. - Added verbose testing mode. - - * src/common.h src/sndfile.c - Added an embedded AU specific error code and message. - - * src/wav.c - Added patch from Conrad Parker which filled in a little more information - about ACIDized WAV files. - -2003-04-30 Erik de Castro Lopo - - * src/file_io.c - Fixed Win32 version of psf_fseek() which was calling psf_get_filelen() - which was in turn calling psf_fseek() which in the end blew the stack. - Now of course this would have been easy to find on Linux, but this blow - up was happening in kernel32.dll and the fscking MSVC++ debugger couldn't - figure out what call caused this (it couldn't even tell me the stack had - overflowed) and was absolutley useless for this debugging exercise. - On top of that, the reason I got into this mess was that windoze doesn't - have a working fstat() function which can return file lengths > 2 Gig. It - HAS a fscking _fstati64() but the file length value is only updated AFTER - the bloody file is closed. That makes it completely useless. - How the hell do people stand working on this crap excuse of an OS? - -2003-04-29 Erik de Castro Lopo - - * Win32/unistd.h src/file_io.c - Moved definitions of S_IGRP etc from file_io.c to unistd.h so that these - can be used in the test programs. - - * Win32/libsndfile.def - Added sf_open_fd. - - * Win32/sndfile.h - Updated to match src/sndfile.h.in. - - * Win32/Makefile.msvc - Added dither.c and htk.c to libsndfile.dll target. - -2003-04-28 Erik de Castro Lopo - - * src/file_io.c - First attempt at getting the Win32 versions of the these functions working. - They still need to be tested. - -2003-04-27 Erik de Castro Lopo - - * src/strings.c - Found and fixed a bug which was causing psf_store_string() to fail on - Motorola 68k processors. Many thanks fo Joshua Haberman (Debian maintainer - of libsndfile) for compiling and running debug code to help me debug the - problem. - -2003-04-26 Erik de Castro Lopo - - * src/sndfile.c src/file_io.c src/wav.c src/aiff.c - Much hacking to get reading and writing of embedded files working (ie sound - files at a non-zero files offset). - - * doc/embedded_files.html - First pass atempt at documenting reading/writing embedded files. - -2003-04-21 Erik de Castro Lopo - - * doc/FAQ.html - Updated answer to "Why doesn't libsndfile do interleaving/de-interleaving?" - -2003-04-19 Erik de Castro Lopo - - * src/wav.c src/aiff.c - Fix retrieving and storing of string data from files. Need to be careful - about using psf->buffer for strings. - -2003-04-18 Erik de Castro Lopo - - * src/file_io.c - Fix psf_fseek() for seeks withing embedded files. - -2003-04-15 Erik de Castro Lopo - - * src/sndfile.h.in - Changed the definition of SNDFILE slightly to produce warnings when it isn't - used correctly. This should have zero affect in code which uses the SNDFILE - type correctly. - - * src/sndfile.c - Fixed a few compiler warnings cause by the changes to the SNDFILE type. - -2003-04-12 Erik de Castro Lopo - - * doc/FAQ.html - Added question and answer to the question "How about adding the ability - to write/read sound files to/from memory buffers?". - -2003-04-08 Erik de Castro Lopo - - * tests/write_read_test.tpl - Removed un-needed enums declaring TRUE and FALSE and replaced usage of - these with SF_TRUE and SF_FALSE. - - * tests/multi_file_test.c - New test program to test sf_open_fd() on files containing data other than - a single sound file. - -2003-04-06 Erik de Castro Lopo - - * src/file_io.c - When creating files, set the readable by others flag. This still allows - further restrictions to be enforced by use of the user's umask. Fix - suggested by Eric Lyon. - -2003-04-05 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Changed sf_open_fd(). Dropped offset parameter and added a close_desc - parameter. If close desc is TRUE, the file descritpor passed into the - library will be closed when sf_close() is called. - - * tests/utils.tpl - Modified call to sf_open_fd() to set close_desc parameter to SF_TRUE. - -2003-04-04 Erik de Castro Lopo - - * tests/write_read_test.tpl - Add a string (using sf_set_string() function) before and after data section - of all files. This will make sure that if string data can be added, it - doesn't overwrite real audio data. - -2003-04-02 Erik de Castro Lopo - - * src/sndfile.c - Started work on supporting a non-zero offset parameter for sf_open_fd (). - - * src/.c - Removed many uses of psf_fseek (SEEK_END) which to allow for future use of - sf_open_fd() with non-zero offset. - Associated refactoring. - - * src/aiff.c - Implemented functionality required to get sf_get_string() and - sf_set_string() working for AIFF files. - -2003-04-01 Erik de Castro Lopo - - * tests/utils.tpl - Modified test_open_file_or_die() to alternately use sf_open() and - sf_open_fd(). - - * src/svx.c - Fixed a bug which occurred when openning an existing file for read/write - using sf_open_fd(). In this case, the existing NAME chunk needs to be - read into psf->filename. - Fixed printing of sf_count_t types to logbuffer. - -2003-03-31 Erik de Castro Lopo - - * src/sndfile.h.in - Added prototype for new function sf_open_fd(). - - * src/sndfile.c - Moved most of the code in sf_open() to a new function psf_open_file(). - Created new function sf_open_fd() which also uses psf_open_file() but - does not currently support the offset parameter. - - * doc/api.html - Document sf_open_fd(). - -2003-03-09 Erik de Castro Lopo - - * src/sndfile.c - Fixed a memory leak reported by Evgeny Karpov. Memory leak only occurred - when an attempt was made to read and the open() call fails. - -2003-03-08 Erik de Castro Lopo - - * tests/open_fail_test.c - New test program to check for memory leaks when sf_open fails on a valid - file. Currently this must be run manually under valgrid. - - * tests/Makefile.am - Hook new test program into build. - -2003-03-03 Erik de Castro Lopo - - * Octave/sndfile_save.m Octave/sndfile_play.m - Added a -mat-binary option to the octave save command to force the output - to binary mode even if the user has set ascii data as the default. Found - by Christopher Moore. - -2003-02-27 Erik de Castro Lopo - - * doc/dither.html - New file which will document the interface which allows the addition of - audio dither when sample word sizes are being reduced. - - * src/dither.c - More work. - -2003-02-26 Erik de Castro Lopo - - * tests/misc_test.c - In update_header_test(), make HTK files a special case. - - * doc/index.html - Added HTK to the feature matrix. - -2003-02-25 Erik de Castro Lopo - - * src/htk.c - New file for reading/writing HMM Tool Kit files. - - * src/sndfile.h.in src/sndfile.c src/command.c src/Makefile.am - Hook in htk.c - - * tests/write_read_test.tpl tests/misc_test.c tests/Makefile.am - Add tests for HTK files. - -2003-02-22 Erik de Castro Lopo - - * src/wav.c - Fixed a bug where the LIST chunk length was being written incorrectly. - - * tests/string_test.c - Added call to check_log_buffer(). - Minor cleanups. - -2003-02-10 Erik de Castro Lopo - - * src/wav_w64.h - Applied patch from Antoine Mathys to add extra WAV format definitions and - a G72x_ADPCM_WAV_FMT struct definition. - - * src/wav_w64.c - Applied patch from Antoine Mathys which converts wav_w64_format_str() from - one huge inefficient switch statement to a binary search. - - * tests/string_test.c - Dump log buffer if tests fail. - -2003-02-07 Erik de Castro Lopo - - * tests/string_test.c - David Viens supplied some modifications to this file which showed up a bug - when using sf_set_string() and the sf_writef_float() functions. - - * src/sndfile.c - Fixed the above bug. - -2003-02-06 Erik de Castro Lopo - - * doc/FAQ.html - Added Q and A on how to detect libsndfile in configure.in (at the suggestion - of Davy Durham). - -2003-02-05 Erik de Castro Lopo - - * src/sndfile.h.in - Add enums and typedefs for dither. - Deprecate SFC_SET_ADD_DITHER_ON_WRITE and SFC_SET_ADD_DITHER_ON_READ, to be - replaced with SFC_SET_DITHER_ON_WRITE and SFC_SET_DITHER_ON_READ which will - allow different dither algorithms to be enabled. - Added SFC_GET_DITHER_INFO_COUNT and SFC_GET_DITHER_INFO. - - * src/sndfile.h.in src/Version_script.in Win32/libsndfile.def. - Added public sf_dither_*() functions. - - * src/sndfile.c - Implement commands above. - - * src/dither.c - More work. Framework and external hooks into dither algorithms complete. - -2003-02-03 Erik de Castro Lopo - - * doc/version-1.html libsndfile_version_convert.py - Remove redundant files. - - * doc/index.html doc/api.html - Remove links to version-1.html. - - * src/dither.c - New file to allow the addition of audio dither on input and output. - - * src/common.h - Add prototype for dither_init() function. - - * Makefile.am doc/Makefile.am - Changes for added and removed files. - -2003-02-02 Erik de Castro Lopo - - * Win32/Makefile.msvc - Changes to force example binaries to be placed in the top level directory - instead of the examples/ directory. - Add src/strings.c and src/xi.c to the build. - Add string_test to build and to tests on WAV files. - - * doc/index.html - Added XI to support matrix. - -2003-01-27 Erik de Castro Lopo - - * src/sndfile.h.in - Added prototypes for sf_get_string() and sf_set_string() and SF_STR_* - enum values. - - * src/sndfile.c - Added public interface to sf_get_string() and sf_set_string(). - - * src/wav.c - Added code for setting and getting strings in WAV files. - - * tests/string_test.c - New test program for sf_get_string() and sf_set_string() functionality. - - * tests/Makefile.am - Hook new test program into build and test framework. - -2003-01-26 Erik de Castro Lopo - - * src/common.h - Added fields to SF_PRIVATE for string data needed to implement - sf_get_string() and sf_set_string(). - - * src/strings.c - New file for storing and retrieving strings to/from files. - - * src/Makefile.am - Added strings.c to build. - -2003-01-25 Erik de Castro Lopo - - * src/xi.c - Read seems to be working so looking at write. - - * src/sndfile.h.in - Added SF_FORMAT_XI, SF_FORMAT_DPCM_8 and SF_FORMAT_DPCM_16 enum values. - - * tests/floating_point_test.c tests/lossy_comp_test.c tests/Makefile.am - Added test for 8 and 16 bit XI format files. - -2003-01-24 Erik de Castro Lopo - - * doc/index.html - Added a non-lawyer readable summary of the licensing provisions as - suggested by Steve Dekorte. - -2003-01-23 Erik de Castro Lopo - - * src/wav.c - Fixed a compiler warning found by Alexander Lerch. - -2003-01-18 Erik de Castro Lopo - - * configure.ac - Fixed the multiple linking of libm. - -2003-01-17 Erik de Castro Lopo - - * Win32/Makefile.mcvs - Added comments on the correct way to set up the MSVCDir environment - variable. - - * doc/win32.html - Add on how to set up the MSVCDir environment variable. - -2003-01-15 Erik de Castro Lopo - - * examples/sndfile-play.c examples/sndfile-info.c - When run on Win32 without any command line parameters print a message and - then sleep for 5 seconds. This means the when somebody double clicks on - these programs in explorer the user will actually see the message. - -2003-01-14 Erik de Castro Lopo - - * tests/misc_test.c - Bypass permission test if running as root because root is allowed to open - a readonly file for write. - -2003-01-08 Erik de Castro Lopo - - * Win32/Makefile.msvc - Added pvf.c and xi.c source files to project. - - * src/sndfile.h - Updated for PVF files. - -2003-01-07 Erik de Castro Lopo - - * src/sndfile.c - Modified validate_sfinfo() to force samplerate, channels and sections - to be >= 1. - In format_from_extension() replaced calls to does_extension_match() - with strcmp(). - - * src/xi.c - More work. - -2003-01-06 Erik de Castro Lopo - - * doc/Makefile.am - Added octave.html which had been left out. Found by Jan Weil. - -2003-01-05 Erik de Castro Lopo - - * src/pvf.c src/common.h src/sndfile.c - Fixed error handling for PVF files. - - * src/xi.c - New file for handling Fasttracker 2 Extended Instrument files. Not working - yet and included when configured with --enable-experimental. - - * src/sndfile.c src/common.h - Hooked in new file xi.c. - -2002-12-30 Erik de Castro Lopo - - * src/rx2.c - Added a patch from Marek Peteraj which sheds a little more light on the - slices within an RX2 file. Still need to find out data encoding. - -2002-12-20 Erik de Castro Lopo - - * src/wav.c - Started work on decoding 'acid' and 'strc' chunks. - -2002-12-14 Erik de Castro Lopo - - * tests/peak_check_test.c - Minor cleanup. - -2002-12-12 Erik de Castro Lopo - - * tests/write_read_test.tpl - Added check to make sure no error was generated when an attempt was made to - read past the end of the file. - -2002-12-11 Erik de Castro Lopo - - * doc/lists.html - Added "mailto" links for all three lists. - - * src/pvf.c - New file for Portable Voice Format files. - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.c src/Makefile.am - Added hooks for SF_FORMAT_PVF format files. - - * tests/write_read_test.tpl tests/std*.c - Add tests for SF_FORMAT_PVF. - - * doc/index.html - Add PVF to the compatibility matrix. - - * src/pcm.c src/alaw.c src/ulaw.c src/float32.c src/double64.c - Previously, attempts to read beyond the end of a file would set psf->error - to SFE_SHORT_ERROR. This behaviour diverged from the behaviour of the POSIX - read() call but has now been fixed. - Attempts to read beyond the end of the file will return a short read count - but will not longer set any error. - -2002-12-09 Erik de Castro Lopo - - * src/sndfile.c - Add more sanity checking when opening a RAW file for read. When format is - not RAW, zero out all members of the SF_INFO struct. - - * tests/raw_test.c - Add bad_raw_test() to check for above problem. - - * tests/stdin_test.c examples/sndfile-info.c - Set the format field of the SF_INFO struct to zero before calling - sf_open(). - - * doc/api.html - Add information about the need to set the format field of the SF_INFO struct - to zero when opening non-RAW files for read. - - * configure.ac - Removed use of conversion script on Solaris. Not all Solaris versions - support it. - - * doc/lists.html - New file containg details of the mailing lists. - - * doc/index.html - Add a link to the above new file. - -2002-12-04 Erik de Castro Lopo - - * tests/dft_cmp.c - Fixed a SIGFPE on Alpha caused by a log10 (0.0). Thanks to Joshua Haberman - for providing the gdb traceback. - -2002-11-28 Erik de Castro Lopo - - * src/wav.c - Added more capabilities to 'smpl' chunk parser. - - * src/sndfile.c - Fixed some (not all) possible problems found with Flawfinder. - -2002-11-24 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_seek(). This bug could only occur when an attempt was - made to read beyond the end and then sf_seek() was called with a whence - parameter of SEEK_CUR. - - * src/file_io.c - Win32's _fstati64() does not work, it returns BS. Re-implemented - psf_get_filelen() in terms of psf_fseek(). - - * tests/write_read_test.tpl - Add a test to detect above bug. - - * src/float_cast.h - Modification to prevent compiler warnings on Mac OS X. - - * src/file_io.c - Fixes for windows (what a f**ked OS). - -2002-11-08 Erik de Castro Lopo - - * configure.ac - Disable use of native lrint()/lrintf() on Mac OSX. These functions exist on - Mac OSX 10.2 but not on 10.1. Forcing the use of the versions in - src/float_cast.h means that a library compiled on 10.2 will still work on - 10.1. - -2002-11-06 Erik de Castro Lopo - - * configure.in configure.ac - Renamed configure.in to configure.ac as expected by later versions of - autoconf. - Slight hacking of configure.ac to work with version 2.54 of autoconf. - Changed to using -dumpversion instead of --version for determining GCC - version numer as suggested by Anand Kumria. - - * src/G72x/Makefile.am - Slight hacking required for operation with automake 1.6.3. - -2002-11-05 Erik de Castro Lopo - - * src/common.c - In psf_binheader_readf() changed type parameter type "b" type from size_t - to int to prevent errors on IA64 CPU where sizeof (size_t) != sizeof (int). - Thanks to Enrique Robledo Arnuncio for debugging this. - -2002-11-04 Erik de Castro Lopo - - * test/command_test.tpl - Changed test value so test would pass on Solaris. - - * src/Version_script.in - Modified version numbering so that later versions of 1.0.X can replace - earlier versions without recompilation. - - * src/vox_adpcm.c - Fixed bug causing short reads. - -2002-11-03 Erik de Castro Lopo - - * test/floating_point_test.c - Code cleanup using functions from util.c. - Add test for IEEE replacement floats and doubles. - -2002-11-01 Erik de Castro Lopo - - * src/wav.c - Fixed a possible divide by zero error when read the 'smpl' chunk. Thanks to - Serg Repalov for the example file. - - * tests/pcm_test.tpl - Used sf_command (SFC_TEST_IEEE_FLOAT_REPLACE) to test IEEE replacement code. - Clean up pcm_double_test(). - - * src/float32.c src/double64.c - Force use of IEEE replacement code using psf->ieee_replace is TRUE, - Print message to log_buffer as well. - Rename all broken_read_* and broken_write* functions to replace_read_* and - replace_write_*. - - * tests/util.tpl - Added string_in_log_buffer(). - - * tests/pcm_test.tpl - Use string_in_log_buffer() to ensure that IEEE replacement code has been - used. - - * configure.in - Removed --enable-force-broken-float option. IEEE replacement code is now - always tested. - -2002-10-31 Erik de Castro Lopo - - * src/double64.c - Implement code for read/writing IEEE doubles on platforms where the native - double format is not IEEE. - - * src/float32.c src/common.h - Remove float32_read() and float32_write(). Replace with float32_le_read(), - float32_be_read(), float32_le_write() and float32_be_write() to match stuff - in src/double64.c. - - * src/common.c - Fix all usage of float32_write(). - - * src/sndfile.h.in - Added SFC_TEST_IEEE_FLOAT_REPLACE command (testing only). - - * src/common.h - Added SF_PRIVATE field ieee_replace. - - * src/sndfile.c - In sf_command() set/reset psf->ieee_replace. - -2002-10-26 Erik de Castro Lopo - - * tests/pcm_test.tpl - Fixed a problem when testing with --enable-force-broken-float. The test was - generating a value of negative zero and the broken float code is not able - to write negative zero. Removing the negative zero fixed the test. - -2002-10-25 Erik de Castro Lopo - - * src/file_io.c - Added fix for Cygwin (suggested by Maros Michalik). - -2002-10-23 Erik de Castro Lopo - - * src/file_io.c - Improved error detection and handling. - - * src/file_io.c src/common.h - Removed functions psf_ferror() and psf_clearerr() which were redundant - after above improvements. - - * src/aiff.c src/svx.c src/w64.c src/wav.c - Removed all use of psf_ferror() and psf_clearerr(). - - * src/sndfile.c - Removed #include of , , and which - are no longer needed. - - * tests/misc_test.c - Added test to make sure the correct error message is returned with an - existing read-only file is openned for write. - -2002-10-21 Erik de Castro Lopo - - * doc/index.html doc/api.html - Updated for OKI Dialogic ADPCM files. - - * src/command.c - Added VOX ADPCM to sub_fomats. - -2002-10-20 Erik de Castro Lopo - - * src/vox_adpcm.c src/Makefile.am - New file for handling OKI Dialogic ADPCM files. - - * src/sndfile.h - Add new subtype SF_FORMAT_VOX_ADPCM. - - * src/sndfile.c - Renamed function is_au_snd_file () to format_from_extenstion () and expanded - its functionality to detect headerless VOX files. - - * src/raw.c - Added hooks for SF_FORMAT_VOX_ADPCM. - - * examples/sndfile-info.c - Print out file duration (suggested by Conrad Parker). - - * libsndfile.spec.in - Force installation of sndfile.pc file (found by John Thompson). - - * tests/Makefile.am tests/lossy_comp_test.c tests/floating_point_test.c - Add tests for SF_FORMAT_VOX_ADPCM. - -2002-10-18 Erik de Castro Lopo - - * tests/misc_test.c - Add test which attempts to write to /dev/full (on Linux anyway) to check - for correct handling of writing to a full filesystem. - - * src/sndfile.c - Return correct error message if the header cannot be written because the - filesystem is full. - - * tests/util.tpl - Corrected printing of file mode in error reporting. - - * src/mat5.c - Fixed a bug where a MAT5 file written by libsndfile could not be opened by - Octave 2.1.36. - -2002-10-13 Erik de Castro Lopo - - * src/common.h src/file_io.c - All low level file I/O have been modified to be better able to report - system errors resulting from calling system level open/read/write etc. - - * src/*.c - Updated for compatibility with above changes. - - * examples/cooledit-fixer.c - New example program which fixes badly broken file created by Syntrillium's - Cooledit which are marked as containing PCM samples but actually contain - floating point data. - - * examples/Makefile.am - Hooked cooledit-fixer into the build system. - -2002-10-10 Erik de Castro Lopo - - * doc/command.html - Document SFC_GET_FORMAT_INFO. - -2002-10-09 Erik de Castro Lopo - - * examples/wav32_aiff24.c examples/sndfile2oct.c examples/sfhexdump.c - examples/sfdump.c - Removed these files because they weren't interesting. - - * examples/sfconvert.c examples/sndfile-convert.c - Renamed the first to the latter. - - * examples/Makefile.am - Added sndfile-convert to the bin_PROGRAMS, so it is installed when the lib - is installed. - Removed old programs wav32_aiff24 and sndfile2oct. - - * man/sndfile-convert.1 - New man page. - - * examples/sndfile-convert.c - Added some gloss now that sndfile-convert.c is an installed program. - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.h - Added command SFC_GET_FORMAT_INFO. - - * tests/command_test.c - Added tests form SFC_GET_FORMAT_INFO. - -2002-10-08 Erik de Castro Lopo - - * src/sndfile.c - In sf_format_check() return error if samplerate < 0. - -2002-10-07 Erik de Castro Lopo - - * src/aiff.c - Fixed bug in handling of COMM chunks with a 4 byte encoding byte but no - encoding string. - -2002-10-06 Erik de Castro Lopo - - * src/sndfile.c - Fixed repeated word in an error message. - -2002-10-05 Erik de Castro Lopo - - * doc/index.html - Improved advertising in Features section. - -2002-10-04 Erik de Castro Lopo - - * src/wav.c - Added decoding of 'labl' chunks within 'LIST' chunks. - - * src/common.h - Added (experimental only) SF_FORMAT_OGG and SF_FORMAT_VORBIS and definition - of ogg_open(). This is nowhere near working yet. - - * src/sndfile.c - Added detection of 'OggS' file marker and added call to ogg_open() to - switch statement. - - * src/ogg.c - New file. Very early start of Ogg Vorbis support. - - * src/wav.c - Added handling of brain-damaged and broken Cooledit "32 bit 24.0 float - type 1" files. These files are marked as being 24 bit WAVE_FORMAT_PCM with - a block alignment of 4 times the numbers of channels but are in fact 32 bit - floating point. - -2002-10-02 Erik de Castro Lopo - - * configure.in - Modified option --enable-experimental to set ENABLE_EXPERIMENTAL_CODE in - config.h to either 0 or 1. - - * src/sndfile.c - Modify sf_command (SFC_GET_LIB_VERSION) to append "-exp" to the version - string if experimental code has been enabled. - -2002-10-01 Erik de Castro Lopo - - * src/Makefile.am - Added -lm to libsndfile_la_LIBADD. This means that -lm is not longer needed - in the link line when linking something to libsndfile. - - * tests/Makefile.am examples/Makefile.am - Removed -lm from all link lines. - - * sndfile.pc.in - Removed -lm from Libs line. - -2002-09-24 Erik de Castro Lopo - - * src/file_io.c - Removed all perror() calls. - - * src/nist.c - Removed calls to exit() function. - Added check to detect NIST files dammaged from Unix CR -> Win32 CRLF - conversion process. - -2002-09-24 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - New function sf_strerror() which will eventually replace functions - sf_perror() and sf_error_str(). - Function sf_error_number() has also been changed, but this was documented - as being for testing only. - - * doc/api.html - Documented above changes. - - * tests/*.c examples/*.c - Changed to new error functions. - -2002-09-22 Erik de Castro Lopo - - * configure.in - Detect GCC version, and print a warning message about writeable strings - it GCC major version number is less than 3. - -2002-09-21 Erik de Castro Lopo - - * src/sndfile.h.in doc/api.html - Documentation fixes. - -2002-09-19 Erik de Castro Lopo - - * src/Version_script.in src/Makefile.am configure.in - Use the version script to prevent the exporting of all non public symbols. - This currently only works with Linux. Will test on Solaris as well. - - * src/float_cast.h - Added #ifndef to prevent the #warning directives killing the SGI MIPSpro - compiler. - - * src/au_g72x.c src/double64.c src/float32.c src/gsm610.c src/ima_adpcm.c - src/ms_adpcm.c - Fix benign compiler warnings arising from previously added compiler - flags. - -2002-09-18 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_error_str() where errnum was used as the index instead - of k. Found by Tim Hockin. - - * examples/sndfile-play.c - Fixed a compiler warning resulting from a variable shadowing a previously - defined local. - -2002-09-17 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Added command SFC_SET_RAW_START_OFFSET. - - * doc/command.html - Document SFC_SET_RAW_START_OFFSET. - - * tests/raw_test.c tests/Makefile.am - Add new file for for testing SF_FORMAT_RAW specific functionality. - - * tests/dwvw_test.c - Updates. - -2002-09-16 Erik de Castro Lopo - - * src/wav.c - Modified reading of 'smpl' chunk to take account of the sampler data field. - - * tests/utils.tpl tests/utils.h - Added function print_test_name(). - - * tests/misc_test.c tests/write_read_test.tpl tests/lossy_comp_test.c - tests/pcm_test.tpl tests/command_test.tpl tests/floating_point_test.c - Convert to use function print_test_name(). - -2002-09-15 Erik de Castro Lopo - - * doc/octave.html - Added a link to some other Octave scripts for reading and writing sound - files. - - * src/paf.c - Change type of dummy data field to int. This should fix a benign compiler - warning on some CPUs. - Removed superfluous casts resulting from the above change. - - * src/rx2.c - More hacking. - -2002-09-14 Erik de Castro Lopo - - * src/mat5.c src/common.c - Changed usage of snprintf() to LSF_SNPRINTF(). - - * Win32/Makefile.msvc - Updated to include new files and add new tests. - - * Win32/config.h Win32/sndfile.h - Updated. - - * doc/api.html - Added note about the possibility of "missing" features actually being - implemented as an sf_command(). - -2002-09-13 Erik de Castro Lopo - - * tests/misc_test.c - Added previously missing update_header_test and zero_data_tests for PAF, - MAT4 and MAT5 formats. - - * src/paf.c src/mat4.c src/mat5.c - Fixed bugs uncovered by new tests above. - - * src/mat5.c - Generalised parsing of name fields of MAT5 files. - - * src/mat5.c src/sndfile.c - Added support for unsigned 8 bit PCM MAT5 files. - - * tests/write_read_test.tpl - Added test for unsigned 8 bit PCM MAT5 files. - - * doc/index.html - Added unsigned 8 bit PCM MAT5 to capabilities matrix. - -2002-09-12 Erik de Castro Lopo - - * test/update_header_test.c tests/misc_test.c - Renamed update_header_test.c to misc_test.c. - Added zero_data_test() to check for case where file is opened for write and - closed immediately. The resulting file can be left in a state where - libsndfile cannot open it. Problem reported by Werner Schweer, the author - of Muse. - - * src/aiff.c - Removed superfluous cast. - - * src/wav.c src/svx.c - Fixed case of file generated with no data. - Removed superfluous cast. - - * src/sndfile.c - Fixed error on IA64 platform caused by incorrect termination of - SndfileErrors struct array. This problem was found in the Debian buildd - logs (http://buildd.debian.org/). - - * configure.in - Added Octave directory. - - * Octave/Makefile.ma - New Makfile.am for Octave directory. - - * Octave/sndfile_load.m Octave/sndfile_save.m Octave/sndfile_play.m - New files for working with Octave. - - * doc/octave.html - Document explaining the use of the above three Octave scripts. - -2002-09-10 Erik de Castro Lopo - - * src/sndfile.c - Fixed bug in RDWR mode. - -2002-09-09 Erik de Castro Lopo - - * src/common.c - Fixed psf_get_date_str() for systems which don't have gmtime_r() or - gmtime(). - - * src/file_io.c - Added #include for Win32. Reported by Koen Tanghe. - -2002-09-08 Erik de Castro Lopo - - * src/common.c - Added 'S' format specifier for psf_binheader_writef() which writes a C - string, including single null terminator to the header. - Added 'j' format specifier to allow jumping forwards or backwards in the - header. - Added function psf_get_date_str(). - - * src/mat5.c - Complete read and write support. - - * doc/index.html - Added entries for MAT4 and MAT5 in capabilities matrix. - -2002-09-06 Erik de Castro Lopo - - * src/mat4.c - Completed read and write support. - - * src/common.h src/sndfile.c - Added MAT4 and MAT5 specific error messages. - - * tests/write_read_test.tpl tests/Makefile.am - Added tests for MAT4 and MAT5 files. - - * tests/stdio_test.c tests/stdout_test.c tests/stdin_test.c - Added tests for MAT4 and MAT5 files. - -2002-09-05 Erik de Castro Lopo - - * src/command.c - Added elements for SF_FORMAT_MAT4 and SF_FORMAT_MAT5 to major_formats - array. - - * examples/sfconvert.c - Added mat4 and mat5 output targets. - -2002-09-04 Erik de Castro Lopo - - * src/sndfile.c - Added check to prevent errors openning read only formats for read/write. - - * src/interleave.c - New file for interleaving non-interleaved data. Non-interleaved data is - only supported on read. - - * src/Makefile.am - Added src/interleave.c to build. - -2002-09-03 Erik de Castro Lopo - - * src/double64.c src/common.h - Added double64_be_read(), double64_le_read(), double64_be_write() and - double64_le_write() which replace double64_read() and double64_write(). - - * src/common.c - Cleanup of psf_binheader_readf() and add ability to read big and little - endian doubles (required by mat4.c and mat5.c). - Add ability for psf_binheader_writef() to write doubles to sound file - headers. - -2002-09-01 Erik de Castro Lopo - - * src/mat5.c - New file for reading Matlab (tm) version 5 data files. This is also the - native binary file format for version 2.1.X of GNU Octave which will be - used for testing. - Not complete yet. - - * src/mat4.c - New file for reading Matlab (tm) version 4.2 data files. This is also the - native binary file format for version 2.0.X of GNU Octave which will be - used for testing. - Not complete yet. - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.c src/Makefile.am - Mods to add Matlab files. - - * src/common.[ch] - Added readf_endian field to SF_PRIVATE struct allowing endianness to - remembered across calls to sf_binheader_readf(). - Fixed bug in width_specifier behaviour for printing hex values. - -2002-08-31 Erik de Castro Lopo - - * src/file_io.c - Check return value of close() call in psf_fclose(). - -2002-08-24 Erik de Castro Lopo - - * src/ms_adpcm.c - Commented out some code where 0x10000 was being subtracted from a short - and the result assigned to a short again. Andrew Zaja found this. - -2002-08-23 Erik de Castro Lopo - - * doc/command.html - Fixed typo found by Tommi Ilmonen. - - * src/ima_adpcm.c - Changed type of diff from short to int to prevent errors which can occur - during very rare circumstances. Thanks to FUWAFUWA. - -2002-08-16 Erik de Castro Lopo - - * tests/floating_point_test.c - Disable testing on machines without lrintf(). - - * Win32/Makefile.msvc - Added dwd.c and wve.c to build. - - * configure.in - Bumped version to 1.0.0. - -2002-08-15 Erik de Castro Lopo - - * src/file_io.c - Add a #include for Mac OS 9. Thanks to Stephane Letz. - - * src/wav.c - Changed an snprintf to LSF_SNPRINTF. - - * doc/Makefile.am - Added version-1.html. - -2002-08-14 Erik de Castro Lopo - - * configure.in - Bumped version to 1.0.rc6. - - * src/*.c - Modified scaling of normalised floats and doubles to integers. Until now - this has been done by multiplying by 0x8000 for short output, 0x80000000 - for 32 bit ints and so on. Unfortunately this can cause an overflow and - wrap around in the target value. All thes values have therefore been - reduced to 0x7FFF, 0x7FFFFFFF and so on. The conversion from ints to - normalised floats and doubles remains unchanged. This does mean that for - repeated conversions normalised float -> pcm16 -> normalised float would - result in a decrease in amplitude of 0x7FFF/0x8000 on every round trip. - This is undesirable but less undesireable than the wrap around I am trying - to avoid. - - * tests/floating_point_test.c - Removed file hash checking because new float scaling procedure introduced - above prevented the ability to crate a has on both x86 and PowerPC systems. - -2002-08-13 Erik de Castro Lopo - - * src/txw.c - Completed reading of TXW files. Seek doesn't work yet. - - * src/file_io.c - Added a MacOS 9 replacement for ftruncate(). - - * MacOS/sndfile.h - Added MacOS 9 header file. This should be copied into src/ to compile - libsndfile for MacOS9. - -2002-08-12 Erik de Castro Lopo - - * src/sndfile.c - Fixed commands SF_SET_NORM_DOUBLE and SFC_SET_NORM_FLOAT to return their - values after being set. Reported by Jussi Laako. - - * configure.in - If autogen is not found, touch all .c and .h files in tests/. - - * src/common.c - Added format width specifier to psf_log_printf() for %u, %d, %D and %X. - - * src/dwd.c - Completed implementation of read only access to these files. - - * src/common.h src/*.c src/pcm.c - Removed redundant field chars from SF_PRIVATE struct and modified - pcm_init() to do without it. - -2002-08-11 Erik de Castro Lopo - - * src/wve.c - New file implementing read of Psion Alaw files. This will be a read only - format. Implementation complete. - - * src/dwd/c - Started implementation of DiamondWare Digitized files. Also read only, not - complete. - - * src/wav.c - Add parsing of 'smpl' chunk. - - * src/paf.c - Fixed reading on un-normalized doubles and floats from 24 bit PAF files. - This brings it into line with the reading of 8 bit files into - un-normalized doubles which returns values in the range [-128, 127]. - - * src/common.c - Modified psf_log_printf() to accept the %% conversion specifier to allow - printing of a single '%'. - - * src/sds.c - Read only of 16 bit samples is working. Need to build a test harness for - this and other read only formats. - -2002-08-10 Erik de Castro Lopo - - * configure.in - Added --enable-experimental configure option. - Removed pkg-config message at the end of the configure process. - - * src/sds.c src/txw.c src/rx2.c src/sd2.c - Moved all the code in these files inside #if ENABLE_EXPERIMENTAL_CODE - blocks and added new *_open() function for the case where experimental is - not enabled. These new functions just return SFE_UNIMPLMENTED. - - * Win32/sndfile.h src/sndfile.h.in src/common.h - Removed un-necessary #pragma pack commands. - - * src/file_io.c - Implemented psf_ftruncate() and much other hacking for Win32. - - * Win32/Makefile.msvc - Updated. - - * doc/win32.html - Updated to include the copying of the sndfile.h file from the Win32/ - directory to the src/ directory. - - * Make.bat - Batch file to make compiling on Wi32 a little easier. Implements "make" and - "make check". - -2002-08-09 Erik de Castro Lopo - - * src/file_io.c - Add place holder for ftruncate() on Win32 which doesn't have ftruncate(). - This will need to be fixed later. - - * src/sndfile.h.in - New file (copy of sndfile.h) with sets up @TYPEOF_SF_COUNT_T@ which will be - replaced by the correct type during configure. - - * configure.in - Modified to find a good type for TYPEOF_SF_COUNT_T. - - * src/aiff.c - Fixed a bug when reading malformed headers. - - * src/common.c - Set read values to zero before performing read. - -2002-08-08 Erik de Castro Lopo - - * doc/command.html - Fixed some HTML tags which were not allowing jumps to links within the - page. - - * src/sds.c - Massive hacking on this. - - * src/wav.c - Added recognition of 'clm ' tag. - -2002-08-07 Erik de Castro Lopo - - * doc/index.html - Added beginning of a capabilities list beyond simple file formats which - can be read/written. - - * src/aiff.c - Added parsing of INST and MARK chunks of AIFF files. At the moment this - data is simply recorded in the log buffer. Later it will be possible to - read this data from an application using sf_command(). - - * src/wav.c - Added parsing of 'cue ' chunk which contains loop information in WAV files. - - * exampes/sndfile-info.c - Changed reporting of Samples to Frames. - - * src/wav.c src/w64.c src/aiff.c src/wav_w64.h - Moved from a samples to a frames nomenclature to avoid confusion. - - * doc/FAQ.html - What's the best format for storing temporary files? - - * src/sds.c - New file for reading/writing Midi Sample Dump Standard files. - - * src/Makefile.am src/sndfile.c src/common.[ch] - Added hooks for sds.c. - - * examples/sndfile-info.c - Changed from using sf_perror() to using sf_error_str(). - -2002-08-06 Erik de Castro Lopo - - * doc/api.html - Added explanation of mode parameter for sf_open(). - Added explanation of usage of SFM_* values in sf_seek(). - - * src/sndfile.[ch] src/command.c src/file_io.c src/common.h - Implemented SFC_FILE_TRUNCATE to allow a file to be truncated. File - truncation was suggested by James McCartney. - - * src/command.html - Documented SFC_FILE_TRUNCATE. - - * tests/command_test.c - Add tests for SFC_FILE_TRUNCATE. - - * src/sndfile.c - Added a thrid parameter to the VALIDATE_SNDFILE_AND_ASSIGN_PSF macro to - make resetting the error number optional. All uses of the macro other than - in error reporting functions were changed to reset the error number. - - * src/pcm.c - Fixed a bug were sf_read_* was logging an SFE_SHORT_READ even when no error - occurred. - - * tests/write_read_test.tpl - Added tests of internal error state. - -2002-08-05 Erik de Castro Lopo - - * src/GSM610/private.h src/GSM610/*.c src/GSM610/Makefile.am - Renamed private.h to gsm610_priv.h to prevent clash with other headers - named private.h in other directories. (Probably only a problem on MacOS 9). - - * src/G72x/private.h src/G72x/*.c src/G72x/Makefile.am - Renamed private.h to g72x_priv.h to prevent clash with other headers - named private.h in other directories. (Probably only a problem on MacOS 9). - - * MacOS/config.h - Changed values of HAVE_LRINT and HAVE_LRINTF to force use of code in - float_cash.h. - - * src/sndfile.h - Changes the name of samples field of the SF_INFO to frames. The old name - had caused too much confusion and it simply had to be changed. There will - be at least one more pre-release. - -2002-08-04 Erik de Castro Lopo - - * doc/index.html - Updated formats matrix to include RAW (header-less) GSM 6.10. - Fix specificaltion of table and spelling mistakes. - - * src/sndfile.c src/command.c - Fixed bug in SFC_CALC_MAX_SIGNAL family and psf_calc_signal_max (). - - * tests/command.c - Removed cruft. - Added test for SFC_CALC_MAX_SIGNAL and SFC_CALC_NORM_MAX_SIGNAL. - - * configure.in - Update version to 1.0.0rc5. - - * sfendian.h - Removed inclusion of un-necessary header. - -2002-08-03 Erik de Castro Lopo - - * src/aiff.c - Minor fixes of info written to log buffer. - - * src/float_cast.h - Add definition of HAVE_LRINT_REPLACEMENT. - - * tests/floating_point_test.c - Fix file hash check on systems without lrint/lrintf. - - * tests/dft_cmp.c - Limit SNR to less than -500.0dB. - - * examples/sndfile2oct.c - Fixed compiler warnings. - - * doc/api.html - Fixed error where last parameter of sf_error_str() was sf_count_t instead - of size_t. - -2002-08-02 Erik de Castro Lopo - - * doc/FAQ.html - Why doesn't libsndfile do interleaving/de-interleaving. - - * tests/pcm_test.tpl - On Win32 do not perform hash check on files containing doubles. - -2002-08-01 Erik de Castro Lopo - - * src/common.h - Defined SF_COUNT_MAX_POSITIVE() macro, a portable way of setting variables - of type sf_count_t to their maximum positive value. - - * src/dwvw.c src/w64.c - Used SF_COUNT_MAX_POSITIVE(). - -2002-07-31 Erik de Castro Lopo - - * src/paf.c - Fixed bug in reading/writing of 24 bit PCM PAF files on big endian systems. - - * tests/floating_point_tests.c - Fixed hash values for 24 bit PCM PAF files. - Disabled file has check if lrintf() function is not available and added - warning. - Decreased level of signal from a peak of 1.0 to a value of 0.95 to prevent - problems on platforms without lrintf() ie Solaris. - -2002-07-30 Erik de Castro Lopo - - * src/wav.c - Fixed a problem with two different kinds of mal-formed WAV file header. The - first had the 'fact' chunk before the 'fmt ' chunk, the other had an - incomplete 'INFO' chunk at the end of the file. - - * src/w64.c - Added fix to allow differentiation between W64 files and ACID files. - - * src/au_g72x.c src/common.h src/sndfile.c - Added error for G72x encoded files with more than one channel. - - * tests/pcm_test.tpl tests/utils.tpl - Moved function check_file_hash_or_die() to utils.tpl. Function was then - modified to calculate the has of the whole file. - - * src/wav.c - Fixed problem writing the 'fact' chunk on big endian systems. - - * tests/sfconvert.c - Fixed bug where .paf files were being written as Sphere NIST. - -2002-07-29 Erik de Castro Lopo - - * src/voc.c - Fix for reading headers generated using SFC_UPDATE_HEADER_NOW. - - * doc/command.html - Add docs for SFC_UPDATE_HEADER_NOW and SFC_SET_UPDATE_HEADER_AUTO. - -2002-07-28 Erik de Castro Lopo - - * man/sndfile-info.1 man/sndfile-play.1 - Added manpages supplied by Joshua Haberman the Debian maintainer for - libsndfile. Additional tweaks by me. - - * configure.in man/Makefile.am - Hooked manpages into autoconf/automake system. - - * src/sndfile.c - Added hooks for SFC_SET_UPDATE_HEADER_AUTO. - - * tests/update_header_test.c - Improved rigor of testing. - - * src/*.c - Fixed problem with *_write_header() functions. - -2002-07-27 Erik de Castro Lopo - - * doc/*.html - Updates to documentation to fix problems found by wdg-html-validator. - - * src/common.h src/command.c - Added normalize parameter to calls to psf_calc_signal_max() and - psf_calc_max_all_channels(). - - * src/sndfile.c - Added handling for commands SFC_CALC_NORM_SIGNAL_MAX and - SFC_CALC_NORM_MAX_ALL_CHANNELS. - - * doc/command.html - Added entry for SFC_CALC_NORM_SIGNAL_MAX and SFC_CALC_NORM_MAX_ALL_CHANNELS. - -2002-07-26 Erik de Castro Lopo - - * examples/sndfile-play.c Win32/Makefile.msvc - Get sndfile-play program working on Win32. The Win32 PCM sample I/O API - sucks. The sndfile-play program now works on Linux, MacOSX, Solaris and - Win32. - -2002-07-25 Erik de Castro Lopo - - * doc/FAQ.html - New file for frequently asked questsions. - -2002-07-22 Erik de Castro Lopo - - * doc/api.html - Documentation fixes. - - * src/au.[ch] src/au_g72x.c src/G72x/g72x.h - Add support of 40kbps G723 ADPCM encoding. - - * tests/lossy_comp_test.c tests/floating_point_test.c - Add tests for 40kbps G723 ADPCM encoding. - - * doc/index.html - Update support matrix. - -2002-07-21 Erik de Castro Lopo - - * doc/command.html - Documented SFC_GET_SIMPLE_FORMAT_COUNT, SFC_GET_SIMPLE_FORMAT, - SFC_GET_FORMAT_* and SFC_SET_ADD_PEAK_CHUNK. - - * src/sndfile.c src/pcm.c - Add ability to turn on and off the addition of a PEAK chunk for floating - point WAV and AIFF files. - - * src/sndfile.[ch] src/common.h src/command.c - Added sf_command SFC_CALC_MAX_ALL_CHANNELS. Implemented by Maurizio Umberto - Puxeddu. - - * doc/command.html - Docs for SFC_CALC_MAX_ALL_CHANNELS (assisted by Maurizio Umberto Puxeddu). - -2002-07-18 Erik de Castro Lopo - - * src/sndfile.c src/gsm610.c - Finalised support for GSM 6.10 AIFF files and added support for GSM 6.10 - encoded RAW (header-less) files. - - * src/wav.c - Add support for IBM_FORMAT_MULAW and IBM_FORMAT_ALAW encodings. - - * src/api.html - Fixed more documentation bugs. - -2002-07-17 Erik de Castro Lopo - - * src/sndfile.h src/common.h - Moved some yet-to-be-implelmented values for SF_FORMAT_* from the public - header file sndfile.h to the private header file common.h to avoid - confusion about the actual capabilities of libsndfile. - -2002-07-16 Erik de Castro Lopo - - * src/aiff.c src/wav.c - Fixed file parsing for WAV and AIFF files containing non-audio data after - the data chunk. - - * src/aiff.c src/sndfile.c - Add support for GSM 6.10 encoded AIFF files. - - * tests/lossy_comp_test.c tests/Makefile.am - Add tests for GSM 6.10 encoded AIFF files. - - * src/*.c - Fix compiler warnings. - -2002-07-15 Erik de Castro Lopo - - * tests/command_test.c - For SFC_SET_NORM_* tests, change the file format from SF_FORMAT_WAV to - SF_FORMAT_RAW. - - * src/sndfile.c - Added sf_command(SFC_TEST_ADD_TRAILING_DATA) to allow testing of reading - from AIFF and WAV files with non-audio data after the audio chunk. - - * src/common.h - Add test commands SFC_TEST_WAV_ADD_INFO_CHUNK and - SFC_TEST_AIFF_ADD_INST_CHUNK. When these commands are working, they will be - moved to src/sndfile.h - - * src/aiff.c src/wav.c - Begin implementation of XXXX_command() hook for sf_command(). - - * tests/write_read_test.tpl - Added sf_command (SFC_TEST_ADD_TRAILING_DATA) to ensure above new code was - working. - -2002-07-13 Erik de Castro Lopo - - * tests/update_header_test.c - Allow read sample count == write sample count - 1 to fix problems with VOC - files. - - * tests/write_read_test.tpl tests/pcm_test.tpl - Fixed some problems in the test suite discovered by using Valgrind. - -2002-07-12 Erik de Castro Lopo - - * tests/utils.[ch] tests/*.c - Renamed check_log_buffer() to check_log_buffer_or_die(). - - * src/sndfile.c - SFC_UPDATE_HEADER_NOW and SFC_SETUPDATE_HEADER_AUTO almost finished. Works - for all file formats other than VOC. - -2002-07-11 Erik de Castro Lopo - - * src/sndfile.[ch] src/common.h - Started adding functionality to allow the file header to be updated before - the file is closed on files open for SFM_WRITE. This was requested by - Maurizio Umberto Puxeddu who is using libsndfile for file I/O in iCSound. - - * tests/update_header_test.c - New test program to test that the above functionality is working correctly. - - * tests/peak_chunk_test.c tests/floating_point_test.c - Cleanups. - -2002-07-10 Erik de Castro Lopo - - * src/sfendian.[ch] - Changed length count parameters for all endswap_XXX() functions from - sf_count_t (which can be 64 bit even on 32 bit architectures) to int. These - functions are only called frin inside the library, are always called with - integer parameters and doing the actual calculation on 64 bit values is - slow in comparision to doing it on ints. - - * examples/sndfile-play.c - More playback hacking for Win32. - -2002-07-09 Erik de Castro Lopo - - * src/common.c - In psf_log_printf(), changed %D format conversion specifier to %M (marker) and - added %D specifier for printing the sf_count_t type. - - * src/*.c - Changed all usage of psf_log_printf() with %D format conversion specifiers - to use %M conversion instead. - - * tests/pcm_test.tpl tests/pcm_test.def - New files to autogen pcm_test.c. - - * src/pcm.c - Fixed bug in scaling floats and doubles to 24 bit PCM and vice versa. - -2002-07-08 Erik de Castro Lopo - - * configure.in - Fix setup of $ac_cv_sys_largefile_CFLAGS so that sndfile.pc gets valid - values for CFLAGS. - - * examples/sndfile-play.c - Start adding playback support for Win32. - -2002-07-07 Erik de Castro Lopo - - * src/*.c - Worked to removed compiler warnings. - Extensive refactoring. - - * src/common.[ch] - Added function psf_memset() which works like the standard C function memset - but takes and sf_count_t as the length parameter. - - * src/sndfile.c - Replaced calls to memset(0 with calls to psf_memset() as required. - -2002-07-06 Erik de Castro Lopo - - * src/sndfile.c - Added "libsndfile : " to the start of all error messages. This was suggested - by Conrad Parker author of Sweep ( http://sweep.sourceforge.net/ ). - - * src/sfendian.[ch] - Added endswap_XXXX_copy() functions. - - * src/pcm.c src/float32.c src/double64.c - Use endswap_XXXX_copy() functions and removed dead code. - Cleanups and optimisations. - -2002-07-05 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h - Gave values to all the SFC_* enum values to allow better control of the - interface as commands are added and removed. - Added new command SFC_SET_ADD_PEAK_CHUNK. - - * src/wav.c src/aiff.c - Modified wav_write_header and aiff_write_header to make addition of a PEAK - chunk optional, even on floating point files. - - * tests/benchmark.tpl - Added call to sf_command(SFC_SET_ADD_PEAK_CHUNK) to turn off addition of a - PEAK chunk for the benchmark where we are trying to miximize speed. - - * src.pcm.c - Changed tribyte typedef to something more sensible. - Further conversion speed ups. - -2002-07-03 Erik de Castro Lopo - - * src/command.c - In major_formats rename "Sphere NIST" to "NIST Sphere". - - * src/common.c src/sfendian.c - Moved all endswap_XXX_array() functions to sfendian.c. These functions will - be tweaked to provide maximum performance. Since maximum performance on one - platform does not guarantee maximum performance on another, a small set of - functions will be written and the optimal one chosen at compile time. - - * src/common.h src/sfendian.h - Declarations of all endswap_XXX_array() functions moved to sfendian.h. - - * src/Makefile.am - Add sfendian.c to build targets. - -2002-07-01 Erik de Castro Lopo - - * src/pcm.c src/sfendian.h - Re-coded PCM encoders and decoders to match or better the speed of - libsndfile version 0.0.28. - -2002-06-30 Erik de Castro Lopo - - * src/wav.c - Add checking for WAVPACK data in standard PCM WAV file. Return error if - found. This WAVPACK is *WAY* broken. It uses the same PCM WAV file header - and then stores non-PCM data. - - * tests/benchmark.tpl - Added more tests. - -2002-06-29 Erik de Castro Lopo - - * tests/benchmark.tpl - Added conditional definition of M_PI. - For Win32, set WRITE_PERMS to 0777. - - * Win32/Makefile.msvc - Added target to make generate program on Win32. - - * src/samplitude.c - Removed handler for Samplitude RAP file format. This file type seems rarer - than hens teeth and is completely undocumented. - - * src/common.h src/sndfile.c src/Makefile.am Win32/Makefile.msvc - Removed references to sampltiude RAP format. - - * tests/benchmark.tpl - Benchmark program now prints the libsndfile version number when run. This - program was also backported to version 0 to compare results. Version - 1.0.0rc2 is faster than version 0.0.28 on most conversions but slower on - some. The slow ones need to be fixed before final release. - -2002-06-28 Erik de Castro Lopo - - * tests/benchmark.def tests/benchmark.tpl - New files which generate tests/benchmark.c using Autogen. Added int -> - SF_FORMAT_PCM_24 test. - - * tests/benchmark.c - Now and Autogen output file. - - * tests/Makefile.am - Updated for above changes. - -2002-06-27 Erik de Castro Lopo - - * tests/benchmark.c - Basic benchmark program complete. Need to convert it to Autogen. - - * Win32/Makefile.msvc - Added benchmark.exe target. - -2002-06-26 Erik de Castro Lopo - - * examples/generate.c - New program to generate a number of different output file formats from a - single input file. This allows testing of the created files. - - * tests/benchmark.c - New test program to benchmark libsndfile. Nowhere near complete yet. - - * examples/Makefile.am tests/Makefile.am - New make rules for the two new programs. - -2002-06-25 Erik de Castro Lopo - - * Win32/libsndfile.def - Removed definition for sf_signal_max(). - - * src/sndfile.c - Removed cruft. - - * doc/index.html - A number of documentation bugs were fixed. Thanks to Anand Kumria. - - * doc/version-1.html - Minor doc updates. - - * configure.in - Bumped version to 1.0.0rc2. - - * src/sf_command.h src/Makefile.am - Removed the header file as it was no longer being used. Thanks to Anand - Kunria for spotting this. - - * doc/index.html - A number of documentation bugs were fixed. Thanks to Anand Kumria. - -2002-06-24 Erik de Castro Lopo - - * src/common.h - Test for Win32 before testing SIZEOF_OFF_T so that it works correctly - on Win32.. - - * src/file_io.c - Win32 fixes to ensure O_BINARY is used for file open. - - * doc/win32.html - New file documenting the building libsndfile on Win32. - - * doc/*.html - Updating of documentation. - -2002-06-23 Erik de Castro Lopo - - * tests/pcm_test.c - Minor changes to allow easier determination of test file name. - - * src/sndfile.[ch] - Removed function sf_signal_max(). - - * examples/sndfile-play.c - Changed call to sf_signal_max() to a call to sf_command(). - -2002-06-22 Erik de Castro Lopo - - * src/format.c src/command.c - Renamed format.c to command.c which will now include code for sf_command() - calls to perform operations other than format commands. - - * src/sndfile.c src/sndfile.h - Removed function sf_get_signal_max() which is replaced by commands passed - to sf_command(). - - * src/command.c - Implement commands SFC_CALC_SIGNAL_MAX. - - * doc/command.html - Documented SFC_CALC_SIGNAL_MAX. - -2002-06-21 Erik de Castro Lopo - - * examples/sndfile-play.c - Mods to make sndfile-play work on Solaris. The program sndfile-play now - runs on Linux, MaxOSX and Solaris. Win32 to come. - - * src/format.c - Added SF_FORMAT_DWVW_* to subtype_formats array. - - * src/nist.c - Added support for 8 bit NIST Sphere files. Example file supplied by Anand - Kumria. - -2002-06-20 Erik de Castro Lopo - - * examples/sndfile-info.c - Tidy up of output format. - - * examnples/sndfile-play.c - Mods to make sndfile-play work on MacOSX using Apple's CoreAudio API. - - * configure.in - Add new variables OS_SPECIFIC_INCLUDES and OS_SPECIFIC_LINKS which were - required to supply extra include paths and link parameters to get - sndfile-play working on MacOSX. - - * examples/Makefile.am - Use OS_SPOECIFIC_INCLUDES and OS_SPECIFIC_LINKS to build commands for - sndfile-play. - -2002-06-19 Erik de Castro Lopo - - * src/nist.c - Added ability to read/write new NIST Sphere file types (A-law, u-law). - Header parser was re-written from scratch. Example files supplied by Anand - Kumria. - - * src/sndfile.c - Support for A-law and u-law NIST files. - - * tests/Makefile.am tests/lossy_comp_test.c - Tests for A-law and u-law NIST files. - -2002-06-18 Erik de Castro Lopo - - * tests/utils.c - Fixed an error in error string. - -2002-06-17 Erik de Castro Lopo - - * acinclude.m4 - Removed exit command to allow cross-compiling. - - * Win32/unistd.h src/file_io.c - Moved contents of first file into the second file (enclosed in #ifdef). - Win32/unistd.h is now an empty file but still must be there for libsndfile - to compile on Win32. - - * src/sd2.c, src/sndfile.c: - Fixes for Sound Designer II files on big endian systems. - -2002-06-16 Erik de Castro Lopo - - * configure.in - Modified to work around problems with crappy MacOSX version of sed. - Added sanity check for proper values for CFLAGS. - -2002-06-14 Erik de Castro Lopo - - * src/sndfile.c - Code clean up in sf_open (). - - * Win32/Makefile.msvc - Michael Fink's contributed MSVC++ makefile was hacked to bits and put back - together in a new improved form. - - * src/file_io.c - Fixes for Win32; _lseeki64() returns an invalid argument for calls like - _lseeki64(fd, 0, SEEK_CUR) so need to use _telli64 (fd) instead. - - * src/common.h src/sndfile.c src/wav.c src/aiff.c - Added SFE_LOG_OVERRUN error. - Added termination for potential infinite loop when parsing file headers. - - * src/wav.c src/w64.c - Fixed bug casuing incorrect header generation when opening file read/write. - -2002-06-12 Erik de Castro Lopo - - * doc/api.html - Improved the documentation to make it clearer that the file read method - and the underlying file format are completely disconnected. Suggested - by Josh Green. - - * doc/command.html - Started correcting docs to take into account changes made to the - operations of the sf_command () function. Not complete yet. - - * src/sndfile.c - Reverted some changes which had broken the partially working SDII header - parsing. Now have access to an iBook with OS X so reading and writing SDII - files on all platforms should be a reality in the near future. On Mac this - will involve reading the resource fork via the standard MacOS API. To move - a file from Mac to another OS, the resource and data forks will need to be - combined before transfer. The combined file will be read on both Mac and - other OSes like any other file. - -2002-06-08 Erik de Castro Lopo - - * ltmain.sh - Applied a patch from http://fink.sourceforge.net/doc/porting/libtool.php - which allows libsndfile to compile on MacOSX 10.1. This patch should not - interfere with compiling on other OSes. - - * src/GSM610/private.h - Changes to fix compile problems on MacOSX (see src/GSM610/ChangeLog). - - * src/float_cast.h - Added MacOSX replacements for lrint() and lrintf(). - -2002-06-05 Erik de Castro Lopo - - * src/sndfile.c - Replaced the code to print the filename to the log buffer when a file is - opened. This code seems to have been left out during the merge of - sf_open_read() and sf_open_write() to make a single functions sf_open(). - -2002-06-01 Erik de Castro Lopo - - * src/wav.c - Fixed a bug where the WAV header parser was going into an infinite loop - on a badly formed LIST chunk. File supplied by David Viens. - -2002-05-25 Erik de Castro Lopo - - * configure.in - Added a message at the end of the configuration process to warn about the - need for the use of pkg-config when linking programs against version 1 of - libsndfile. - - * doc/pkg-config.html - New documentation file containing details of how to use pkg-config to - retrieve settings for CFLAGS and library locations for linking files - against version 1 of libsndfile. - -2002-05-17 Erik de Castro Lopo - - * src/wav.c - Fixed minor bug in handling of so-called ACIDized WAV files. - -2002-05-16 Erik de Castro Lopo - - * Win32/libsndfile.def Win32/Makefile.msvc - Two new files contributed by Michael Fink (from the winLAME project) - which allows libsndfile to be built on windows in a MSDOS box by doing - "nmake -f Makefile.msvc". Way cool! - -2002-05-15 Erik de Castro Lopo - - * configure.in - MacOSX is SSSOOOOOOO screwed up!!! I can't believe how hard it is to - generate a tarball which will configure and compile on that platform. - Joined the libtool mailing list to try and get some answers. - -2002-05-13 Erik de Castro Lopo - - * configure.in - Changed to autoconf version 2.50. MacOSX uses autoconf version 2.53 which - is incompatible with with version 2.13 which had been using until now. - The AC_SYS_LARGE_FILE macro distributed withe autoconf 2.50 is missing a - few features so AC_SYS_EXTRA_LARGE file was defined to replace it. - - * configure.in - Changed to automake version 1.5 to try and make a tarball which will - work on MacOSX. - -2002-05-12 Erik de Castro Lopo - - * src/wav_gsm610.c - Changed name to gsm610.c. Added reading/writing of headerless files. - - * src/sndfile.c src/raw.c - Added ability to read/write headerless (SF_FORMAT_RAW) GSM 6.10 files. - -2002-05-11 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Clean up in preparation for Autogen-ing this file. - - * src/GSM610/*.[ch] - Code cleanup and prepartion forgetting file seek working. Details in - src/GSM610/ChangeLog. - - * sndfile.pc.in - Testing complete. Is sndfile.m4 still needed? - -2002-05-09 Erik de Castro Lopo - - * tests/write_read_test.tpl tests/rdwr_test.tpl - Merged tests from these two programs into write_read_test.tpl and deleted - rdwr_test.tpl. - -2002-05-08 Erik de Castro Lopo - - * src/w64.c src/svx.c src/paf.c - Fixed bugs in read/write mode. - -2002-05-07 Erik de Castro Lopo - - * examples/Makefile.am - Renamed sfplay.c to sndfile-play.c and sndfile_info.c to sndfile-info.c for - consistency when these programs become part of the Debian package - sndfile-programs. - - * sndfile.pc.in - New file to replace sndfile-config.in. Libsndfile now uses the pkg-config - model for providing installation parameters to dependant programs. - - * src/sndfile.c - Cleanup of code in sf_open(). - -2002-05-06 Erik de Castro Lopo - - * tests/utils.tpl tests/write_read_test.tpl - More conversion to Autogen fixes and enchancements. - - * src/*.c - Read/write mode is now working for 16, 24 and 32 bit PCM as well as 32 - bit float and 64 bit double data. More tests still required. - - * src/Makefile.am - Added DISTCLEANFILES target to remove config.status and config.last. - - * Win32/Makefile.am MacOS/Makefile.am - Added DISTCLEANFILES target to remove Makefile. - -2002-05-05 Erik de Castro Lopo - - * src/*.[ch] tests/rdwr_test.c - More verifying workings of read/write mode. Fixing bugs found. - - * tests/utils.[ch] - Made these files Autogen generated files. - - * tests/util.tpl tests/util.def - New Autogen files to generate utils.[ch]. Moved some generic test functions - into this file. Autogen is such a great tool! - -2002-05-03 Erik de Castro Lopo - - * src/pcm.c src/float_cast.h Win32/config.h - Fixed a couple of Win32 specific bugs pointed out by Michael Fink - (maintainer of WinLAME) and David Viens. - - * tests/check_log_buffer.[ch] tests/utils.[ch] - Moved check_log_buffer() to utils.[ch] and deleted old file. - -2002-05-02 Erik de Castro Lopo - - * src/common.[ch] src/sndfile.c - New function psf_default_seek() which will be the default seek function - for things like PCM and floating point data. This default is set for - both read and write in sf_open() but can be over-ridden by any codec - during it's initialisation. - -2002-05-01 Erik de Castro Lopo - - * src/au.c - AU files use a data size value of -1 to mean unknown. Fixed au_open_read() - to allow opening files like this. - - * tests/rdwr_test .c - Added more tests. - - * src/sndfile.c - Fixed bugs in read/write mode found due to improvements in the test - program. - -2002-04-30 Erik de Castro Lopo - - * tests/rdwr_test .c - New file for testing read/write mode. - -2002-04-29 Erik de Castro Lopo - - * m4/* - Removed all m4 macros from this directory as they get concatenated to form - the file aclocal.m4 anyway. - - * sndfile.m4 - Moved this from the m4 directory to the root directory asn this is part of - the distribution and is installed during "make install". - -2002-04-29 Erik de Castro Lopo - - * src/float32.c - Removed logging of peaks for all file formats other than AIFF and WAV. - - * tests/write_read_test.tpl tests/write_read_test.def - New files which autogen uses to generate write_read_test.c. Doing it this - way makes write_read_test.c far easier to maintain. Other test programs - will be converted to autogen in the near future. - - * src/*.c - Fixed a few bugs found when testing on Sparc (bug endian) Solaris. - -2002-04-28 Erik de Castro Lopo - - * doc/*.html - Fixed documention versioning. - - * configure.in - Fixed a bug in the routines which search for Large File Support on systems - which have large file support by defualt. - -2002-04-27 Erik de Castro Lopo - - * src/*.[ch] - Found and fixed an issue which can cause a bug in other software (I was - porting Conrad Parker's Sweep program from version 0 of the library to - version 1). When opening a file for write, the libsndfile code would - set the sfinfo.samples field to a maximum value. - - * tests/write_read_test.c - Added tests to detect the above problem. - -2002-04-25 Erik de Castro Lopo - - * src/*.[ch] - Finished base implementation of read/write mode. Much more testing still - needed. - - * m4/largefile.m4 - Macro for detecting Large File Standard capabilities. This macro was ripped - out of the aclocal.m4 file of GNU tar-1.13. - - * configure.in - Added detection of large file support. Files larger than 2 Gigabytes should - now be supported on 64 bit platforms and many 32 bit platforms including - Linux (2.4 kernel, glibc-2.2), *BSD, MacOS, Win32. - - * libsndfile_convert_version.py - A Python script which attempts to autoconvert code written to use version 0 - to version 1. - -2002-04-24 Erik de Castro Lopo - - * src/*.[ch] - Finished base implementation of read/write mode. Much more testing still - needed. - - * tests/write_read_test.c - Preliminary tests for read/write mode added. More needed. - -2002-04-20 Erik de Castro Lopo - - * src/sndfile.[ch] - Removed sf_open_read() and sf_open_write() functions,replacting them with - sf_open() which takes an extra mode parameter (SF_OPEN_READ, SF_OPEN_WRITE, - or SF_OPEN_RDWR). This new function sf_open can now be modified to allow - opening a file formodification (RDWR). - -2002-04-19 Erik de Castro Lopo - - * src/*.c - Completed merging of separate xxx_open_read() and xxx_open_write() - functions. All tests pass. - -2002-04-18 Erik de Castro Lopo - - * src/au.c - Massive refactoring required to merge au_open_read() with au_open_write() - to create au_open(). - -2002-04-17 Erik de Castro Lopo - - * src/*.c - Started changes required to allow a sound file to be opened in read/write - mode, with separate file pointers for read and write. This involves merging - of encoder/decoder functions like pcm_read_init() and pcm_write_init() - int a new function pcm_init() as well as doing something similar for all - the file type specific functions ie aiff_open_read() and aiff_open_write() - were merged to make the function aiff_open(). - -2002-04-15 Erik de Castro Lopo - - * src/file_io.c - New file containing psf_fopen(), psf_fread(), psf_fwrite(), psf_fseek() and - psf_ftell() functions. These function will replace use of fopen/fread/fwrite - etc and allow access to files larger than 2 gigabytes on a number of 32 bit - OSes (Linux on x86, 32 bit Solaris user space apps, Win32 and MacOS). - - * src/*.c - Replaced all instances of fopen with psf_open, fread with psd_read, fwrite - with psf_write and so on. - -2002-03-11 Erik de Castro Lopo - - * src/dwvw.c - Finally fixed all known problems with 12, 16 and 24 bit DWVW encoding. - - * tests/floating_point_test.c - Added tests for 12, 16 and 24 bit DWVW encoding. - -2002-03-03 Erik de Castro Lopo - - * m4/endian.m4 - Defines a new m4 macro AC_C_FIND_ENDIAN, for determining the endian-ness of - the target CPU. It first checks for the definition of BYTE_ORDER in - , then in and . If none of these work - and the C compiler is not a cross compiler it compiles and runs a program - to test for endian-ness. If the compiler is a cross compiler it makes a - guess based on $target_cpu. - - * configure.in - Modified to use AC_C_FIND_ENDIAN. - - * src/sfendian.h - Simplified. - -2002-02-23 Erik de Castro Lopo - - * tests/floating_point_test.c - Tests completely rewritten using the dft_cmp function. Now able to - calculate a quick guesstimate of the Signal to Noise Ratio of the encoder. - -2002-02-15 Erik de Castro Lopo - - * tests/dft_cmp.[ch] - New files containing functions for comparing pre and post lossily - compressed data using a quickly hacked DFT. - - * tests/utils.[ch] - New files containing functions for saving pre and post encoded data in a - file readable by the GNU Octave package. - -2002-02-13 Erik de Castro Lopo - - * m4/lrint.m4 m4/lrintf.m4 - Fixed m4 macros to define HAVE_LRINT and HAVE_LRINTF even when the test - is cached. - -2002-02-12 Erik de Castro Lopo - - * tests/floating_point_test.c - Fixed improper use of strncat (). - -2002-02-11 Erik de Castro Lopo - - * tests/headerless_test.c - New test program to test the ability to open and read a known file type as a - RAW header-less file. - -2002-02-07 Erik de Castro Lopo - - * tests/losy_comp_test.c - Added a test to ensure that the data read from a file is not all zeros. - - * examples/sfconvert.c - Added "-gsm610" encoding types. - -2002-01-29 Erik de Castro Lopo - - * examples/sfconvert.c - Added "-dwvw12", "-dwvw16" and "-dwvw24" encoding types. - - * tests/dwvw_test.c - New file for testing DWVW encoder/decoder. - -2002-01-28 Erik de Castro Lopo - - * src/dwvw.c - Implemented writing of DWVW. 12 bit seems to work, 16 and 24 bit still broken. - - * src/aiff.c - Improved reporting of encoding types. - - * src/voc.c - Clean up. - -2002-01-27 Erik de Castro Lopo - - * src/dwvw.c - New file implementing lossless Delta Word Variable Width (DWVW) encoding. - Reading 12 bit DWVW is now working. - - * src/aiff.c common.h sndfile.c - Added hooks for DWVW encoded AIFF and RAW files. - -2002-01-15 Erik de Castro Lopo - - * src/w64.c - Robustify header parsing. - - * src/wav_w64.h - Header file wav.h was renamed to wav_w64.h to signify sharing of - definitions across the two file types. - - * src/wav.c src/w64.c src/wav_w64.c - Refactoring. - Modified and moved functions with a high degree of similarity between - wav.c and w64.c to wav_w64.c. - -2002-01-14 Erik de Castro Lopo - - * src/w64.c - Completed work on getting read and write working. - - * examples/sfplay.c - Added code to scale floating point data so it plays at a reasonable volume. - - * tests/Makefile.am tests/write_read_test.c - Added tests for W64 files. - -2002-01-13 Erik de Castro Lopo - - * src/*.c - Modded all code in file header writing routines to use - psf_new_binheader_writef(). - Removed psf_binheader_writef() from src/common.c. - Globally replaced psf_new_binheader_writef with psf_binheader_writef. - -2002-01-12 Erik de Castro Lopo - - * src/*.c - Modded all code in file parsing routines to use psf_new_binheader_readf(). - Removed psf_binheader_readf() from src/common.c. - Globally replaced psf_new_binheader_readf with psf_binheader_readf. - - * src/common.[ch] - Added new function psf_new_binheader_writef () which will soon replace - psf_binheader_writef (). The new function has basically the same function - as the original but has a more flexible and capable interface. It also - allows the writing of 64 bit integer values for files contains 64 bit file - offsets. - -2002-01-11 Erik de Castro Lopo - - * src/formats.c src/sndfile.c src/sndfile.h - Added code allowing full enumeration of supported file formats via the - sf_command () interface. - This feature will allow applications to avoid needing recompilation when - support for new file formats are added to libsndfile. - - * tests/command_test.c - Added test code for the above feature. - - * examples/list_formats.c - New file. An example of the use of the supported file enumeration - interface. This program lists all the major formats and for each major - format the supported subformats. - -2002-01-10 Erik de Castro Lopo - - * src/*.[ch] tests/*.c - Changed command parameter of sf_command () function from a test string to - an int. The valid values for the command parameter begin with SFC_ and are - listed in src/sndfile.h. - -2001-12-20 Erik de Castro Lopo - - * src/formats.c src/sndfile.c - Added an way of enumerating a set of common file formats using the - sf_command () interface. This interface was suggested by Dominic Mazzoni, - one of the main authors of Audacity (http://audacity.sourceforge.net/). - -2001-12-26 Erik de Castro Lopo - - * src/sndfile.c - Added checking of filename parameter in sf_open_read (). Previousy, if a - NULL pointer was passed the library would segfault. - -2001-12-18 Erik de Castro Lopo - - * src/common.c src/common.h - Changed the len parameter of the endswap_*_array () functions from type - int to type long. - - * src/pcm.c - Fixed a problem which - -2001-12-15 Erik de Castro Lopo - - * src/sndfile.c - Added conditional #include for EMX/gcc on OS/2. Thanks to - Paul Hartman for pointing this out. - - * tests/lossy_comp_test.c tests/floating_point_test.c - Added definitions for M_PI for when it isn't defined in . - -2001-11-30 Erik de Castro Lopo - - * src/ircam.c - Re-implemented the header reader. Old version was making incorrect - assumptions about the endian-ness of the file from the magic number at the - start of the file. The new code looks at the integer which holds the - number of channels and determines the endian-ness from that. - -2001-11-30 Erik de Castro Lopo - - * src/aiff.c - Added support for other AIFC types ('raw ', 'in32', '23ni'). - Further work on IMA ADPCM encoding. - -2001-11-29 Erik de Castro Lopo - - * src/ima_adpcm.c - Renamed from wav_ima_adpcm.c. This file will soon handle IMA ADPCM - encodings for both WAV and AIFF files. - - * src/aiff.c - Started adding IMA ADPCM support. - -2001-11-28 Erik de Castro Lopo - - * src/double.c - New file for handling double precision floating point (SF_FORMAT_DOUBLE) - data. - - * src/wav.c src/aiff.c src/au.c src/raw.c - Added support for SF_FORMAT_DOUBLE data. - - * src/common.[ch] - Addition of endswap_long_array () for endian swapping 64 bit integers. This - function will work correctly on processors with 32 bit and 64 bit longs. - Optimised endswap_short_array () and endswap_int_array (). - - * tests/pcm_test.c - Added and extra check. After the first file of each type is written to disk - a checksum is performed of the first 64 bytes and checked against a pre- - calculated value. This will work whatever the endian-ness of the host - machine. - -2001-11-27 Erik de Castro Lopo - - * src/aiff.c - Added handling of u-law, A-law encoded AIFF files. Thanks to Tom Erbe for - supplying example files. - - * tests/lossy_comp_test.c - Added tests for above. - - * src/common.h src/*.c - Removed function typedefs from common.h and function pointer casting in all - the other files. This allows the compiler to perform proper type checking. - Hopefully this will prevernt problems like the sf_seek bug for OpenBSD, - BeOS etc. - - * src/common.[ch] - Added new function psf_new_binheader_readf () which will eventually replace - psf_binheader_readf (). The new function has basically the same function as - the original but has a more flexible and capable interface. It also allows - the reading of 64 bit integer values for files contains 64 bit file - offsets. - -2001-11-26 Erik de Castro Lopo - - * src/voc.c - Completed implementation of VOC file handling. Can now handle 8 and 16 bit - PCM, u-law and A-law files with one or two channels. - - * src/write_read_test.c tests/lossy_comp_test.c - Added tests for VOC files. - -2001-11-22 Erik de Castro Lopo - - * src/float_cast.h - Added inline asm version of lrint/lrintf for MacOS. Solution provided by - Stephane Letz. - - * src/voc.c - More work on this braindamaged format. The VOC files produced by SoX also - have a number of inconsistencies. - -2001-11-19 Erik de Castro Lopo - - * src/paf.c - Added support for 8 bit PCM PAF files. - - * tests/write_read_test.c - Added tests for 8 bit PAF files. - -2001-11-18 Erik de Castro Lopo - - * tests/pcm_test.c - New test program to test for correct scaling of integer values between - different sized integer containers (ie short -> int). - The new specs for libsndfile state that when the source and destination - containers are of a different size, the most significant bit of the source - value becomes the most significant bit of the destination container. - - * src/pcm.c src/paf.c - Modified to pass the above test program. - - * tests/write_read_test.c tests/lossy_comp_test.c - Modified to work with the new scaling rules. - -2001-11-17 Erik de Castro Lopo - - * src/raw.c tests/write_read_test.c tests/write_read_test.c - Added ability to do raw reads/writes of float, u-law and A-law files. - - * src/*.[ch] examples/*.[ch] tests/*.[ch] - Removed dependance on pcmbitwidth field of SF_INFO struct and moved to new - SF_FORMAT_* types and use of SF_ENDIAN_BIG/LITTLE/CPU. - -2001-11-12 Erik de Castro Lopo - - * src/*.[ch] - Started implmentation of major changes documented in doc/version1.html. - - Removed all usage of off_t which is not part of the ISO C standard. All - places which were using it are now using type long which is the type of - the offset parameter for the fseek function. - This should fix problems on BeOS, MacOS and *BSD like systems which were - failing "make check" because sizeof (long) != sizeof (off_t). - --------------------------------------------------------------------------------- -This is the boundary between version 1 of the library above and version 0 below. --------------------------------------------------------------------------------- - -2001-11-11 Erik de Castro Lopo - - * examples/sfplay_beos.cpp - Added BeOS version of sfplay.c. This needs to be compiled using a C++ - compiler so is therefore not built by default. Thanks to Marcus Overhagen - for providing this. - -2001-11-10 Erik de Castro Lopo - - * examples/sfplay.c - New example file showing how libsndfile can be used to read and play a - sound file. - At the moment on Linux is supported. Others will follow in the near future. - -2001-11-09 Erik de Castro Lopo - - * src/pcm.c - Fixed problem with normalisation code where a value of 1.0 could map to - a value greater than MAX_SHORT or MAX_INT. Thanks to Roger Dannenberg for - pointing this out. - -2001-11-08 Erik de Castro Lopo - - * src/pcm.c - Fixed scaling issue when reading/writing 8 bit files using - sf_read/sf_write_short (). - On read, values are scaled so that the most significant bit in the char - ends up in the most significant bit of the short. On write, values are - scaled so that most significant bit in the short ends up as the most - significant bit in the char. - -2001-11-07 Erik de Castro Lopo - - * src/au.c src/sndfile.c - Added support for 32 bit float data in big and little endian AU files. - - * tests/write_read_test.c - Added tests for 32 bit float data in AU files. - -2001-11-06 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Finalised testing of stereo files where possible. - -2001-11-05 Erik de Castro Lopo - - * src/wav_ms_adpcm.c - Fixed bug in writing stereo MS ADPCM WAV files. Thanks to Xu Xin for - pointing out this problem. - -2001-10-24 Erik de Castro Lopo - - * src/wav_ms_adpcm.c - Modified function srate2blocksize () to handle 44k1Hz stereo files. - -2001-10-21 Erik de Castro Lopo - - * src/w64.c - Added support for Sonic Foundry 64 bit WAV format. As Linux (my main - development platform) does not yet support 64 bit file offsets by default, - current handling of this file format treats everything as 32 bit and fails - openning the file, if it finds anything that goes beyond 32 bit values. - - * src/sndfile.[hc] src/common.h src/Makefile.am - Added hooks for W64 support. - -2001-10-21 Erik de Castro Lopo - - * configure.in - Added more warnings options to CFLAGS when the gcc compiler is detected. - - * src/*.[ch] tests/*.c examples/*.c - Started fixing the warning messages due to the new CFLASG. - - * src/voc.c - More work on VOC file read/writing. - - * src/paf.c - Found that PAF files were not checking the normalisation flag when reading - or writing floats and doubles. Fixed it. - - * tests/floating_point_test.c - Added specific test for the above problem. - - * src/float_cast.h src/pcm.c - Added a section for Win32 to define lrint () and lrintf () in the header - and implement it in the pcm.c - -2001-10-20 Erik de Castro Lopo - - * sndfile-config.in m4/sndfile.m4 - These files were donated by Conrad Parker who also provided instructions - on how to install them using autoconf/automake. - - * src/float_cast.h - Fiddled around with this file some more. On Linux and other gcc supported - OSes use the C99 functions lrintf() and lrint() for casting from floating - point to int without incurring the huge perfromance penalty (particularly - on the i386 family) caused by the regular C cast from float to int. - These new C99 functions replace the FLOAT_TO_* and DOUBLE_TO_* macros which - I had been playing with. - - * configure.in m4/lrint.m4 m4/lrintf.m4 - Add detection of these functions. - -2001-10-17 Erik de Castro Lopo - - * src/voc.c - Completed code for reading VOC files containing a single audio data - segment. - Started implementing code to handle files with multiple VOC_SOUND_DATA - segments but couldn't be bothered finishing it. Multiple segment files can - have different sample rates for different sections and other nasties like - silence and repeat segments. - -2001-10-16 Erik de Castro Lopo - - * src/common.h src/*.c - Removed SF_PRIVATE struct field fdata and replaced it with extra_data. - - * src/voc.c - Further development of the read part of this woefult file format. - -2001-10-04 Erik de Castro Lopo - - * src/float_cast.h - Implemented gcc and i386 floating point to int cast macros. Standard cast - will be used when not on gcc for i385. - - * src/pcm.c - Modified all uses of FLOAT/DOUBLE_TO_INT and FLOAT/DOUBLE_TO_SHORT casts to - comply with macros in float_cast.h. - -2001-10-04 Erik de Castro Lopo - - * src/voc.c - Changed the TYPE_xxx enum names to VOC_TYPE_xxx to prevent name clashes - on MacOS with CodeWarrior 6.0. - - * MacOS/MacOS-readme.txt - Updated the compile instructions. Probably still need work as I don't have - access to a Mac. - -2001-10-01 Erik de Castro Lopo - - * src/wav.c src/aiff.c common.c - Changed all references to snprintf to LSF_SNPRINTF and all vsnprintf to - LSF_VSNPRINTF. LSF_VSNPRINTF and LSF_VSNPRINTF are defined in common.h. - - * src/common.h - Added checking of HAVE_SNPRINTF and HAVE_VSNPRINTF and defining - LSF_VSNPRINTF and LSF_VSNPRINTF to appropriate values. - - * src/missing.c - New file containing a minimal implementation of snprintf and vsnprintf - functions named missing_snprintf and missing_vsnprintf respectively. These - are only compliled into the binary if snprintf and/or vsnprintf are not - available. - -2001-09-29 Erik de Castro Lopo - - * src/ircam.c - New file to handle Berkeley/IRCAM/CARL files. - - * src/sndfile.c src/common.h - Modified for IRCAM handling. - - * tests/*.c - Added tests for IRCAM files. - -2001-09-27 Erik de Castro Lopo - - * src/wav.c - Apparently microsoft windows (tm) doesn't like ulaw and Alaw WAV files with - 20 byte format chunks (contrary to ms's own documentation). Fixed the WAV - header writing code to generate smaller ms compliant ulaw and Alaw WAV - files. - -2001-09-17 Erik de Castro Lopo - - * tests/stdio_test.sh tests/stdio_test.c - Shell script was rewritten as a C program due to incompatibilities of the - sh shell on Linux and Solaris. - -2001-09-16 Erik de Castro Lopo - - * tests/stdio_test.sh tests/stdout_test.c tests/stdin_test.c - New test programs to verify the correct operation of reading from stdin and - writing to stdout. - - * src/sndfile.c wav.c au.c nist.c paf.c - Fixed a bugs uncovered by the new test programs above. - -2001-09-15 Erik de Castro Lopo - - * src/sndfile.c wav.c - Fixed a bug preventing reading a file from stdin. Found by T. Narita. - -2001-09-12 Erik de Castro Lopo - - * src/common.h - Fixed a problem on OpenBSD 2.9 which was causing sf_seek() to fail on IMA - WAV files. Root cause was the declaration of the func_seek typedef not - matching the functions it was actually being used to point to. In OpenBSD - sizeof (off_t) != sizeof (int). Thanks to Heikki Korpela for allowing me - to log into his OpenBSD machine to debug this problem. - -2001-09-03 Erik de Castro Lopo - - * src/sndfile.c - Implemented sf_command ("norm float"). - - * src/*.c - Implemented handling of sf_command ("set-norm-float"). Float normalization - can now be turned on and off. - - * tests/double_test.c - Renamed to floating_point_test.c. Modified to include tests for all scaled - reads and writes of floats and doubles. - - * src/au_g72x.c - Fixed bug in normalization code found with improved floating_point_test - program. - - * src/wav.c - Added code for parsing 'INFO' and 'LIST' chunks. Will be used for extract - text annotations from WAV files. - - * src/aiff.c - Added code for parsing '(c) ' and 'ANNO' chunks. Will be used for extract - text annotations from WAV files. - -2001-09-02 Erik de Castro Lopo - - * examples/sf_info.c example/Makefile.am - Renamed to sndfile_info.c. The program sndfile_info will now be installed - when the library is installed. - - * src/float_cast.h - New file defining floating point to short and int casts. These casts will - eventually replace all flot and double casts to short and int. See comments - at the top of the file for the reasoning. - - * src/*.c - Changed all default float and double casts to short or int with macros - defined in floatcast.h. At the moment these casts do nothing. They will be - replaced with faster float to int cast operations in the near future. - -2001-08-31 Erik de Castro Lopo - - * tests/command_test.c - New file for testing sf_command () functionality. - - * src/sndfile.c - Revisiting of error return values of some functions. - Started implementing sf_command () a new function will allow on-the-fly - modification of library behaviour, or instance, sample value scaling. - - * src/common.h - Added hook for format specific sf_command () calls to SNDFILE struct. - - * doc/api.html - Updated and errors corrected. - - * doc/command.html - New documentation file explaining new sf_command () function. - -2001-08-11 Erik de Castro Lopo - - * src/sndfile.c - Fixed error return values from sf_read*() and sf_write*(). There were - numerous instances of -1 being returned through size_t. These now all set - error int the SF_PRIVATE struct and return 0. Thanks to David Viens for - spotting this. - -2001-08-01 Erik de Castro Lopo - - * src/common.c - Fixed use of va_arg() calls that were causing warning messages with the - latest version of gcc (thanks Maurizio Umberto Puxeddu). - -2001-07-25 Erik de Castro Lopo - - * src/*.c src/sfendian.h - Moved definition of MAKE_MARKER macro to sfendian.h - -2001-07-23 Erik de Castro Lopo - - * src/sndfile.c - Modified sf_get_lib_version () so that version string will be visible using - the Unix strings command. - - * examples/Makefile.am examples/sfinfo.c - Renamed sfinfo program and source code to sf_info. This prevents a name - clash with the program included with libaudiofile. - -2001-07-22 Erik de Castro Lopo - - * tests/read_seek_test.c tests/lossy_comp_test.c - Added tests for sf_read_float () and sf_readf_float (). - - * src/voc.c - New files for handling Creative Voice files (not complete). - - * src/samplitude.c - New files for handling Samplitude files (not complete). - -2001-07-21 Erik de Castro Lopo - - * src/aiff.c src/au.c src/paf.c src/svx.c src/wav.c - Converted these files to using psf_binheader_readf() function. Will soon be - ready to attempt to make reading writing from pipes work reliably. - - * src/*.[ch] - Added code for sf_read_float () and sf_readf_float () methods of accessing - file data. - -2001-07-20 Erik de Castro Lopo - - * src/paf.c src/wav_gsm610.c - Removed two printf()s which had escaped notice for some time (thanks - Sigbjørn Skjæret). - -2001-07-19 Erik de Castro Lopo - - * src/wav_gsm610.c - Fixed a bug which prevented GSM 6.10 encoded WAV files generated by - libsndfile from being played in Windoze (thanks klay). - -2001-07-18 Erik de Castro Lopo - - * src/common.[ch] - Implemented psf_binheader_readf() which will do for file header reading what - psf_binheader_writef() did for writing headers. Will eventually allow - libsndfile to read and write from pipes, including named pipes. - -2001-07-16 Erik de Castro Lopo - - * MacOS/config.h Win32/config.h - Attempted to bring these two files uptodate with src/config.h. As I don't - have access to either of these systems support for them may be completely - broken. - -2001-06-18 Erik de Castro Lopo - - * src/float32.c - Fixed bug for big endian processors that can't read 32 bit IEEE floats. Now - tested on Intel x86 and UltraSparc processors. - -2001-06-13 Erik de Castro Lopo - - * src/aiff.c - Modified to allow REX files (from Propellorhead's Recycle and Reason - programs) to be read. - REX files are basically an AIFF file with slightly unusual sequence of - chunks (AIFF files are supposed to allow any sequence) and some extra - application specific information. - Not yet able to write a REX file as the details of the application specific - data is unknown. - -2001-06-12 Erik de Castro Lopo - - * src/wav.c - Fixed endian bug when reading PEAK chunk on big endian machines. - - * src/common.c - Fixed endian bug when reading PEAK chunk on big endian machines with - --enable-force-broken-float configure option. - Fix psf_binheader_writef for (FORCE_BROKEN_FLOAT ||______) - -2001-06-07 Erik de Castro Lopo - - * configure.in src/config.h.in - Removed old CAN_READ_WRITE_x86_IEEE configure variable now that float - capabilities are detected at run time. - Added FORCE_BROKEN_FLOAT to allow testing of broken float code on machines - where the processor can in fact handle floats correctly. - - * src/float32.c - Rejigged code reading and writing of floats on broken processors. - - * m4/ - Removed this directory and all its files as they are no longer needed. - -2001-06-05 Erik de Castro Lopo - - * tests/peak_chunk_test.c - New test to validate reading and writing of peak chunk. - - * examples/sfconvert - Added -float32 option. - - * src/*.c - Changed all error return values to negative values (ie the negative of what - they were). - - * src/sndfile.c tests/error_test.c - Modified to take account of the previous change. - -2001-06-04 Erik de Castro Lopo - - * src/float32.c - File renamed from wav_float.c and renamed function to something more - general. - Added runtime detection of floating point capabilities. - Added recording of peaks during write for generation of PEAK chunk. - - * src/wav.c src/aiff.c - Added handing for PEAK chunk for floating point files. PEAK is read when the - file headers are read and generated when the file is closed. Logic is in - place for adding PEAK chunk to end of file when writing to a pipe (reading - and writing from/to pipe to be implemented soon). - - * src/sndfile.c - Modified sf_signal_max () to use PEAK values if present. - -2001-06-03 Erik de Castro Lopo - - * src/*.c - Added pcm_read_init () and pcm_write_init () to src/pcm.c and removed all - other calls to functions in this file from the filetype specific files. - - * src/*.c - Added alaw_read_init (), alaw_write_int (), ulaw_read_init () and - ulaw_write_init () and removed all other calls to functions in alaw.c and - ulaw.c from the filetype specific files. - - * tests/write_read_test.c - Added tests to validate sf_seek () on all file types. - - * src/raw.c - Implemented raw_seek () function to fix a bug where - sf_seek (file, 0, SEEK_SET) on a RAW file failed. - - * src/paf.c - Fixed a bug in paf24_seek () found due to added seeks tests in - tests/write_read_test.c - -2001-06-01 Erik de Castro Lopo - - * tests/read_seek_test.c - Fixed a couple of broken binary files. - - * src/aiff.c src/wav.c - Added handling of PEAK chunks on file read. - -2001-05-31 Erik de Castro Lopo - - * check_libsndfile.py - New file for the regression testing of libsndfile. - check_libsndfile.py is a Python script which reads in a file containing - filenames of audio files. Each file is checked by running the examples/sfinfo - program on them and checking for error or warning messages in the libsndfile - log buffer. - - * check_libsndfile.list - This is an example list of audio files for use with check_libsndfile.py - - * tests/lossy_comp_test.c - Changed the defined value of M_PI for math header files which don't have it. - This fixed validation test failures on MetroWerks compilers. Thanks to Lord - Praetor Satanus of Acheron for bringing this to my attention. - -2001-05-30 Erik de Castro Lopo - - * src/common.[ch] - Removed psf_header_setf () which was no longer required after refactoring - and simplification of header writing. - Added 'z' format specifier to psf_binheader_writef () for zero filling header - with N bytes. Used by paf.c and nist.c - - * tests/check_log_buffer.c - New file implementing check_log_buffer () which reads the log buffer of a - SNDFILE* object and searches for error and warning messages. Calls exit () - if any are found. - - * tests/*.c - Added calls to check_log_buffer () after each call to sf_open_XXX (). - -2001-05-29 Erik de Castro Lopo - - * src/wav.c src/wav_ms_adpcm.c src/wav_gsm610.c - Major rehack of header writing using psf_binheader_writef (). - -2001-05-28 Erik de Castro Lopo - - * src/wav.c src/wav_ima_adpcm.c - Major rehack of header writing using psf_binheader_writef (). - -2001-05-27 Erik de Castro Lopo - - * src/wav.c - Changed return type of get_encoding_str () to prevent compiler warnings on - Mac OSX. - - * src/aiff.c src/au.c - Major rehack of header writing using psf_binheader_writef (). - -2001-05-25 Erik de Castro Lopo - - * src/common.h src/common.c - Added comments. - Name of log buffer changed from strbuffer to logbuffer. - Name of log buffer index variable changed from strindex to logindex. - - * src/*.[ch] - Changed name of internal logging function from psf_sprintf () to - psf_log_printf (). - Changed name of internal header generation functions from - psf_[ab]h_printf () to psf_asciiheader_printf () and - psf_binheader_writef (). - Changed name of internal header manipulation function psf_hsetf () to - psf_header_setf (). - -2001-05-24 Erik de Castro Lopo - - * src/nist.c - Fixed reading and writing of sample_byte_format header. "01" means little - endian and "10" means big endian regardless of bit width. - - * configure.in - Detect Mac OSX and disable -Wall and -pedantic gcc options. Mac OSX is - way screwed up and spews out buckets of warning messages from the system - headers. - Added --disable-gcc-opt configure option (sets gcc optimisation to -O0 ) for - easier debugging. - Made decision to harmonise source code version number and .so library - version number. Future releases will stick to this rule. - - * doc/new_file_type.HOWTO - New file to document the addition of new file types to libsndfile. - -2001-05-23 Erik de Castro Lopo - - * src/nist.c - New file for reading/writing Sphere NIST audio file format. - Originally requested by Elis Pomales in 1999. - Retrieved from unstable (and untouched for 18 months) branch of libsndfile. - Some vital information gleaned from the source code to Bill Schottstaedt's - sndlib library : ftp://ccrma-ftp.stanford.edu/pub/Lisp/sndlib.tar.gz - Currently reading and writing 16, 24 and 32 bit, big-endian and little - endian, stereo and mono files. - - * src/common.h src/common.c - Added psf_ah_printf () function to help construction of ASCII headers (ie NIST). - - * configure.in - Added test for vsnprintf () required by psf_ah_printf (). - - * tests/write_read_test.c - Added tests for supported NIST files. - -2001-05-22 Erik de Castro Lopo - - * tests/write_read_test.c - Added tests for little endian AIFC files. - - * src/aiff.c - Minor re-working of aiff_open_write (). - Added write support for little endian PCM encoded AIFC files. - -2001-05-13 Erik de Castro Lopo - - * src/aiff.c - Minor re-working of aiff_open_read (). - Added read support for little endian PCM encoded AIFC files from the Mac - OSX CD ripper program. Guillaume Lessard provided a couple of sample files - and a working patch. - The patch was not used as is but gave a good guide as to what to do. - -2001-05-11 Erik de Castro Lopo - - * src/sndfile.h - Fixed comments about endian-ness of WAV and AIFF files. Guillaume Lessard - pointed out the error. - -2001-04-23 Erik de Castro Lopo - - * examples/make_sine.c - Re-write of this example using sample rate and required frequency in Hz. - -2001-02-11 Erik de Castro Lopo - - * src/sndfile.c - Fixed bug that prevented known file types from being read as RAW PCM data. - -2000-12-16 Erik de Castro Lopo - - * src/aiff.c - Added handing of COMT chunk. - -2000-11-16 Erik de Castro Lopo - - * examples/sfconvert.c - Fixed bug in normalisatio code. Pointed out by Johnny Wu. - -2000-11-08 Erik de Castro Lopo - - * Win32/config.h - Fixed the incorrect setting of HAVE_ENDIAN_H parameter. Win32 only issue. - -2000-10-27 Erik de Castro Lopo - - * tests/Makefile.am - Added -lm for write_read_test_LDADD. - -2000-10-16 Erik de Castro Lopo - - * src/sndfile.c src/au.c - Fixed bug which prevented writing of G723 24kbps AU files. - - * tests/lossy_comp_test.c - Corrrection to options for G723 tests. - - * configure.in - Added --disable-gcc-pipe option for DJGPP compiler (gcc on MS-DOS) which - doesn't allow gcc -pipe option. - -2000-09-03 Erik de Castro Lopo - - * src/ulaw.c src/alaw.c src/wav_imaadpcm.c src/msadpcm.c src/wav_gsm610.c - Fixed normailsation bugs shown up by new double_test program. - -2000-08-31 Erik de Castro Lopo - - * src/pcm.c - Fixed bug in normalisation code (spotted by Steve Lhomme). - - * tests/double_test.c - New file to test scaled and unscaled sf_read_double() and sf_write_double() - functions. - -2000-08-28 Erik de Castro Lopo - - * COPYING - Changed to the LGPL COPYING file (spotted by H. S. Teoh). - -2000-08-21 Erik de Castro Lopo - - * src/sndfile.h - Removed prototype of unimplemented function sf_get_info(). Added prototype - for sf_error_number() Thanks to Sigbjørn Skjæret for spotting these. - -2000-08-18 Erik de Castro Lopo - - * src/newpcm.h - New file to contain a complete rewrite of the PCM data handling. - -2000-08-15 Erik de Castro Lopo - - * src/sndfile.c - Fixed a leak of FILE* pointers in sf_open_write(). Thanks to Sigbjørn - Skjæret for spotting this one. - -2000-08-13 Erik de Castro Lopo - - * src/au_g72x.c src/G72x/g72x.c - Added G723 encoded AU file support. - - * tests/lossy_comp_test.c - Added tests for G721 and G723 encoded AU files. - -2000-08-06 Erik de Castro Lopo - - * all files - Changed the license to LGPL. Albert Faber who had copyright on - Win32/unistd.h gave his permission to change the license on that file. All - other files were either copyright erikd AT mega-nerd DOT com or copyright - under a GPL/LGPL compatible license. - -2000-08-06 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Fixed incorrect error message. - - * src/au_g72x.c src/G72x/* - G721 encoded AU files now working. - - * Win32/README-Win32.txt - Replaced this file with a new one which gives a full explanation - of how to build libsndfile under Win32. Thanks to Mike Ricos. - -2000-08-05 Erik de Castro Lopo - - * src/*.[ch] - Removed double leading underscores from the start of all variable and - function names. Identifiers with a leading underscores are reserved - for use by the compiler. - - * src/au_g72x.c src/G72x/* - Continued work on G721 encoded AU files. - -2000-07-12 Erik de Castro Lopo - - * src/G72x/* - New files for reading/writing G721 and G723 ADPCM audio. These files - are from a Sun Microsystems reference implementation released under a - free software licence. - Extensive changes to this code to make it fit in with libsndfile. - See the ChangeLog in this directory for details. - - * src/au_g72x.c - New file for G721 encoded AU files. - -2000-07-08 Erik de Castro Lopo - - * libsndfile.spec.in - Added a spec file for making RPMs. Thanks to Josh Green for supplying this. - -2000-06-28 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h - Add checking for and handling of header-less u-law encoded AU/SND files. - Any file with a ".au" or ".snd" file extension and without the normal - AU file header is treated as an 8kHz, u-law encoded file. - - * src/au.h - New function for opening a headerless u-law encoded file for read. - -2000-06-04 Erik de Castro Lopo - - * src/paf.c - Add checking for files shorter than minimal PAF file header length. - -2000-06-02 Erik de Castro Lopo - - * tests/write_read_test.c - Added extra sf_perror() calls when sf_write_XXXX fails. - -2000-05-29 Erik de Castro Lopo - - * src/common.c - Modified usage of va_arg() macro to work correctly on PowerPC - Linux. Thanks to Kyle Wheeler for giving me ssh access to his - machine while I was trying to track this down. - - * configure.in src/*.[ch] - Sorted out some endian-ness issues brought up by PowerPC Linux. - - * tests/read_seek_test.c - Added extra debugging for when tests fail. - -2000-05-18 Erik de Castro Lopo - - * src/wav.c - Fixed bug in GSM 6.10 handling for big-endian machines. Thanks - to Sigbjørn Skjæret for reporting this. - -2000-04-25 Erik de Castro Lopo - - * src/sndfile.c src/wav.c src/wav_gsm610.c - Finallised writing of GSM 6.10 WAV files. - - * tests/lossy_comp_test.c - Wrote new test code for GSM 6.10 files. - - * examples/sfinfo.c - Fixed incorrect format in printf() statement. - -2000-04-06 Erik de Castro Lopo - - * src/sndfile.h.in - Fixed comments about sf_perror () and sf_error_str (). - -2000-03-14 Erik de Castro Lopo - - * configure.in - Fixed --enable-justsrc option. - -2000-03-07 Erik de Castro Lopo - - * wav.c - Fixed checking of bytespersec field of header. Still some weirdness - with some files. - -2000-03-05 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Added option to test PCM WAV files (sanity check). - Fixed bug in sf_seek() tests. - -2000-02-29 Erik de Castro Lopo - - * src/sndfile.c src/wav.c - Minor changes to allow writing of GSM 6.10 WAV files. - -2000-02-28 Erik de Castro Lopo - - * configure.in Makefile.am src/Makefile.am - Finally got around to figuring out how to build a single library from - multiple source directories. - Reading GSM 6.10 files now seems to work. - -2000-01-03 Erik de Castro Lopo - - * src/wav.c - Added more error reporting in read_fmt_chunk(). - -1999-12-21 Erik de Castro Lopo - - * examples/sfinfo.c - Modified program to accept multiple filenames from the command line. - -1999-11-27 Erik de Castro Lopo - - * src/wav_ima_adpcm.c - Moved code around in preparation to adding ability to read/write IMA ADPCM - encoded AIFF files. - -1999-11-16 Erik de Castro Lopo - - * src/common.c - Fixed put_int() and put_short() macros used by _psf_hprintf() which were - causing seg. faults on Sparc Solaris. - -1999-11-15 Erik de Castro Lopo - - * src/common.c - Added string.h to includes. Thanks to Sigbjxrn Skjfret. - - * src/svx.c - Fixed __svx_close() function to ensure FORM and BODY chunks are correctly - set. - -1999-10-01 Erik de Castro Lopo - - * src/au.c - Fixed handling of incorrect size field in AU header on read. Thanks to - Christoph Lauer for finding this problem. - -1999-09-28 Erik de Castro Lopo - - * src/aiff.c - Fixed a bug with incorrect SSND chunk length being written. This also lead - to finding an minor error in AIFF header parsing. Thanks to Dan Timis for - pointing this out. - -1999-09-24 Erik de Castro Lopo - - * src/paf.c - Fixed a bug with reading and writing 24 bit stereo PAF files. This problem - came to light when implementing tests for the new functions which operate - in terms of frames rather than items. - -1999-09-23 Erik de Castro Lopo - - * src/sndfile.c - Modified file type detection to use first 12 bytes of file rather than - file name extension. Required this because NIST files use the same - filename extension as Microsoft WAV files. - - * src/sndfile.c src/sndfile.h - Added short, int and double read/write functions which work in frames - rather than items. This was originally suggested by Maurizio Umberto - Puxeddu. - -1999-09-22 Erik de Castro Lopo - - * src/svx.c - Finished off implementation of write using __psf_hprintf(). - -1999-09-21 Erik de Castro Lopo - - * src/common.h - Added a buffer to SF_PRIVATE for writing the header. This is required - to make generating headers for IFF/SVX files easier as well as making - it easier to do re-write the headers which will be required when - sf_rewrite_header() is implemented. - - * src/common.c - Implemented __psf_hprintf() function. This is an internal function - which is documented briefly just above the code. - -1999-09-05 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_write_raw() where it was returning incorrect values - (thanks to Richard Dobson for finding this one). Must put in a test - routine for sf_read_raw and sf_write_raw. - - * src/aiff.c - Fixed default FORMsize in __aiff_open_write (). - - * src/sndfile.c - Added copy of filename to internal data structure. IFF/SVX files - contain a NAME header chunk. Both sf_open_read() and sf_open_write() - copy the file name (less the leading path information) to the - filename field. - - * src/svx.c - Started implementing writing of files. - -1999-08-04 Erik de Castro Lopo - - * src/svx.c - New file for reading/writing 8SVX and 16SVX files. - - * src/sndfile.[ch] src/common.h - Changes for SVX files. - - * src/aiff.c - Fixed header parsing when unknown chunk is found. - -1999-08-01 Erik de Castro Lopo - - * src/paf.c - New file for reading/writing Ensoniq PARIS audio file format. - - * src/sndfile.[ch] src/common.h - Changes for PAF files. - - * src/sndfile.[ch] - Added stuff for sf_get_lib_version() function. - - -1999-07-31 Erik de Castro Lopo - - * src/sndfile.h MacOS/config.h - Fixed minor MacOS configuration issues. - -1999-07-30 Erik de Castro Lopo - - * MacOS/ - Added a new directory for the MacOS config.h file and the - readme file. - - * src/aiff.c - Fixed calculation of datalength when reading SSND chunk. Thanks to - Sigbjørn Skjæret for pointing out this error. - -1999-07-29 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h src/raw.c - Further fixing of #includes for MacOS. - -1999-07-25 Erik de Castro Lopo - - * src/wav.c src/aiff.c - Added call to ferror () in main header parsing loop of __XXX_open_read - functions. This should fix problems on platforms (MacOS, AmigaOS) where - fseek()ing or fread()ing beyond the end of the file puts the FILE* - stream in an error state until clearerr() is called. - - * tests/write_read_test.c - Added tests for RAW header-less PCM files. - - * src/common.h - Moved definition of struct tribyte to pcm.c which is the only place - which needs it. - - * src/pcm.c - Modified all code which assumed sizeof (struct tribyte) == 3. This code - did not work on MacOS. Thanks to Ben "Jacobs" for pointing this out. - - * src/au.c - Removed from list of #includes (not being used). - - * src/sndfile.c - Added MacOS specific #ifdef to replace . - - * src/sndfile.h - Added MacOS specific #ifdef to replace . - - * src/sndfile.h - Added MacOS specific typedef for off_t. - - * MacOS-readme.txt - New file with instructions for building libsndfile under MacOS. Thanks - to Ben "Jacobs" for supplying these instructions. - -1999-07-24 Erik de Castro Lopo - - * configure.in - Removed sndfile.h from generated file list as there were no longer - any autoconf substitutions being made. - - * src/raw.c - New file for handling raw header-less PCM files. In order to open these - for read, the user must specify format, pcmbitwidth and channels in the - SF_INFO struct when calling sf_open_read (). - - * src/sndfile.c - Added support for raw header-less PCM files. - -1999-07-22 Erik de Castro Lopo - - * examples/sfinfo.c - Removed options so the sfinfo program always prints out all the information. - -1999-07-19 Erik de Castro Lopo - - * src/alaw.c - New file for A-law encoding (similar to u-law). - - * tests/alaw_test.c - New test program to test the A-law encode/decode lookup tables. - - * tests/lossy_comp_test.c - Added tests for a-law encoded WAV, AU and AULE files. - -1999-07-18 Erik de Castro Lopo - - * src/sndfile.c src/au.c - Removed second "#include ". Thanks to Ben "Jacobs" for pointing - this out. - -1999-07-18 Erik de Castro Lopo - - * tests/ulaw_test.c - New test program to test the u-law encode/decode lookup tables. - -1999-07-16 Erik de Castro Lopo - - * src/sndfile.h - Made corrections to comments on the return values from sf_seek (). - - * src/sndfile.c - Fixed boundary condition checking bug and accounting bug in sf_read_raw (). - -1999-07-15 Erik de Castro Lopo - - * src/au.c src/ulaw.c - Finished implementation of u-law encoded AU files. - - * src/wav.c - Implemented reading and writing of u-law encoded WAV files. - - * tests/ - Changed name of adpcm_test.c to lossy_comp_test.c. This test program - will now be used to test Ulaw and Alaw encoding as well as APDCM. - Added tests for Ulaw encoded WAV files. - -1999-07-14 Erik de Castro Lopo - - * tests/adpcm_test.c - Initialised amp variable in gen_signal() to remove compiler warning. - -1999-07-12 Erik de Castro Lopo - - * src/aiff.c - In __aiff_open_read () prevented fseek()ing beyond end of file which - was causing trouble on MacOS with the MetroWerks compiler. Thanks to - Ben "Jacobs" for pointing this out. - - *src/wav.c - Fixed as above in __wav_open_read (). - -1999-07-01 Erik de Castro Lopo - - * src/wav_ms_adpcm.c - Implemented MS ADPCM encoding. Code cleanup of decoder. - - * tests/adpcm_test.c - Added tests for MS ADPCM WAV files. - - * src/wav_ima_adpcm.c - Fixed incorrect parameter in call to srate2blocksize () from - __ima_writer_init (). - -1999-06-23 Erik de Castro Lopo - - * tests/read_seek_test.c - Added test for 8 bit AIFF files. - -1999-06-18 Erik de Castro Lopo - - * tests/write_read_test.c - Removed test for IMA ADPCM WAV files which is now done in adpcm_test.c - - * configure.in - Added -Wconversion to CFLAGS. - - * src/*.c tests/*.c examples/*.c - Fixed all warnings resulting from use of -Wconversion. - -1999-06-17 Erik de Castro Lopo - - * src/wav.c - Added fact chunk handling on read and write for all non WAVE_FORMAT_PCM - WAV files. - - * src/wav_ima.c - Changed block alignment to be dependant on sample rate. This should make - WAV files created with libsndfile compatible with the MS Windows media - players. - - * tests/adpcm_test.c - Reimplemented adpcm_test_short and implemented adpcm_test_int and - adpcm_test_double. - Now have full testing of IMA ADPCM WAV file read, write and seek. - -1999-06-15 Erik de Castro Lopo - - * src/wav_float.c - Fixed function prototype for x86f2d_array () which was causing ocassional - seg. faults on Sparc Solaris machines. - -1999-06-14 Erik de Castro Lopo - - * src/aiff.c - Fixed bug in __aiff_close where the length fields in the header were - not being correctly calculated before writing. - - * tests/write_read_test.c - Modified to detect the above bug in WAV, AIFF and AU files. - -1999-06-12 Erik de Castro Lopo - - * Win32/* - Added a contribution from Albert Faber to allow libsndfile to compile - under Win32 systems. libsndfile will now be used as part of LAME the - the MPEG 1 Layer 3 encoder (http://internet.roadrunner.com/~mt/mp3/). - -1999-06-11 Erik de Castro Lopo - - * configure.in - Changed to reflect previous changes. - - * src/wav_ima_adpcm.c - Fixed incorrect calculation of bytespersec header field (IMA ADPCM only). - - Fixed bug when writing from int or double data to IMA ADPCM file. Will need - to write test code for this. - - Fixed bug in __ima_write () whereby the length of the current block was - calculated incorrectly. Thanks to Jongcheon Park for pointing this out. - -1999-03-27 Erik de Castro Lopo - - * src/*.c - Changed all read/write/lseek function calls to fread/fwrite/ - fseek/ftell and added error checking of return values from - fread and fwrite in critical areas of the code. - - * src/au.c - Fixed incorrect datasize element in AU header on write. - - * tests/error_test.c - Add new test to check all error values have an associated error - string. This will avoid embarrassing real world core dumps. - -1999-03-23 Erik de Castro Lopo - - * src/wav.c src/aiff.c - Added handling for unknown chunk markers in the file. - -1999-03-22 Erik de Castro Lopo - - * src/sndfile.c - Filled in missing error strings in SndfileErrors array. Missing entries - can cause core dumps when calling sf_error-str (). Thanks to Sam - for finding this problem. - -1999-03-21 Erik de Castro Lopo - - * src/wav_ima_adpcm.c - Work on wav_ms_adpcm.c uncovered a bug in __ima_read () when reading - stereo files. Caused by not adjusting offset into buffer of decoded - samples for 2 channels. A similar bug existed in __ima_write (). - Need a test for stereo ADPCM files. - - * src/wav_ms_adpcm.c - Decoder working correctly. - -1999-03-18 Erik de Castro Lopo - - * configure.in Makefile.am - Added --enable-justsrc configuration variable sent by Sam - . - - * src/wav_ima_adpcm.c - Fixed bug when reading beyond end of data section due to not - checking pima->blockcount. - This uncovered __ima_seek () bug due to pima->blockcount being set - before calling __ima_init_block (). - -1999-03-17 Erik de Castro Lopo - - * src/wav.c - Started implementing MS ADPCM decoder. - If file is WAVE_FORMAT_ADPCM and length of data chunk is odd, this - encoder seems to add an extra byte. Why not just give an even data - length? - -1999-03-16 Erik de Castro Lopo - - * src/wav.c - Split code out of wav.c to create wav_float.c and wav_ima_adpcm.c. - This will make it easier to add and debug other kinds of WAV files - in future. - -1999-03-14 Erik de Castro Lopo - - * tests/ - Added adpcm_test.c which implements test functions for - IMA ADPCM reading/writing/seeking etc. - - * src/wav.c - Fixed many bugs in IMA ADPCM encoder and decoder. - -1999-03-11 Erik de Castro Lopo - - * src/wav.c - Finished implementing IMA ADPCM encoder and decoder (what a bitch!). - -1999-03-03 Erik de Castro Lopo - - * src/wav.c - Started implementing IMA ADPCM decoder. - -1999-03-02 Erik de Castro Lopo - - * src/sndfile.c - Fixed bug where the sf_read_XXX functions were returning a - incorrect read count when reading past end of file. - Fixed bug in sf_seek () when seeking backwards from end of file. - - * tests/read_seek_test.c - Added multiple read test to short_test(), int_test () and - double_test (). - Added extra chunk to all test WAV files to test that reading - stops at end of 'data' chunk. - -1999-02-21 Erik de Castro Lopo - - * tests/write_read_test.c - Added tests for little DEC endian AU files. - - * src/au.c - Add handling for DEC format little endian AU files. - -1999-02-20 Erik de Castro Lopo - - * src/aiff.c src/au.c src/wav.c - Add __psf_sprintf calls during header parsing. - - * src/sndfile.c src/common.c - Implement sf_header_info (sndfile.c) function and __psf_sprintf (common.c). - - * tests/write_read_test.c - Added tests for 8 bit PCM files (WAV, AIFF and AU). - - * src/au.c src/aiff.c - Add handling of 8 bit PCM data format. - - * src/aiff.c - On write, set blocksize in SSND chunk to zero like everybody else. - -1999-02-16 Erik de Castro Lopo - - * src/pcm.c: - Fixed bug in let2s_array (cptr was not being initialised). - - * src/sndfile.c: - Fixed bug in sf_read_raw and sf_write_raw. sf_seek should - now work when using these functions. - -1999-02-15 Erik de Castro Lopo - - * tests/write_read_test.c: - Force test_buffer array to be double aligned. Sparc Solaris - requires this. - -1999-02-14 Erik de Castro Lopo - - * src/pcm.c: - Fixed a bug which was causing errors in the reading - and writing of 24 bit PCM files. - - * doc/api.html - Finished of preliminary documentaion. - -1999-02-13 Erik de Castro Lopo - - * src/aiff.c: - Changed reading of 'COMM' chunk to avoid reading an int - which overlaps an int (4 byte) boundary. diff --git a/libs/libsndfile/INSTALL b/libs/libsndfile/INSTALL deleted file mode 100644 index b42a17ac46..0000000000 --- a/libs/libsndfile/INSTALL +++ /dev/null @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/libs/libsndfile/M4/Makefile.am b/libs/libsndfile/M4/Makefile.am deleted file mode 100644 index e2d984a43a..0000000000 --- a/libs/libsndfile/M4/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = add_cflags.m4 clip_mode.m4 endian.m4 \ - flexible_array.m4 llrint.m4 lrint.m4 lrintf.m4 octave.m4 extra_pkg.m4 - diff --git a/libs/libsndfile/M4/add_cflags.m4 b/libs/libsndfile/M4/add_cflags.m4 deleted file mode 100644 index 55a326c580..0000000000 --- a/libs/libsndfile/M4/add_cflags.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl @synopsis MN_ADD_CFLAGS -dnl -dnl Add the given option to CFLAGS, if it doesn't break the compiler - -AC_DEFUN([MN_ADD_CFLAGS], -[AC_MSG_CHECKING([if $CC accepts $1]) - ac_add_cflags__old_cflags="$CFLAGS" - CFLAGS="$1" - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$ac_add_cflags__old_cflags $1", - AC_MSG_RESULT([no]) - CFLAGS="$ac_add_cflags__old_cflags" - ) -])# MN_ADD_CFLAGS diff --git a/libs/libsndfile/M4/add_cxxflags.m4 b/libs/libsndfile/M4/add_cxxflags.m4 deleted file mode 100644 index 1c0a4deb96..0000000000 --- a/libs/libsndfile/M4/add_cxxflags.m4 +++ /dev/null @@ -1,19 +0,0 @@ -dnl @synopsis MN_ADD_CXXFLAGS -dnl -dnl Add the given option to CXXFLAGS, if it doesn't break the compiler - -AC_DEFUN([MN_ADD_CXXFLAGS], -[AC_MSG_CHECKING([if $CXX accepts $1]) - AC_LANG_ASSERT([C++]) - ac_add_cxxflags__old_cxxflags="$CXXFLAGS" - CXXFLAGS="$1" - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CXXFLAGS="$ac_add_cxxflags__old_cxxflags $1", - AC_MSG_RESULT([no]) - CXXFLAGS="$ac_add_cxxflags__old_cxxflags" - ) -])# MN_ADD_CXXFLAGS diff --git a/libs/libsndfile/M4/clang.m4 b/libs/libsndfile/M4/clang.m4 deleted file mode 100644 index 4cf3077d64..0000000000 --- a/libs/libsndfile/M4/clang.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl @synopsis MN_C_COMPILER_IS_CLANG -dnl -dnl Find out if a compiler claiming to be gcc really is gcc (fuck you clang). -dnl @version 1.0 Oct 31 2013 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - - -AC_DEFUN([MN_C_COMPILER_IS_CLANG], -[AC_CACHE_CHECK(whether we are using the CLANG C compiler, - mn_cv_c_compiler_clang, - [ AC_LANG_ASSERT(C) - AC_TRY_LINK([ - #include - ], - [ - #ifndef __clang__ - This is not clang! - #endif - ], - mn_cv_c_compiler_clang=yes, - mn_cv_c_compiler_clang=no - ]) - ) -]) diff --git a/libs/libsndfile/M4/clip_mode.m4 b/libs/libsndfile/M4/clip_mode.m4 deleted file mode 100644 index 4556b937a0..0000000000 --- a/libs/libsndfile/M4/clip_mode.m4 +++ /dev/null @@ -1,124 +0,0 @@ -dnl @synopsis MN_C_CLIP_MODE -dnl -dnl Determine the clipping mode when converting float to int. -dnl @version 1.0 May 17 2003 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - - - - - - - -dnl Find the clipping mode in the following way: -dnl 1) If we are not cross compiling test it. -dnl 2) IF we are cross compiling, assume that clipping isn't done correctly. - -AC_DEFUN([MN_C_CLIP_MODE], -[AC_CACHE_CHECK(processor clipping capabilities, - ac_cv_c_clip_type, - -# Initialize to unknown -ac_cv_c_clip_positive=unknown -ac_cv_c_clip_negative=unknown - - -if test $ac_cv_c_clip_positive = unknown ; then - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = 1.0 * 0x7FFFFFFF ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != 127) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_positive=yes, - ac_cv_c_clip_positive=no, - ac_cv_c_clip_positive=unknown - ) - - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = -8.0 * 0x10000000 ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != -128) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_negative=yes, - ac_cv_c_clip_negative=no, - ac_cv_c_clip_negative=unknown - ) - fi - -if test $ac_cv_c_clip_positive = yes ; then - ac_cv_c_clip_positive=1 -else - ac_cv_c_clip_positive=0 - fi - -if test $ac_cv_c_clip_negative = yes ; then - ac_cv_c_clip_negative=1 -else - ac_cv_c_clip_negative=0 - fi - -[[ -case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in - "00") - ac_cv_c_clip_type="none" - ;; - "10") - ac_cv_c_clip_type="positive" - ;; - "01") - ac_cv_c_clip_type="negative" - ;; - "11") - ac_cv_c_clip_type="both" - ;; - esac - ]] - -) -] - -)# MN_C_CLIP_MODE - - diff --git a/libs/libsndfile/M4/endian.m4 b/libs/libsndfile/M4/endian.m4 deleted file mode 100644 index 5d766ff39e..0000000000 --- a/libs/libsndfile/M4/endian.m4 +++ /dev/null @@ -1,155 +0,0 @@ -dnl @synopsis MN_C_FIND_ENDIAN -dnl -dnl Determine endian-ness of target processor. -dnl @version 1.1 Mar 03 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Majority written from scratch to replace the standard autoconf macro -dnl AC_C_BIGENDIAN. Only part remaining from the original it the invocation -dnl of the AC_TRY_RUN macro. -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -dnl Find endian-ness in the following way: -dnl 1) Look in . -dnl 2) If 1) fails, look in and . -dnl 3) If 1) and 2) fails and not cross compiling run a test program. -dnl 4) If 1) and 2) fails and cross compiling then guess based on target. - -AC_DEFUN([MN_C_FIND_ENDIAN], -[AC_CACHE_CHECK(processor byte ordering, - ac_cv_c_byte_order, - -# Initialize to unknown -ac_cv_c_byte_order=unknown - -if test x$ac_cv_header_endian_h = xyes ; then - - # First try which should set BYTE_ORDER. - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=big - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - - [AC_TRY_LINK([ - #include - #include - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros - #endif - ], return 0 ;, - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - if test $cross_compiling = yes ; then - # This is the last resort. Try to guess the target processor endian-ness - # by looking at the target CPU type. - [ - case "$target_cpu" in - alpha* | i?86* | mipsel* | ia64*) - ac_cv_c_byte_order=little - ;; - - m68* | mips* | powerpc* | hppa* | sparc*) - ac_cv_c_byte_order=big - ;; - - esac - ] - else - AC_TRY_RUN( - [[ - int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [sizeof (long) - 1] == 1); - } - ]], , ac_cv_c_byte_order=big, - ) - - AC_TRY_RUN( - [[int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [0] == 1); - }]], , ac_cv_c_byte_order=little, - ) - fi - fi - -) - -if test $ac_cv_c_byte_order = big ; then - ac_cv_c_big_endian=1 - ac_cv_c_little_endian=0 -elif test $ac_cv_c_byte_order = little ; then - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=1 -else - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=0 - - AC_MSG_WARN([[*****************************************************************]]) - AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]]) - AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]]) - AC_MSG_WARN([[*** src/config.h may need to be hand editied. ]]) - AC_MSG_WARN([[*****************************************************************]]) - fi - -] -)# MN_C_FIND_ENDIAN - - diff --git a/libs/libsndfile/M4/extra_largefile.m4 b/libs/libsndfile/M4/extra_largefile.m4 deleted file mode 100644 index 3e614c3f70..0000000000 --- a/libs/libsndfile/M4/extra_largefile.m4 +++ /dev/null @@ -1,114 +0,0 @@ -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl MN_SYS_EXTRA_LARGEFILE_FLAGS(FLAGSNAME) -AC_DEFUN([MN_SYS_EXTRA_LARGEFILE_FLAGS], - [AC_CACHE_CHECK([for $1 value to request large file support], - ac_cv_sys_largefile_$1, - [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { - ac_cv_sys_largefile_$1=no - ifelse($1, CFLAGS, - [case "$host_os" in - # IRIX 6.2 and later require cc -n32. -changequote(, )dnl - irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) -changequote([, ])dnl - if test "$GCC" != yes; then - ac_cv_sys_largefile_CFLAGS=-n32 - fi - ac_save_CC="$CC" - CC="$CC $ac_cv_sys_largefile_CFLAGS" - AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) - CC="$ac_save_CC" - esac]) - }])]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(VAR, VAL) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND], - [case $2 in - no) ;; - ?*) - case "[$]$1" in - '') $1=$2 ;; - *) $1=[$]$1' '$2 ;; - esac ;; - esac]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE], - [AC_CACHE_CHECK([for $1], $2, - [$2=no -changequote(, )dnl - $4 - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - -D$1) - $2=1 ;; - -D$1=*) - $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; - esac - done -changequote([, ])dnl - ]) - if test "[$]$2" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) - fi]) - -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], - [AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile omit support for large files]) - if test "$enable_largefile" != no; then - AC_CHECK_TOOL(GETCONF, getconf) - MN_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS) - MN_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS) - MN_SYS_EXTRA_LARGEFILE_FLAGS(LIBS) - - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - no) ;; - -D_FILE_OFFSET_BITS=*) ;; - -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; - -D_LARGE_FILES | -D_LARGE_FILES=*) ;; - -D?* | -I?*) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; - *) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; - esac - done - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.]) - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_file_offset_bits=64 ;; - esac] - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, - ac_cv_sys_largefile_source, - [Define to make fseeko etc. visible, on some hosts.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_largefile_source=1 ;; - esac]) - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGE_FILES, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - [case "$host_os" in - # AIX 4.2 and later - aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) - ac_cv_sys_large_files=1 ;; - esac]) - fi - ]) - diff --git a/libs/libsndfile/M4/extra_pkg.m4 b/libs/libsndfile/M4/extra_pkg.m4 deleted file mode 100644 index afe474e224..0000000000 --- a/libs/libsndfile/M4/extra_pkg.m4 +++ /dev/null @@ -1,105 +0,0 @@ -# extra_pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright (c) 2008-2012 Erik de Castro Lopo -# Copyright (c) 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# -------------------------------------------------------------- -# PKG_CHECK_MOD_VERSION(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# This is a very slight modification to the macro PKG_CHECK_MODULES that -# is in the original pkg.m4 file. It prints the versions in the checking -# message (erikd@mega-nerd.com). - -AC_DEFUN([PKG_CHECK_MOD_VERSION], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $2 ]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -pkg_link_saved_CFLAGS=$CFLAGS -pkg_link_saved_LIBS=$LIBS - -eval "pkg_CFLAGS=\${pkg_cv_[]$1[]_CFLAGS}" -eval "pkg_LIBS=\${pkg_cv_[]$1[]_LIBS}" - -CFLAGS="$CFLAGS $pkg_CFLAGS" -LIBS="$LIBS $pkg_LIBS" - -AC_TRY_LINK([], puts ("");, pkg_link=yes, pkg_link=no) - -CFLAGS=$pkg_link_saved_CFLAGS -LIBS=$pkg_link_saved_LIBS - -if test $pkg_link = no ; then - $as_echo_n "link failed ... " - pkg_failed=yes - fi - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MOD_VERSION diff --git a/libs/libsndfile/M4/flexible_array.m4 b/libs/libsndfile/M4/flexible_array.m4 deleted file mode 100644 index 661da17b23..0000000000 --- a/libs/libsndfile/M4/flexible_array.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl @synopsis MN_C99_FLEXIBLE_ARRAY -dnl -dnl Dose the compiler support the 1999 ISO C Standard "stuct hack". -dnl @version 1.1 Mar 15 2004 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -AC_DEFUN([MN_C99_FLEXIBLE_ARRAY], -[AC_CACHE_CHECK(C99 struct flexible array support, - ac_cv_c99_flexible_array, - -# Initialize to unknown -ac_cv_c99_flexible_array=no - -AC_TRY_LINK([[ - #include - typedef struct { - int k; - char buffer [] ; - } MY_STRUCT ; - ]], - [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], - ac_cv_c99_flexible_array=yes, - ac_cv_c99_flexible_array=no - ))] -) # MN_C99_FLEXIBLE_ARRAY - diff --git a/libs/libsndfile/M4/gcc_version.m4 b/libs/libsndfile/M4/gcc_version.m4 deleted file mode 100644 index f8c5cbebe4..0000000000 --- a/libs/libsndfile/M4/gcc_version.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl @synopsis MN_GCC_VERSION -dnl -dnl Find the version of gcc. -dnl @version 1.0 Nov 05 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([MN_GCC_VERSION], -[ -if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then - - AC_MSG_CHECKING([for version of $CC]) - GCC_VERSION=`$CC -dumpversion` - AC_MSG_RESULT($GCC_VERSION) - - changequote(,)dnl - GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"` - GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/$GCC_MAJOR_VERSION\.//" | sed "s/\..*//"` - changequote([,])dnl - fi - -AC_SUBST(GCC_VERSION) -AC_SUBST(GCC_MAJOR_VERSION) -AC_SUBST(GCC_MINOR_VERSION) - -])# MN_GCC_VERSION - diff --git a/libs/libsndfile/M4/llrint.m4 b/libs/libsndfile/M4/llrint.m4 deleted file mode 100644 index 66be206187..0000000000 --- a/libs/libsndfile/M4/llrint.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl @synopsis MN_C99_FUNC_LLRINT -dnl -dnl Check whether C99's llrint function is available. -dnl @version 1.1 Sep 30 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([MN_C99_FUNC_LLRINT], -[AC_CACHE_CHECK(for llrint, - ac_cv_c99_llrint, -[ -llrint_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -#include -], int64_t x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) - -CFLAGS=$llrint_save_CFLAGS - -]) - -if test "$ac_cv_c99_llrint" = yes; then - AC_DEFINE(HAVE_LLRINT, 1, - [Define if you have C99's llrint function.]) -fi -])# MN_C99_FUNC_LLRINT - diff --git a/libs/libsndfile/M4/lrint.m4 b/libs/libsndfile/M4/lrint.m4 deleted file mode 100644 index c2c21d60f4..0000000000 --- a/libs/libsndfile/M4/lrint.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl @synopsis MN_C99_FUNC_LRINT -dnl -dnl Check whether C99's lrint function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([MN_C99_FUNC_LRINT], -[AC_CACHE_CHECK(for lrint, - ac_cv_c99_lrint, -[ -lrint_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) - -CFLAGS=$lrint_save_CFLAGS - -]) - -if test "$ac_cv_c99_lrint" = yes; then - AC_DEFINE(HAVE_LRINT, 1, - [Define if you have C99's lrint function.]) -fi -])# MN_C99_FUNC_LRINT - diff --git a/libs/libsndfile/M4/lrintf.m4 b/libs/libsndfile/M4/lrintf.m4 deleted file mode 100644 index 04f4d6603c..0000000000 --- a/libs/libsndfile/M4/lrintf.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl @synopsis MN_C99_FUNC_LRINTF -dnl -dnl Check whether C99's lrintf function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([MN_C99_FUNC_LRINTF], -[AC_CACHE_CHECK(for lrintf, - ac_cv_c99_lrintf, -[ -lrintf_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) - -CFLAGS=$lrintf_save_CFLAGS - -]) - -if test "$ac_cv_c99_lrintf" = yes; then - AC_DEFINE(HAVE_LRINTF, 1, - [Define if you have C99's lrintf function.]) -fi -])# MN_C99_FUNC_LRINTF - diff --git a/libs/libsndfile/M4/mkoctfile_version.m4 b/libs/libsndfile/M4/mkoctfile_version.m4 deleted file mode 100644 index c17333ea25..0000000000 --- a/libs/libsndfile/M4/mkoctfile_version.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl @synopsis OCTAVE_MKOCTFILE_VERSION -dnl -dnl Find the version of mkoctfile. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([OCTAVE_MKOCTFILE_VERSION], -[ - - -AC_ARG_WITH(mkoctfile, - AC_HELP_STRING([--with-mkoctfile], [choose the mkoctfile version]), - [ with_mkoctfile=$withval ]) - -test -z "$with_mkoctfile" && with_mkoctfile=mkoctfile - -AC_CHECK_PROG(HAVE_MKOCTFILE,$with_mkoctfile,yes,no) - -if test "x$ac_cv_prog_HAVE_MKOCTFILE" = "xyes" ; then - MKOCTFILE=$with_mkoctfile - - AC_MSG_CHECKING([for version of $MKOCTFILE]) - MKOCTFILE_VERSION=`$with_mkoctfile --version 2>&1 | sed 's/mkoctfile, version //g'` - AC_MSG_RESULT($MKOCTFILE_VERSION) - fi - -AC_SUBST(MKOCTFILE) -AC_SUBST(MKOCTFILE_VERSION) - -])# OCTAVE_MKOCTFILE_VERSION - diff --git a/libs/libsndfile/M4/octave.m4 b/libs/libsndfile/M4/octave.m4 deleted file mode 100644 index 88d5a5b9b0..0000000000 --- a/libs/libsndfile/M4/octave.m4 +++ /dev/null @@ -1,143 +0,0 @@ -dnl Evaluate an expression in octave -dnl -dnl OCTAVE_EVAL(expr,var) -> var=expr -dnl -dnl Stolen from octave-forge - -AC_DEFUN([OCTAVE_EVAL], -[ -AC_MSG_CHECKING([for $1 in $OCTAVE]) -$2=`TERM=;$OCTAVE -qfH --eval "disp($1)"` -AC_MSG_RESULT($$2) -AC_SUBST($2) -]) # OCTAVE_EVAL - -dnl @synopsis AC_OCTAVE_VERSION -dnl -dnl Find the version of Octave. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([AC_OCTAVE_VERSION], -[ - -AC_ARG_WITH(octave, - AC_HELP_STRING([--with-octave], [choose the octave version]), - [ with_octave=$withval ]) - -test -z "$with_octave" && with_octave=octave - -AC_CHECK_PROG(HAVE_OCTAVE,$with_octave,yes,no) - -if test "x$ac_cv_prog_HAVE_OCTAVE" = "xyes" ; then - OCTAVE=$with_octave - OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) - fi - -AC_SUBST(OCTAVE) -AC_SUBST(OCTAVE_VERSION) - -])# AC_OCTAVE_VERSION - -dnl @synopsis AC_OCTAVE_CONFIG_VERSION -dnl -dnl Find the version of Octave. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([AC_OCTAVE_CONFIG_VERSION], -[ - -AC_ARG_WITH(octave-config, - AC_HELP_STRING([--with-octave-config], [choose the octave-config version]), - [ with_octave_config=$withval ]) - -test -z "$with_octave_config" && with_octave_config=octave-config - -AC_CHECK_PROG(HAVE_OCTAVE_CONFIG,$with_octave_config,yes,no) - -if test "x$ac_cv_prog_HAVE_OCTAVE_CONFIG" = "xyes" ; then - OCTAVE_CONFIG=$with_octave_config - AC_MSG_CHECKING([for version of $OCTAVE_CONFIG]) - OCTAVE_CONFIG_VERSION=`$OCTAVE_CONFIG --version` - AC_MSG_RESULT($OCTAVE_CONFIG_VERSION) - fi - -AC_SUBST(OCTAVE_CONFIG) -AC_SUBST(OCTAVE_CONFIG_VERSION) - -])# AC_OCTAVE_CONFIG_VERSION - -dnl @synopsis AC_OCTAVE_BUILD -dnl -dnl Check programs and headers required for building octave plugins. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - - -AC_DEFUN([AC_OCTAVE_BUILD], -[ - -dnl Default to no. -OCTAVE_BUILD=no - -AC_OCTAVE_VERSION -OCTAVE_MKOCTFILE_VERSION -AC_OCTAVE_CONFIG_VERSION - -prog_concat="$ac_cv_prog_HAVE_OCTAVE$ac_cv_prog_HAVE_OCTAVE_CONFIG$ac_cv_prog_HAVE_MKOCTFILE" - -if test "x$prog_concat" = "xyesyesyes" ; then - if test "x$OCTAVE_VERSION" != "x$MKOCTFILE_VERSION" ; then - AC_MSG_WARN([** Mismatch between versions of octave and mkoctfile. **]) - AC_MSG_WARN([** Octave libsndfile modules will not be built. **]) - elif test "x$OCTAVE_VERSION" != "x$OCTAVE_CONFIG_VERSION" ; then - AC_MSG_WARN([** Mismatch between versions of octave and octave-config. **]) - AC_MSG_WARN([** Octave libsndfile modules will not be built. **]) - else - case "$MKOCTFILE_VERSION" in - 2.*) - AC_MSG_WARN([Octave version 2.X is not supported.]) - ;; - 3.*) - OCTAVE_DEST_ODIR=`$OCTAVE_CONFIG --oct-site-dir | sed 's%^/usr%${prefix}%'` - OCTAVE_DEST_MDIR=`$OCTAVE_CONFIG --m-site-dir | sed 's%^/usr%${prefix}%'` - - OCTAVE_BUILD=yes - ;; - *) - AC_MSG_WARN([Octave version $MKOCTFILE_VERSION is not supported.]) - ;; - esac - fi - AC_MSG_RESULT([building octave libsndfile module... $OCTAVE_BUILD]) - fi - -AC_SUBST(OCTAVE_DEST_ODIR) -AC_SUBST(OCTAVE_DEST_MDIR) - -AC_SUBST(MKOCTFILE) - -AM_CONDITIONAL(BUILD_OCTAVE_MOD, test "x$OCTAVE_BUILD" = xyes) - -])# AC_OCTAVE_BUILD diff --git a/libs/libsndfile/M4/really_gcc.m4 b/libs/libsndfile/M4/really_gcc.m4 deleted file mode 100644 index 67aed7802f..0000000000 --- a/libs/libsndfile/M4/really_gcc.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl @synopsis MN_GCC_REALLY_IS_GCC -dnl -dnl Find out if a compiler claiming to be gcc really is gcc (fuck you clang). -dnl @version 1.0 Oct 31 2013 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -# If the configure script has already detected GNU GCC, then make sure it -# isn't CLANG masquerading as GCC. - -AC_DEFUN([MN_GCC_REALLY_IS_GCC], -[ AC_LANG_ASSERT(C) - if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then - AC_TRY_LINK([ - #include - ], - [ - #ifdef __clang__ - This is clang! - #endif - ], - ac_cv_c_compiler_gnu=yes, - ac_cv_c_compiler_gnu=no - ) - fi - -]) diff --git a/libs/libsndfile/M4/stack_protect.m4 b/libs/libsndfile/M4/stack_protect.m4 deleted file mode 100644 index bf27e6e74f..0000000000 --- a/libs/libsndfile/M4/stack_protect.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl Copyright (C) 2013 Xiph.org Foundation -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl -dnl - Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl -dnl - Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in the -dnl documentation and/or other materials provided with the distribution. -dnl -dnl - Neither the name of the Xiph.org Foundation nor the names of its -dnl contributors may be used to endorse or promote products derived from -dnl this software without specific prior written permission. -dnl -dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -dnl CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -dnl Want to know of GCC stack protector works, botfor the C and for the C++ -dnl compiler. -dnl -dnl Just checking if the compiler accepts the required CFLAGSs is not enough -dnl because we have seen at least one instance where this check was -dnl in-sufficient. -dnl -dnl Instead, try to compile and link a test program with the stack protector -dnl flags. If that works, we use it. - -AC_DEFUN([XIPH_GCC_STACK_PROTECTOR], -[AC_LANG_ASSERT(C) - AC_MSG_CHECKING([if $CC supports stack smash protection]) - xiph_stack_check_old_cflags="$CFLAGS" - SSP_FLAGS="-fstack-protector --param ssp-buffer-size=4" - CFLAGS=$SSP_FLAGS - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$xiph_stack_check_old_cflags $SSP_FLAGS", - AC_MSG_RESULT([no]) - CFLAGS="$xiph_stack_check_old_cflags" - ) -])# XIPH_GCC_STACK_PROTECTOR - -AC_DEFUN([XIPH_GXX_STACK_PROTECTOR], -[AC_LANG_PUSH([C++]) - AC_MSG_CHECKING([if $CXX supports stack smash protection]) - xiph_stack_check_old_cflags="$CFLAGS" - SSP_FLAGS="-fstack-protector --param ssp-buffer-size=4" - CFLAGS=$SSP_FLAGS - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$xiph_stack_check_old_cflags $SSP_FLAGS", - AC_MSG_RESULT([no]) - CFLAGS="$xiph_stack_check_old_cflags" - ) - AC_LANG_POP([C++]) -])# XIPH_GXX_STACK_PROTECTOR diff --git a/libs/libsndfile/Makefile.am b/libs/libsndfile/Makefile.am deleted file mode 100644 index a429c5b3fa..0000000000 --- a/libs/libsndfile/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -## Process this file with automake to produce Makefile.in - -ACLOCAL_AMFLAGS = -I M4 - -DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror - -if BUILD_OCTAVE_MOD -octave_dir = Octave -endif - -SUBDIRS = M4 Win32 src $(octave_dir) -#man doc examples regtest tests programs - -DIST_SUBDIRS = M4 man doc Win32 src Octave examples regtest tests programs - -EXTRA_DIST = libsndfile.spec.in sndfile.pc.in Scripts/android-configure.sh \ - Scripts/linux-to-win-cross-configure.sh Scripts/build-test-tarball.mk.in - -CLEANFILES = *~ - -#pkgconfig_DATA = sndfile.pc - -m4datadir = $(datadir)/aclocal - -#=============================================================================== - -test: check-recursive - -# Target to make autogenerated files. -genfiles : - (cd src ; make genfiles) -# (cd tests ; make genfiles) - -checkprograms : - (cd src ; make libsndfile.la checkprograms) -# (cd tests ; make checkprograms) - -testprogs : - (cd src ; make testprogs) -# (cd tests ; make testprogs) - - -test-tarball : Scripts/build-test-tarball.mk - (cd src ; make all libsndfile.la checkprograms) -# (cd tests ; make all checkprograms) -# make -f Scripts/build-test-tarball.mk diff --git a/libs/libsndfile/Mingw-make-dist.sh b/libs/libsndfile/Mingw-make-dist.sh deleted file mode 100755 index f2a6474233..0000000000 --- a/libs/libsndfile/Mingw-make-dist.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2006 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -e - -function unix_to_dos { - sed -e "s/\n/\r\n/" $1 > temp_file - mv -f temp_file $1 -} - -if [ $# -lt 1 ] || [ $# -gt 2 ]; then - echo "Usage : Mingw-make-dist.sh ." - exit 1 - fi - -TARGZ=$1 -if [ ! -f $TARGZ ]; then - echo "Can't find source tarball." - fi - -TARGZ=$1 -if [ ! -f $TARGZ.asc ]; then - echo "Can't find source tarball signature." - fi - -UNAME=`uname -s` -if [ x$UNAME != "xMINGW32_NT-5.1" ]; then - echo "Not able to build Win32 binaries on this platform." - fi - -echo "Building MinGW binary/source zip file." - -VERSION=`pwd | sed -e "s#.*/##" | sed -e s/libsndfile-//` -BUILD=`echo $VERSION | sed -e "s/\./_/g"` -INSTALL="libsndfile-$BUILD" -ZIPNAME="$INSTALL.zip" - -if [ -z "$BUILD" ]; then - echo "Bad BUILD variable : '$BUILD'" - exit 1 - fi - -if [ ! -d $INSTALL/ ]; then - mkdir $INSTALL - fi - -if [ ! -f config.status ]; then - ./configure --prefix=`pwd`/$INSTALL/ -else - teststr=`grep "with options" config.status | grep -- --prefix=` - if [ -z "$teststr" ]; then - # --disable-static doesn't work. - ./configure --prefix=`pwd`/$INSTALL/ - fi - fi - -if [ ! -f src/.libs/libsndfile-1.dll ]; then - make all check - fi - -if [ ! -f $INSTALL/bin/libsndfile-1.dll ]; then - make install - rm -f $INSTALL/bin/sndfile-regtest.exe - strip $INSTALL/bin/*.* - mv $INSTALL/bin/*.* $INSTALL/include/*.* $INSTALL/ - rmdir $INSTALL/bin - rm -rf $INSTALL/lib - rmdir $INSTALL/include - cp src/libsndfile.def $INSTALL/libsndfile-1.def - cp Win32/README-precompiled-dll.txt Win32/testprog.c $INSTALL/ - unix_to_dos $INSTALL/libsndfile-1.def - unix_to_dos $INSTALL/sndfile.h - unix_to_dos $INSTALL/README-precompiled-dll.txt - unix_to_dos $INSTALL/testprog.c - fi - -if [ ! -f $INSTALL/libsndfile-$VERSION.tar.gz ]; then - cp $TARGZ $INSTALL/ - if [ -f $TARGZ.asc ]; then - cp $TARGZ.asc $INSTALL/ - fi - fi - -if [ ! -f $ZIPNAME ]; then - zip -r $ZIPNAME $INSTALL/ - fi - diff --git a/libs/libsndfile/NEWS b/libs/libsndfile/NEWS deleted file mode 100644 index 9626d45166..0000000000 --- a/libs/libsndfile/NEWS +++ /dev/null @@ -1,175 +0,0 @@ -Version 1.0.25 (2011-07-13) - * Fix for Secunia Advisory SA45125, heap overflow in PAF file handler. - * Accept broken WAV files with blockalign == 0. - * Minor bug fixes and improvements. - -Version 1.0.24 (2011-03-23) - * WAV files now have an 18 byte u-law and A-law fmt chunk. - * Document virtual I/O functionality. - * Two new methods rawHandle() and takeOwnership() in sndfile.hh. - * AIFF fix for non-zero offset value in SSND chunk. - * Minor bug fixes and improvements. - -Version 1.0.23 (2010-10-10) - * Add version metadata to Windows DLL. - * Add a missing 'inline' to sndfile.hh. - * Update docs. - * Minor bug fixes and improvements. - -Version 1.0.22 (2010-10-04) - * Couple of fixes for SDS file writer. - * Fixes arising from static analysis. - * Handle FLAC files with ID3 meta data at start of file. - * Handle FLAC files which report zero length. - * Other minor bug fixes and improvements. - -Version 1.0.21 (2009-12-13) - * Add a couple of new binary programs to programs/ dir. - * Remove sndfile-jackplay (now in sndfile-tools package). - * Add windows only function sf_wchar_open(). - * Bunch of minor bug fixes. - -Version 1.0.20 (2009-05-14) - * Fix potential heap overflow in VOC file parser (Tobias Klein, http://www.trapkit.de/). - -Version 1.0.19 (2009-03-02) - * Fix for CVE-2009-0186 (Alin Rad Pop, Secunia Research). - * Huge number of minor bug fixes as a result of static analysis. - -Version 1.0.18 (2009-02-07) - * Add Ogg/Vorbis support (thanks to John ffitch). - * Remove captive FLAC library. - * Many new features and bug fixes. - * Generate Win32 and Win64 pre-compiled binaries. - -Version 1.0.17 (2006-08-31) - * Add sndfile.hh C++ wrapper. - * Update Win32 MinGW build instructions. - * Minor bug fixes and cleanups. - -Version 1.0.16 (2006-04-30) - * Add support for Broadcast (BEXT) chunks in WAV files. - * Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS. - * Add support for RIFX (big endian WAV variant). - * Fix configure script bugs. - * Fix bug in INST and MARK chunk writing for AIFF files. - -Version 1.0.15 (2006-03-16) - * Fix some ia64 issues. - * Fix precompiled DLL. - * Minor bug fixes. - -Version 1.0.14 (2006-02-19) - * Really fix MinGW compile problems. - * Minor bug fixes. - -Version 1.0.13 (2006-01-21) - * Fix for MinGW compiler problems. - * Allow readin/write of instrument chunks from WAV and AIFF files. - * Compile problem fix for Solaris compiler. - * Minor cleanups and bug fixes. - -Version 1.0.12 (2005-09-30) - * Add support for FLAC and Apple's Core Audio Format (CAF). - * Add virtual I/O interface (still needs docs). - * Cygwin and other Win32 fixes. - * Minor bug fixes and cleanups. - -Version 1.0.11 (2004-11-15) - * Add support for SD2 files. - * Add read support for loop info in WAV and AIFF files. - * Add more tests. - * Improve type safety. - * Minor optimisations and bug fixes. - -Version 1.0.10 (2004-06-15) - * Fix AIFF read/write mode bugs. - * Add support for compiling Win32 DLLS using MinGW. - * Fix problems resulting in failed compiles with gcc-2.95. - * Improve test suite. - * Minor bug fixes. - -Version 1.0.9 (2004-03-30) - * Add handling of AVR (Audio Visual Research) files. - * Improve handling of WAVEFORMATEXTENSIBLE WAV files. - * Fix for using pipes on Win32. - -Version 1.0.8 (2004-03-14) - * Correct peak chunk handing for files with > 16 tracks. - * Fix for WAV files with huge number of CUE chunks. - -Version 1.0.7 (2004-02-25) - * Fix clip mode detection on ia64, MIPS and other CPUs. - * Fix two MacOSX build problems. - -Version 1.0.6 (2004-02-08) - * Added support for native Win32 file access API (Ross Bencina). - * New mode to add clippling then a converting from float/double to integer - would otherwise wrap around. - * Fixed a bug in reading/writing files > 2Gig on Linux, Solaris and others. - * Many minor bug fixes. - * Other random fixes for Win32. - -Version 1.0.5 (2003-05-03) - * Added support for HTK files. - * Added new function sf_open_fd() to allow for secure opening of temporary - files as well as reading/writing sound files embedded within larger - container files. - * Added string support for AIFF files. - * Minor bug fixes and code cleanups. - -Version 1.0.4 (2003-02-02) - * Added suport of PVF and XI files. - * Added functionality for setting and retreiving strings from sound files. - * Minor code cleanups and bug fixes. - -Version 1.0.3 (2002-12-09) - * Minor bug fixes. - -Version 1.0.2 (2002-11-24) - * Added support for VOX ADPCM. - * Improved error reporting. - * Added version scripting on Linux and Solaris. - * Minor bug fixes. - -Version 1.0.1 (2002-09-14) - * Added MAT and MAT5 file formats. - * Minor bug fixes. - -Version 1.0.0 (2002-08-16) - * Final release for 1.0.0. - -Version 1.0.0rc6 (2002-08-14) - * Release candidate 6 for the 1.0.0 series. - * MacOS9 fixes. - -Version 1.0.0rc5 (2002-08-10) - * Release candidate 5 for the 1.0.0 series. - * Changed the definition of sf_count_t which was causing problems when - libsndfile was compiled with other libraries (ie WxWindows). - * Minor bug fixes. - * Documentation cleanup. - -Version 1.0.0rc4 (2002-08-03) - * Release candidate 4 for the 1.0.0 series. - * Minor bug fixes. - * Fix broken Win32 "make check". - -Version 1.0.0rc3 (2002-08-02) - * Release candidate 3 for the 1.0.0 series. - * Fix bug where libsndfile was reading beyond the end of the data chunk. - * Added on-the-fly header updates on write. - * Fix a couple of documentation issues. - -Version 1.0.0rc2 (2002-06-24) - * Release candidate 2 for the 1.0.0 series. - * Fix compile problem for Win32. - -Version 1.0.0rc1 (2002-06-24) - * Release candidate 1 for the 1.0.0 series. - -Version 0.0.28 (2002-04-27) - * Last offical release of 0.0.X series of the library. - -Version 0.0.8 (1999-02-16) - * First offical release. diff --git a/libs/libsndfile/Octave/Makefile.am b/libs/libsndfile/Octave/Makefile.am deleted file mode 100644 index 3f0078e18f..0000000000 --- a/libs/libsndfile/Octave/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# Prevent any extension. -EXEEXT = - -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - -EXTRA_DIST = sndfile_load.m sndfile_save.m sndfile_play.m \ - octave_test.m octave_test.sh $(oct_module_srcs) PKG_ADD - -octconfigdir = $(exec_prefix)/share/octave/site/m -octconfig_DATA = sndfile_load.m sndfile_save.m sndfile_play.m - -OCTAVE_DEST_MDIR = @OCTAVE_DEST_MDIR@ -OCTAVE_DEST_ODIR = @OCTAVE_DEST_ODIR@/sndfile - -OCT_CXXFLAGS = @OCT_CXXFLAGS@ -OCT_LIB_DIR = @OCT_LIB_DIR@ -OCT_LIBS = @OCT_LIBS@ - -SNDFILEDIR = $(top_builddir)/src -AM_CPPFLAGS = -I$(SNDFILEDIR) - -oct_module_srcs = sndfile.cc -oct_module_files = sndfile.oct PKG_ADD - -# Make these noinst so they can be installed manually. -noinst_DATA = $(oct_module_files) - - -# Used by shave which cleans up automake generated Makefile output. -V = @ -Q = $(V:1=) -QUIET_GEN = $(Q:@=@echo ' GEN '$@;) - - -# Use Octave's mkoctfile to do all the heavy lifting. Unfortunately, its -# a little dumb so we need to guide it carefully. -sndfile.oct : sndfile.o - $(QUIET_GEN) $(MKOCTFILE) -v $(INCLUDES) $(top_builddir)/Octave/$+ -L$(SNDFILEDIR)/.libs -L$(SNDFILEDIR) -lsndfile -o $(top_builddir)/Octave/$@ > /dev/null - -sndfile.o : sndfile.cc - $(QUIET_GEN) $(MKOCTFILE) -v $(INCLUDES) -c $+ -o $(top_builddir)/Octave/$@ > /dev/null - -# Allow for the test being run in the build dir, but the test script -# being located in the source dir. -check : - octave_src_dir=$(srcdir) $(srcdir)/octave_test.sh - - -# Since the octave modules are installed in a special location, a custom install -# and uninstall routine must be specified. -install-exec-local : $(oct_module_files) - @$(NORMAL_INSTALL) - test -z "$(OCTAVE_DEST_ODIR)" || $(mkdir_p) "$(DESTDIR)$(OCTAVE_DEST_ODIR)" - @list='$(oct_module_files)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) '$$p' '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) "$$p" "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-local : - @$(NORMAL_UNINSTALL) - @list='$(oct_module_files)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ - rm -f "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f"; \ - done - -clean-local : - rm -f sndfile.o sndfile.oct - @if test $(abs_builddir) != $(abs_srcdir) ; then rm -f PKG_ADD ; fi diff --git a/libs/libsndfile/Octave/PKG_ADD b/libs/libsndfile/Octave/PKG_ADD deleted file mode 100644 index 3efd688550..0000000000 --- a/libs/libsndfile/Octave/PKG_ADD +++ /dev/null @@ -1,3 +0,0 @@ -autoload ("sfread", "sndfile.oct"); -autoload ("sfversion", "sndfile.oct"); -autoload ("sfwrite", "sndfile.oct"); diff --git a/libs/libsndfile/Octave/Readme.txt b/libs/libsndfile/Octave/Readme.txt deleted file mode 100644 index c38605bffc..0000000000 --- a/libs/libsndfile/Octave/Readme.txt +++ /dev/null @@ -1,23 +0,0 @@ -The libsndfile Modules for GNU Octave -===================================== - -These modules are currently known to work with version 3.0 of GNU Octave on -Linux. They have not been tested elsewhere. - - -Build Requirements ------------------- - -In order to build these libsndfile related modules for GNU Octave on a Debian -GNU/Linux (or Debian derived) system, you will need (on top of what is normally -required to build libsndfile) the package: - - octaveX.Y-headers - -where X.Y matches the version number of your installation of GNU Octave. - -The configure script in the top level libsndfile directory will detect the -presence and correct versions of the Octave build tools. The building of these -modules will only go ahead if everything is correct. - - diff --git a/libs/libsndfile/Octave/format.h b/libs/libsndfile/Octave/format.h deleted file mode 100644 index ce769b2c69..0000000000 --- a/libs/libsndfile/Octave/format.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -int format_of_str (const std::string & fmt) ; - -void string_of_format (std::string & fmt, int format) ; diff --git a/libs/libsndfile/Octave/octave_test.m b/libs/libsndfile/Octave/octave_test.m deleted file mode 100644 index 25a922e897..0000000000 --- a/libs/libsndfile/Octave/octave_test.m +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2007-2011 Erik de Castro Lopo -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# These tests are nowhere near comprehensive. - -printf (" Running Octave tests : ") ; -fflush (stdout) ; - -filename = "whatever" ; -srate_out = 32000 ; -fmt_out = "wav-float" ; - -t = (2 * pi / srate_out * (0:srate_out-1))' ; -data_out = sin (440.0 * t) ; - -# Write out a file. -sfwrite (filename, data_out, srate_out, fmt_out) ; - -# Read it back in again. -[ data_in, srate_in, fmt_in ] = sfread (filename) ; - -if (srate_in != srate_out) - error ("\n\nSample rate mismatch : %d -> %d.\n\n", srate_out, srate_in) ; - endif - -# Octave strcmp return 1 for the same. -if (strcmp (fmt_in, fmt_out) != 1) - error ("\n\nFormat error : '%s' -> '%s'.\n\n", fmt_out, fmt_in) ; - endif - -err = max (abs (data_out - data_in)) ; - -if (err > 1e-7) - error ("err : %g\n", err) ; - endif - -printf ("ok") ; - -unlink (filename) ; diff --git a/libs/libsndfile/Octave/octave_test.sh b/libs/libsndfile/Octave/octave_test.sh deleted file mode 100755 index 3c6f36e236..0000000000 --- a/libs/libsndfile/Octave/octave_test.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - - -# Check where we're being run from. -if test -d Octave ; then - cd Octave - octave_src_dir=$(pwd) -elif test -z "$octave_src_dir" ; then - echo - echo "Error : \$octave_src_dir is undefined." - echo - exit 1 -else - octave_src_dir=$(cd $octave_src_dir && pwd) - fi - -# Find libsndfile shared object. -libsndfile_lib_location="" - -if test -f "../src/.libs/libsndfile.so" ; then - libsndfile_lib_location="../src/.libs/" -elif test -f "../src/libsndfile.so" ; then - libsndfile_lib_location="../src/" -elif test -f "../src/.libs/libsndfile.dylib" ; then - libsndfile_lib_location="../src/.libs/" -elif test -f "../src/libsndfile.dylib" ; then - libsndfile_lib_location="../src/" -else - echo - echo "Not able to find the libsndfile shared lib we've just built." - echo "This may cause the following test to fail." - echo - fi - -libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)` - - -# Find sndfile.oct -sndfile_oct_location="" - -if test -f .libs/sndfile.oct ; then - sndfile_oct_location=".libs" -elif test -f sndfile.oct ; then - sndfile_oct_location="." -else - echo "Not able to find the sndfile.oct binaries we've just built." - exit 1 - fi - -case `file -b $sndfile_oct_location/sndfile.oct` in - ELF*) - ;; - Mach*) - echo "Tests don't work on this platform." - exit 0 - ;; - *) - echo "Not able to find the sndfile.oct binary we just built." - exit 1 - ;; - esac - - -# Make sure the TERM environment variable doesn't contain anything wrong. -unset TERM -# echo "octave_src_dir : $octave_src_dir" -# echo "libsndfile_lib_location : $libsndfile_lib_location" -# echo "sndfile_oct_location : $sndfile_oct_location" - -if test ! -f PKG_ADD ; then - cp $octave_src_dir/PKG_ADD . - fi - -export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH" - -octave_script="$octave_src_dir/octave_test.m" - -(cd $sndfile_oct_location && octave -qH $octave_script) -res=$? -echo -exit $res diff --git a/libs/libsndfile/Octave/sndfile.cc b/libs/libsndfile/Octave/sndfile.cc deleted file mode 100644 index 6e9cd44cc9..0000000000 --- a/libs/libsndfile/Octave/sndfile.cc +++ /dev/null @@ -1,405 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include "sndfile.h" - -#define FOUR_GIG (0x100000000LL) -#define BUFFER_FRAMES 8192 - - -static int format_of_str (const std::string & fmt) ; -static void string_of_format (std::string & fmt, int format) ; - - -DEFUN_DLD (sfversion, args, nargout , -"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{version} =} sfversion ()\n\ -@cindex Reading sound files\n\ -Return a string containing the libsndfile version.\n\ -@seealso{sfread, sfwrite}\n\ -@end deftypefn") -{ char buffer [256] ; - octave_value_list retval ; - - /* Bail out if the input parameters are bad. */ - if (args.length () != 0 || nargout > 1) - { print_usage () ; - return retval ; - } ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - - std::string version (buffer) ; - - retval.append (version) ; - return retval ; -} /* sfversion */ - - -DEFUN_DLD (sfread, args, nargout , -"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{data},@var{srate},@var{format} =} sfread (@var{filename})\n\ -@cindex Reading sound files\n\ -Read a sound file from disk using libsndfile.\n\ -@seealso{sfversion, sfwrite}\n\ -@end deftypefn") -{ SNDFILE * file ; - SF_INFO sfinfo ; - - octave_value_list retval ; - - int nargin = args.length () ; - - /* Bail out if the input parameters are bad. */ - if ((nargin != 1) || !args (0) .is_string () || nargout < 1 || nargout > 3) - { print_usage () ; - return retval ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - std::string filename = args (0).string_value () ; - - if ((file = sf_open (filename.c_str (), SFM_READ, &sfinfo)) == NULL) - { error ("sfread: couldn't open file %s : %s", filename.c_str (), sf_strerror (NULL)) ; - return retval ; - } ; - - if (sfinfo.frames > FOUR_GIG) - printf ("This is a really huge file (%lld frames).\nYou may run out of memory trying to load it.\n", (long long) sfinfo.frames) ; - - dim_vector dim = dim_vector () ; - dim.resize (2) ; - dim (0) = sfinfo.frames ; - dim (1) = sfinfo.channels ; - - /* Should I be using Matrix instead? */ - NDArray out (dim, 0.0) ; - - float buffer [BUFFER_FRAMES * sfinfo.channels] ; - int readcount ; - sf_count_t total = 0 ; - - do - { readcount = sf_readf_float (file, buffer, BUFFER_FRAMES) ; - - /* Make sure we don't read more frames than we allocated. */ - if (total + readcount > sfinfo.frames) - readcount = sfinfo.frames - total ; - - for (int ch = 0 ; ch < sfinfo.channels ; ch++) - { for (int k = 0 ; k < readcount ; k++) - out (total + k, ch) = buffer [k * sfinfo.channels + ch] ; - } ; - - total += readcount ; - } while (readcount > 0 && total < sfinfo.frames) ; - - retval.append (out.squeeze ()) ; - - if (nargout >= 2) - retval.append ((octave_uint32) sfinfo.samplerate) ; - - if (nargout >= 3) - { std::string fmt ("") ; - string_of_format (fmt, sfinfo.format) ; - retval.append (fmt) ; - } ; - - /* Clean up. */ - sf_close (file) ; - - return retval ; -} /* sfread */ - -DEFUN_DLD (sfwrite, args, nargout , -"-*- texinfo -*-\n\ -@deftypefn {Function File} sfwrite (@var{filename},@var{data},@var{srate},@var{format})\n\ -Write a sound file to disk using libsndfile.\n\ -@seealso{sfread, sfversion}\n\ -@end deftypefn\n\ -") -{ SNDFILE * file ; - SF_INFO sfinfo ; - - octave_value_list retval ; - - int nargin = args.length () ; - - /* Bail out if the input parameters are bad. */ - if (nargin != 4 || !args (0).is_string () || !args (1).is_real_matrix () - || !args (2).is_real_scalar () || !args (3).is_string () - || nargout != 0) - { print_usage () ; - return retval ; - } ; - - std::string filename = args (0).string_value () ; - std::string format = args (3).string_value () ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sfinfo.format = format_of_str (format) ; - if (sfinfo.format == 0) - { error ("Bad format '%s'", format.c_str ()) ; - return retval ; - } ; - - sfinfo.samplerate = lrint (args (2).scalar_value ()) ; - if (sfinfo.samplerate < 1) - { error ("Bad sample rate : %d.\n", sfinfo.samplerate) ; - return retval ; - } ; - - Matrix data = args (1).matrix_value () ; - long rows = args (1).rows () ; - long cols = args (1).columns () ; - - if (cols > rows) - { error ("Audio data should have one column per channel, but supplied data " - "has %ld rows and %ld columns.\n", rows, cols) ; - return retval ; - } ; - - sfinfo.channels = cols ; - - if ((file = sf_open (filename.c_str (), SFM_WRITE, &sfinfo)) == NULL) - { error ("Couldn't open file %s : %s", filename.c_str (), sf_strerror (NULL)) ; - return retval ; - } ; - - float buffer [BUFFER_FRAMES * sfinfo.channels] ; - int writecount ; - long total = 0 ; - - do - { - writecount = BUFFER_FRAMES ; - - /* Make sure we don't read more frames than we allocated. */ - if (total + writecount > rows) - writecount = rows - total ; - - for (int ch = 0 ; ch < sfinfo.channels ; ch++) - { for (int k = 0 ; k < writecount ; k++) - buffer [k * sfinfo.channels + ch] = data (total + k, ch) ; - } ; - - if (writecount > 0) - sf_writef_float (file, buffer, writecount) ; - - total += writecount ; - } while (writecount > 0 && total < rows) ; - - /* Clean up. */ - sf_close (file) ; - - return retval ; -} /* sfwrite */ - - -static void -str_split (const std::string & str, const std::string & delim, std::vector & output) -{ - unsigned int offset = 0 ; - size_t delim_index = 0 ; - - delim_index = str.find (delim, offset) ; - - while (delim_index != std::string::npos) - { - output.push_back (str.substr(offset, delim_index - offset)) ; - offset += delim_index - offset + delim.length () ; - delim_index = str.find (delim, offset) ; - } - - output.push_back (str.substr (offset)) ; -} /* str_split */ - -static int -hash_of_str (const std::string & str) -{ - int hash = 0 ; - - for (unsigned k = 0 ; k < str.length () ; k++) - hash = (hash * 3) + tolower (str [k]) ; - - return hash ; -} /* hash_of_str */ - -static int -major_format_of_hash (const std::string & str) -{ int hash ; - - hash = hash_of_str (str) ; - - switch (hash) - { - case 0x5c8 : /* 'wav' */ return SF_FORMAT_WAV ; - case 0xf84 : /* 'aiff' */ return SF_FORMAT_AIFF ; - case 0x198 : /* 'au' */ return SF_FORMAT_AU ; - case 0x579 : /* 'paf' */ return SF_FORMAT_PAF ; - case 0x5e5 : /* 'svx' */ return SF_FORMAT_SVX ; - case 0x1118 : /* 'nist' */ return SF_FORMAT_NIST ; - case 0x5d6 : /* 'voc' */ return SF_FORMAT_VOC ; - case 0x324a : /* 'ircam' */ return SF_FORMAT_IRCAM ; - case 0x505 : /* 'w64' */ return SF_FORMAT_W64 ; - case 0x1078 : /* 'mat4' */ return SF_FORMAT_MAT4 ; - case 0x1079 : /* 'mat5' */ return SF_FORMAT_MAT5 ; - case 0x5b8 : /* 'pvf' */ return SF_FORMAT_PVF ; - case 0x1d1 : /* 'xi' */ return SF_FORMAT_XI ; - case 0x56f : /* 'htk' */ return SF_FORMAT_HTK ; - case 0x5aa : /* 'sds' */ return SF_FORMAT_SDS ; - case 0x53d : /* 'avr' */ return SF_FORMAT_AVR ; - case 0x11d0 : /* 'wavx' */ return SF_FORMAT_WAVEX ; - case 0x569 : /* 'sd2' */ return SF_FORMAT_SD2 ; - case 0x1014 : /* 'flac' */ return SF_FORMAT_FLAC ; - case 0x504 : /* 'caf' */ return SF_FORMAT_CAF ; - case 0x5f6 : /* 'wve' */ return SF_FORMAT_WVE ; - default : break ; - } ; - - printf ("%s : hash '%s' -> 0x%x\n", __func__, str.c_str (), hash) ; - - return 0 ; -} /* major_format_of_hash */ - -static int -minor_format_of_hash (const std::string & str) -{ int hash ; - - hash = hash_of_str (str) ; - - switch (hash) - { - case 0x1085 : /* 'int8' */ return SF_FORMAT_PCM_S8 ; - case 0x358a : /* 'uint8' */ return SF_FORMAT_PCM_U8 ; - case 0x31b0 : /* 'int16' */ return SF_FORMAT_PCM_16 ; - case 0x31b1 : /* 'int24' */ return SF_FORMAT_PCM_24 ; - case 0x31b2 : /* 'int32' */ return SF_FORMAT_PCM_32 ; - case 0x3128 : /* 'float' */ return SF_FORMAT_FLOAT ; - case 0x937d : /* 'double' */ return SF_FORMAT_DOUBLE ; - case 0x11bd : /* 'ulaw' */ return SF_FORMAT_ULAW ; - case 0xfa1 : /* 'alaw' */ return SF_FORMAT_ALAW ; - case 0xfc361 : /* 'ima_adpcm' */ return SF_FORMAT_IMA_ADPCM ; - case 0x5739a : /* 'ms_adpcm' */ return SF_FORMAT_MS_ADPCM ; - case 0x9450 : /* 'gsm610' */ return SF_FORMAT_GSM610 ; - case 0x172a3 : /* 'g721_32' */ return SF_FORMAT_G721_32 ; - case 0x172d8 : /* 'g723_24' */ return SF_FORMAT_G723_24 ; - case 0x172da : /* 'g723_40' */ return SF_FORMAT_G723_40 ; - default : break ; - } ; - - printf ("%s : hash '%s' -> 0x%x\n", __func__, str.c_str (), hash) ; - - return 0 ; -} /* minor_format_of_hash */ - - -static const char * -string_of_major_format (int format) -{ - switch (format & SF_FORMAT_TYPEMASK) - { - case SF_FORMAT_WAV : return "wav" ; - case SF_FORMAT_AIFF : return "aiff" ; - case SF_FORMAT_AU : return "au" ; - case SF_FORMAT_PAF : return "paf" ; - case SF_FORMAT_SVX : return "svx" ; - case SF_FORMAT_NIST : return "nist" ; - case SF_FORMAT_VOC : return "voc" ; - case SF_FORMAT_IRCAM : return "ircam" ; - case SF_FORMAT_W64 : return "w64" ; - case SF_FORMAT_MAT4 : return "mat4" ; - case SF_FORMAT_MAT5 : return "mat5" ; - case SF_FORMAT_PVF : return "pvf" ; - case SF_FORMAT_XI : return "xi" ; - case SF_FORMAT_HTK : return "htk" ; - case SF_FORMAT_SDS : return "sds" ; - case SF_FORMAT_AVR : return "avr" ; - case SF_FORMAT_WAVEX : return "wavx" ; - case SF_FORMAT_SD2 : return "sd2" ; - case SF_FORMAT_FLAC : return "flac" ; - case SF_FORMAT_CAF : return "caf" ; - case SF_FORMAT_WVE : return "wfe" ; - default : break ; - } ; - - return "unknown" ; -} /* string_of_major_format */ - -static const char * -string_of_minor_format (int format) -{ - switch (format & SF_FORMAT_SUBMASK) - { - case SF_FORMAT_PCM_S8 : return "int8" ; - case SF_FORMAT_PCM_U8 : return "uint8" ; - case SF_FORMAT_PCM_16 : return "int16" ; - case SF_FORMAT_PCM_24 : return "int24" ; - case SF_FORMAT_PCM_32 : return "int32" ; - case SF_FORMAT_FLOAT : return "float" ; - case SF_FORMAT_DOUBLE : return "double" ; - case SF_FORMAT_ULAW : return "ulaw" ; - case SF_FORMAT_ALAW : return "alaw" ; - case SF_FORMAT_IMA_ADPCM : return "ima_adpcm" ; - case SF_FORMAT_MS_ADPCM : return "ms_adpcm" ; - case SF_FORMAT_GSM610 : return "gsm610" ; - case SF_FORMAT_G721_32 : return "g721_32" ; - case SF_FORMAT_G723_24 : return "g723_24" ; - case SF_FORMAT_G723_40 : return "g723_40" ; - default : break ; - } ; - - return "unknown" ; -} /* string_of_minor_format */ - -static int -format_of_str (const std::string & fmt) -{ - std::vector split ; - - str_split (fmt, "-", split) ; - - if (split.size () != 2) - return 0 ; - - int major_fmt = major_format_of_hash (split.at (0)) ; - if (major_fmt == 0) - return 0 ; - - int minor_fmt = minor_format_of_hash (split.at (1)) ; - if (minor_fmt == 0) - return 0 ; - - return major_fmt | minor_fmt ; -} /* format_of_str */ - -static void -string_of_format (std::string & fmt, int format) -{ - char buffer [64] ; - - snprintf (buffer, sizeof (buffer), "%s-%s", string_of_major_format (format), string_of_minor_format (format)) ; - - fmt = buffer ; - - return ; -} /* string_of_format */ diff --git a/libs/libsndfile/Octave/sndfile_load.m b/libs/libsndfile/Octave/sndfile_load.m deleted file mode 100644 index c66198fa35..0000000000 --- a/libs/libsndfile/Octave/sndfile_load.m +++ /dev/null @@ -1,52 +0,0 @@ -## Copyright (C) 2002-2011 Erik de Castro Lopo -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} sndfile_load (@var{filename}) -## Load data from the file given by @var{filename}. -## @end deftypefn - -## Author: Erik de Castro Lopo -## Description: Load the sound data from the given file name - -function [data fs] = sndfile_load (filename) - -if (nargin != 1), - error ("Need an input filename") ; - endif - -samplerate = -1 ; -samplingrate = -1 ; -wavedata = -1 ; - - -eval (sprintf ('load -f %s', filename)) ; - -if (samplerate > 0), - fs = samplerate ; -elseif (samplingrate > 0), - fs = samplingrate ; -else - error ("Not able to find sample rate.") ; - endif - -if (max (size (wavedata)) > 1), - data = wavedata ; -else - error ("Not able to find waveform data.") ; - endif - -endfunction diff --git a/libs/libsndfile/Octave/sndfile_play.m b/libs/libsndfile/Octave/sndfile_play.m deleted file mode 100644 index e8a34a74cb..0000000000 --- a/libs/libsndfile/Octave/sndfile_play.m +++ /dev/null @@ -1,59 +0,0 @@ -## Copyright (C) 2002-2011 Erik de Castro Lopo -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} sndfile_play (@var{data, fs}) -## Play @var{data} at sample rate @var{fs} using the sndfile-play -## program. -## @end deftypefn - -## Author: Erik de Castro Lopo -## Description: Play the given data as a sound file - -function sndfile_play (data, fs) - -if nargin != 2, - error ("Need two input arguments: data and fs.") ; - endif - -if (max (size (fs)) > 1), - error ("Second parameter fs must be a single value.") ; - endif - -[nr nc] = size (data) ; - -if (nr > nc), - data = data' ; - endif - -samplerate = fs ; -wavedata = data ; - -filename = tmpnam () ; - -cmd = sprintf ("save -mat-binary %s fs data", filename) ; - -eval (cmd) ; - -cmd = sprintf ("sndfile-play %s", filename) ; - -[output, status] = system (cmd) ; - -if (status), - disp (outout) ; - endif - -endfunction diff --git a/libs/libsndfile/Octave/sndfile_save.m b/libs/libsndfile/Octave/sndfile_save.m deleted file mode 100644 index 5b7e7c7d0f..0000000000 --- a/libs/libsndfile/Octave/sndfile_save.m +++ /dev/null @@ -1,53 +0,0 @@ -## Copyright (C) 2002-2011 Erik de Castro Lopo -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} sndfile_save (@var{filename, data, fs}) -## Save the given @var{data} as audio data to the given at @var{fs}. Set -## the sample rate to @var{fs}. -## @end deftypefn - -## Author: Erik de Castro Lopo -## Description: Save data as a sound file - -function sndfile_save (filename, data, fs) - -if nargin != 3, - error ("Need three input arguments: filename, data and fs.") ; - endif - -if (! isstr (filename)), - error ("First parameter 'filename' is must be a string.") ; - endif - -if (max (size (fs)) > 1), - error ("Second parameter 'fs' must be a single value, not an array or matrix.") ; - endif - -[nr nc] = size (data) ; - -if (nr > nc), - data = data' ; - endif - -samplerate = fs ; -wavedata = data ; - -str = sprintf ("save -mat-binary %s samplerate wavedata", filename) ; - -eval (str) ; - -endfunction diff --git a/libs/libsndfile/README b/libs/libsndfile/README deleted file mode 100644 index 8df79c7d9f..0000000000 --- a/libs/libsndfile/README +++ /dev/null @@ -1,68 +0,0 @@ -This is libsndfile, 1.0.25 - -libsndfile is a library of C routines for reading and writing -files containing sampled audio data. - -The src/ directory contains the source code for library itself. - -The doc/ directory contains the libsndfile documentation. - -The examples/ directory contains examples of how to write code using -libsndfile. - -The tests/ directory contains programs which link against libsndfile -and test its functionality. - -The src/GSM610 directory contains code written by Jutta Degener and Carsten -Bormann. Their original code can be found at : - http://kbs.cs.tu-berlin.de/~jutta/toast.html - -The src/G72x directory contains code written and released by Sun Microsystems -under a suitably free license. - -The src/ALAC directory contains code written and released by Apple Inc and -released under the Apache license. - - -LINUX ------ -Whereever possible, you should use the packages supplied by your Linux -distribution. - -If you really do need to compile from source it should be as easy as: - - ./configure - make - make install - -Since libsndfile optionally links against libFLAC, libogg and libvorbis, you -will need to install appropriate versions of these libraries before running -configure as above. - - -UNIX ----- -Compile as for Linux. - - -Win32/Win64 ------------ -The default Windows compilers are nowhere near compliant with the 1999 ISO -C Standard and hence not able to compile libsndfile. - -Please use the libsndfile binaries available on the libsndfile web site. - - -MacOSX ------- -Building on MacOSX should be the same as building it on any other Unix. - - -CONTACTS --------- - -libsndfile was written by Erik de Castro Lopo (erikd AT mega-nerd DOT com). -The libsndfile home page is at : - - http://www.mega-nerd.com/libsndfile/ - diff --git a/libs/libsndfile/README.md b/libs/libsndfile/README.md deleted file mode 100644 index a7fdaea71f..0000000000 --- a/libs/libsndfile/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# libsndfile - -libsndfile is a C library for reading and writing files containing sampled audio -data. - -## Hacking - -The canonical source code repository for libsndfile is at -[https://github.com/erikd/libsndfile/][github]. - -You can grab the source code using: - - $ git clone git://github.com/erikd/libsndfile.git - -Building on Linux, OSX and Windows (Using GNU GCC) will require a number of GNU -and other Free and Open Source Software tools including: - -* [Autoconf][autoconf] -* [Autogen][autogen] -* [Automake][automake] -* [Libtool][libtool] -* [Pkgconfig][pkgconfig] -* [Python][python] - -If you are on Linux, its probably best to install these via your Linux -distribution's package manager. - -If you want to compile libsndfile with support for formats like FLAC and -Ogg/Vorbis you will also need to install the following optional libraries: - -* [FLAC][flac] -* [libogg][libogg] -* [libvorbis][libvorbis] - -Support for these extra libraries is an all or nothing affair. Unless all of -them are installed none of them will be supported. - - $ ./autogen.sh - -Running `autogen.sh` also installs a git pre-commit hook. The pre-commit hook -is run each time a user tries to commit and checks code about to be committed -against coding guidelines. - -Nest step is to run configure, with the following configure options being -recommended for anyone contemplating sending libsndfile patches: - - $ ./configure --enable-gcc-werror - -Finally libsndfile can be built and tested: - - $ make - $ make check - -## Submitting Patches. - -* Patches should pass all pre-commit hook tests. -* Patches should always be submitted via a either Github "pull request" or a - via emailed patches created using "git format-patch". -* Patches for new features should include tests and documentation. -* Patches to fix bugs should either pass all tests, or modify the tests in some - sane way. -* When a new feature is added for a particular file format and that feature - makes sense for other formats, then it should also be implemented for one - or two of the other formats. - - - - - -[autoconf]: http://www.gnu.org/s/autoconf/ -[autogen]: http://www.gnu.org/s/autogen/ -[automake]: http://www.gnu.org/software/automake/ -[flac]: http://flac.sourceforge.net/ -[github]: https://github.com/erikd/libsndfile/ -[libogg]: http://xiph.org/ogg/ -[libtool]: http://www.gnu.org/software/libtool/ -[libvorbis]: http://www.vorbis.com/ -[pkgconfig]: http://www.freedesktop.org/wiki/Software/pkg-config -[python]: http://www.python.org/ diff --git a/libs/libsndfile/Scripts/android-configure.sh b/libs/libsndfile/Scripts/android-configure.sh deleted file mode 100644 index c981d4927a..0000000000 --- a/libs/libsndfile/Scripts/android-configure.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -e - -# Copyright (C) 2013 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Android NDK version number; eg r8e, r9 etc -ANDROID_NDK_VER=r9 - -# Android NDK gcc version; eg 4.7, 4.9 etc. -ANDROID_GCC_VER=4.8 - -# Android API version; eg 9 (Android 2.3), 14 (Android 4.0) etc. -ANDROID_API_VER=9 - -#------------------------------------------------------------------------------- -# No more user config beyond here. - -BUILD_MACHINE=$(uname -s | tr 'A-Z' 'a-z')-$(uname -m) - -function die_with { - echo $1 - exit 1 -} - -export CROSS_COMPILE=arm-linux-androideabi - -# I put all my dev stuff in here -export DEV_PREFIX=$HOME/Android -test -d ${DEV_PREFIX} || die_with "Error : DEV_PREFIX '$DEV_PREFIX' does not exist." - -# Don't forget to adjust this to your NDK path -export ANDROID_NDK=${DEV_PREFIX}/android-ndk-${ANDROID_NDK_VER} -test -d ${ANDROID_NDK} || die_with "Error : ANDROID_NDK '$ANDROID_NDK' does not exist." - -export ANDROID_PREFIX=${ANDROID_NDK}/toolchains/arm-linux-androideabi-${ANDROID_GCC_VER}/prebuilt/${BUILD_MACHINE} -test -d ${ANDROID_PREFIX} || die_with "Error : ANDROID_PREFIX '$ANDROID_PREFIX' does not exist." - -export SYSROOT=${ANDROID_NDK}/platforms/android-${ANDROID_API_VER}/arch-arm -test -d ${SYSROOT} || die_with "Error : SYSROOT '$SYSROOT' does not exist." - -export CROSS_PREFIX=${ANDROID_PREFIX}/bin/${CROSS_COMPILE} -test -f ${CROSS_PREFIX}-gcc || die_with "Error : CROSS_PREFIX compiler '${CROSS_PREFIX}-gcc' does not exist." - - -# Non-exhaustive lists of compiler + binutils -# Depending on what you compile, you might need more binutils than that -export CPP=${CROSS_PREFIX}-cpp -export AR=${CROSS_PREFIX}-ar -export AS=${CROSS_PREFIX}-as -export NM=${CROSS_PREFIX}-nm -export CC=${CROSS_PREFIX}-gcc -export CXX=${CROSS_PREFIX}-g++ -export LD=${CROSS_PREFIX}-ld -export RANLIB=${CROSS_PREFIX}-ranlib - -# Don't mix up .pc files from your host and build target -export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig - -# Set up the needed FLAGS. -export CFLAGS="${CFLAGS} -gstabs --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include" -export CXXFLAGS="${CXXFLAGS} -gstabs -fno-exceptions --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VER}/include/ -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VER}/libs/armeabi/include" - -export CPPFLAGS="${CFLAGS}" -export LDFLAGS="${LDFLAGS} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib" - -# Create a symlink to the gdbclient. -test -h gdbclient || ln -s ${ANDROID_PREFIX}/bin/arm-linux-androideabi-gdb gdbclient - -./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} "$@" diff --git a/libs/libsndfile/Scripts/build-test-tarball.mk.in b/libs/libsndfile/Scripts/build-test-tarball.mk.in deleted file mode 100644 index 931edb6464..0000000000 --- a/libs/libsndfile/Scripts/build-test-tarball.mk.in +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/make -f - -# This is probably only going to work with GNU Make. -# This in a separate file instead of in Makefile.am because Automake complains -# about the GNU Make-isms. - -EXEEXT = @EXEEXT@ - -PACKAGE_VERSION = @PACKAGE_VERSION@ - -HOST_TRIPLET = @HOST_TRIPLET@ - -SRC_BINDIR = @SRC_BINDIR@ -TEST_BINDIR = @TEST_BINDIR@ - -LIBRARY := $(SRC_BINDIR)libsndfile.so.$(LIB_VERSION) - -LIB_VERSION := $(shell echo $(PACKAGE_VERSION) | sed -e 's/[a-z].*//') - -TESTNAME = libsndfile-testsuite-$(HOST_TRIPLET)-$(PACKAGE_VERSION) - -TARBALL = $(TESTNAME).tar.gz - -# Find the test programs by grepping the script for the programs it executes. -testprogs := $(shell grep '^\./' tests/test_wrapper.sh | sed -e "s|./||" -e "s/ .*//" | sort | uniq) -# Also add the programs not found by the above. -testprogs += sfversion@EXEEXT@ stdin_test@EXEEXT@ stdout_test@EXEEXT@ cpp_test@EXEEXT@ win32_test@EXEEXT@ - -# Find the single test program in src/ . -srcprogs := $(shell if test -x src/.libs/test_main$(EXEEXT) ; then echo "src/.libs/test_main$(EXEEXT)" ; else echo "src/test_main$(EXEEXT)" ; fi) - -libfiles := $(shell if test ! -z $(EXEEXT) ; then echo "src/libsndfile-1.def src/.libs/libsndfile-1.dll" ; elif test -f $(LIBRARY) ; then echo $(LIBRARY) ; fi ; fi) - -testbins := $(addprefix $(TEST_BINDIR),$(subst @EXEEXT@,$(EXEEXT),$(testprogs))) $(libfiles) $(srcprogs) - - -all : $(TARBALL) - -clean : - rm -rf $(TARBALL) $(TESTNAME)/ - -check : $(TESTNAME)/test_wrapper.sh - (cd ./$(TESTNAME)/ && ./test_wrapper.sh) - -$(TARBALL) : $(TESTNAME)/test_wrapper.sh - tar zcf $@ $(TESTNAME) - rm -rf $(TESTNAME) - @echo - @echo "Created : $(TARBALL)" - @echo - -$(TESTNAME)/test_wrapper.sh : $(testbins) tests/test_wrapper.sh tests/pedantic-header-test.sh - rm -rf $(TESTNAME) - mkdir -p $(TESTNAME)/tests/ - cp $(testbins) $(TESTNAME)/tests/ - cp tests/test_wrapper.sh $(TESTNAME)/ - cp tests/pedantic-header-test.sh $(TESTNAME)/tests/ - chmod u+x $@ - -tests/test_wrapper.sh : tests/test_wrapper.sh.in - (cd tests/ ; make $@) diff --git a/libs/libsndfile/Scripts/clang-sanitize.sh b/libs/libsndfile/Scripts/clang-sanitize.sh deleted file mode 100644 index 2898883c21..0000000000 --- a/libs/libsndfile/Scripts/clang-sanitize.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# This is known to work with clang-3.4 from Debian testing/unstable. -# 2013/07/14 - -export CC=clang -export CXX=clang++ -export CFLAGS="-O3 -fsanitize=address,integer,undefined" -export CXXFLAGS="-O3 -fsanitize=address,integer,undefined" - -./configure --enable-gcc-werror - -make clean all check diff --git a/libs/libsndfile/Scripts/cstyle.py b/libs/libsndfile/Scripts/cstyle.py deleted file mode 100644 index 94a969c6e2..0000000000 --- a/libs/libsndfile/Scripts/cstyle.py +++ /dev/null @@ -1,246 +0,0 @@ -#!/usr/bin/python -tt -# -# Copyright (C) 2005-2012 Erik de Castro Lopo -# -# Released under the 2 clause BSD license. - -""" -This program checks C code for compliance to coding standards used in -libsndfile and other projects I run. -""" - -import re -import sys - - -class Preprocessor: - """ - Preprocess lines of C code to make it easier for the CStyleChecker class to - test for correctness. Preprocessing works on a single line at a time but - maintains state between consecutive lines so it can preprocessess multi-line - comments. - Preprocessing involves: - - Strip C++ style comments from a line. - - Strip C comments from a series of lines. When a C comment starts and - ends on the same line it will be replaced with 'comment'. - - Replace arbitrary C strings with the zero length string. - - Replace '#define f(x)' with '#define f (c)' (The C #define requires that - there be no space between defined macro name and the open paren of the - argument list). - Used by the CStyleChecker class. - """ - def __init__ (self): - self.comment_nest = 0 - self.leading_space_re = re.compile ('^(\t+| )') - self.trailing_space_re = re.compile ('(\t+| )$') - self.define_hack_re = re.compile ("(#\s*define\s+[a-zA-Z0-9_]+)\(") - - def comment_nesting (self): - """ - Return the currect comment nesting. At the start and end of the file, - this value should be zero. Inside C comments it should be 1 or - (possibly) more. - """ - return self.comment_nest - - def __call__ (self, line): - """ - Strip the provided line of C and C++ comments. Stripping of multi-line - C comments works as expected. - """ - - line = self.define_hack_re.sub (r'\1 (', line) - - line = self.process_strings (line) - - # Strip C++ style comments. - if self.comment_nest == 0: - line = re.sub ("( |\t*)//.*", '', line) - - # Strip C style comments. - open_comment = line.find ('/*') - close_comment = line.find ('*/') - - if self.comment_nest > 0 and close_comment < 0: - # Inside a comment block that does not close on this line. - return "" - - if open_comment >= 0 and close_comment < 0: - # A comment begins on this line but doesn't close on this line. - self.comment_nest += 1 - return self.trailing_space_re.sub ('', line [:open_comment]) - - if open_comment < 0 and close_comment >= 0: - # Currently open comment ends on this line. - self.comment_nest -= 1 - return self.trailing_space_re.sub ('', line [close_comment + 2:]) - - if open_comment >= 0 and close_comment > 0 and self.comment_nest == 0: - # Comment begins and ends on this line. Replace it with 'comment' - # so we don't need to check whitespace before and after the comment - # we're removing. - newline = line [:open_comment] + "comment" + line [close_comment + 2:] - return self.__call__ (newline) - - return line - - def process_strings (self, line): - """ - Given a line of C code, return a string where all literal C strings have - been replaced with the empty string literal "". - """ - for k in range (0, len (line)): - if line [k] == '"': - start = k - for k in range (start + 1, len (line)): - if line [k] == '"' and line [k - 1] != '\\': - return line [:start + 1] + '"' + self.process_strings (line [k + 1:]) - return line - - -class CStyleChecker: - """ - A class for checking the whitespace and layout of a C code. - """ - def __init__ (self, debug): - self.debug = debug - self.filename = None - self.error_count = 0 - self.line_num = 1 - self.orig_line = '' - self.trailing_newline_re = re.compile ('[\r\n]+$') - self.indent_re = re.compile ("^\s*") - self.last_line_indent = "" - self.last_line_indent_curly = False - self.re_checks = \ - [ ( re.compile (" "), "multiple space instead of tab" ) - , ( re.compile ("\t "), "space after tab" ) - , ( re.compile ("[^ ];"), "missing space before semi-colon" ) - , ( re.compile ("{[^\s}]"), "missing space after open brace" ) - , ( re.compile ("[^{\s]}"), "missing space before close brace" ) - , ( re.compile ("[ \t]+$"), "contains trailing whitespace" ) - - , ( re.compile (",[^\s\n]"), "missing space after comma" ) - , ( re.compile (";[a-zA-Z0-9]"), "missing space after semi-colon" ) - , ( re.compile ("=[^\s\"'=]"), "missing space after assignment" ) - - # Open and close parenthesis. - , ( re.compile ("[^\s\(\[\*&']\("), "missing space before open parenthesis" ) - , ( re.compile ("\)(-[^>]|[^,'\s\n\)\]-])"), "missing space after close parenthesis" ) - , ( re.compile ("\s(do|for|if|when)\s.*{$"), "trailing open parenthesis at end of line" ) - , ( re.compile ("\( [^;]"), "space after open parenthesis" ) - , ( re.compile ("[^;] \)"), "space before close parenthesis" ) - - # Open and close square brace. - , ( re.compile ("[^\s\(\]]\["), "missing space before open square brace" ) - , ( re.compile ("\][^,\)\]\[\s\.-]"), "missing space after close square brace" ) - , ( re.compile ("\[ "), "space after open square brace" ) - , ( re.compile (" \]"), "space before close square brace" ) - - # Space around operators. - , ( re.compile ("[^\s][\*/%+-][=][^\s]"), "missing space around opassign" ) - , ( re.compile ("[^\s][<>!=^/][=]{1,2}[^\s]"), "missing space around comparison" ) - - # Parens around single argument to return. - , ( re.compile ("\s+return\s+\([a-zA-Z0-9_]+\)\s+;"), "parens around return value" ) - ] - - def get_error_count (self): - """ - Return the current error count for this CStyleChecker object. - """ - return self.error_count - - def check_files (self, files): - """ - Run the style checker on all the specified files. - """ - for filename in files: - self.check_file (filename) - - def check_file (self, filename): - """ - Run the style checker on the specified file. - """ - self.filename = filename - cfile = open (filename, "r") - - self.line_num = 1 - - preprocess = Preprocessor () - while 1: - line = cfile.readline () - if not line: - break - - line = self.trailing_newline_re.sub ('', line) - self.orig_line = line - - self.line_checks (preprocess (line)) - - self.line_num += 1 - - cfile.close () - self.filename = None - - # Check for errors finding comments. - if preprocess.comment_nesting () != 0: - print ("Weird, comments nested incorrectly.") - sys.exit (1) - - return - - def line_checks (self, line): - """ - Run the style checker on provided line of text, but within the context - of how the line fits within the file. - """ - - indent = len (self.indent_re.search (line).group ()) - if re.search ("^\s+}", line): - if not self.last_line_indent_curly and indent != self.last_line_indent: - None # self.error ("bad indent on close curly brace") - self.last_line_indent_curly = True - else: - self.last_line_indent_curly = False - - # Now all the regex checks. - for (check_re, msg) in self.re_checks: - if check_re.search (line): - self.error (msg) - - if re.search ("[a-zA-Z0-9][<>!=^/&\|]{1,2}[a-zA-Z0-9]", line): - if not re.search (".*#include.*[a-zA-Z0-9]/[a-zA-Z]", line): - self.error ("missing space around operator") - - self.last_line_indent = indent - return - - def error (self, msg): - """ - Print an error message and increment the error count. - """ - print ("%s (%d) : %s" % (self.filename, self.line_num, msg)) - if self.debug: - print ("'" + self.orig_line + "'") - self.error_count += 1 - -#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -if len (sys.argv) < 1: - print ("Usage : yada yada") - sys.exit (1) - -# Create a new CStyleChecker object -if sys.argv [1] == '-d' or sys.argv [1] == '--debug': - cstyle = CStyleChecker (True) - cstyle.check_files (sys.argv [2:]) -else: - cstyle = CStyleChecker (False) - cstyle.check_files (sys.argv [1:]) - - -if cstyle.get_error_count (): - sys.exit (1) - -sys.exit (0) diff --git a/libs/libsndfile/Scripts/git-pre-commit-hook b/libs/libsndfile/Scripts/git-pre-commit-hook deleted file mode 100644 index 6df1308ac3..0000000000 --- a/libs/libsndfile/Scripts/git-pre-commit-hook +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -# - -if git rev-parse --verify HEAD >/dev/null 2>&1 ; then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 - fi - -files=$(git diff-index --name-status --cached HEAD | grep -v ^D | sed -r "s/^[A-Z]+[A-Z0-9]*[ \t]+/ /") - -# Redirect output to stderr. -exec 1>&2 - -#------------------------------------------------------------------------------- -# Check the copyright notice of all files to be commited. - -user=`git config --global user.email` -year=`date +"%Y"` - -missing_copyright_year="" -if test $user = "erikd@mega-nerd.com" ; then - for f in $files ; do - if test `head -5 $f | grep -c -i copyright` -gt 0 ; then - user_copyright=`grep -i copyright $f | grep $user | grep -c $year` - if test $user_copyright -lt 1 ; then - missing_copyright_year="$missing_copyright_year $f" - fi - fi - done - fi - -if test -n "$missing_copyright_year" ; then - echo "Missing current year in the copyright notice of the following files:" - for f in $missing_copyright_year ; do - echo " $f" - done - echo "Commit aborted." - exit 1 - fi - -#------------------------------------------------------------------------------- -# Check the formatting of all C files. - -cfiles="" -for f in $files ; do - if test `dirname $f` = "src/ALAC" ; then - echo "Skipping cstyle checking on $f" - elif test `echo $f | grep -c "\.[ch]$"` -gt 0 ; then - cfiles="$cfiles $f" - fi - done - -if test -n "$cfiles" ; then - Scripts/cstyle.py $cfiles - if test $? -ne 0 ; then - echo - echo "Commit aborted. Fix the above error before trying again." - exit 1 - fi - fi - -#------------------------------------------------------------------------------- -# Prevent files with non-ascii filenames from being committed. - -if test $(git diff --cached --name-only --diff-filter=A -z $against | LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 ; then - echo "Error: Attempt to add a non-ascii file name." - echo - echo "This can cause problems if you want to work" - echo "with people on other platforms." - echo - echo "To be portable it is advisable to rename the file ..." - echo - echo "Commit aborted." - exit 1 - fi - -exit 0 diff --git a/libs/libsndfile/Scripts/linux-to-win-cross-configure.sh b/libs/libsndfile/Scripts/linux-to-win-cross-configure.sh deleted file mode 100644 index c1fdc072b3..0000000000 --- a/libs/libsndfile/Scripts/linux-to-win-cross-configure.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -case "$1" in - w32) - compiler_name=i686-w64-mingw32 - ;; - w64) - compiler_name=x86_64-w64-mingw32 - ;; - *) - echo "$0 (w32|w64) " - exit 0 - ;; - esac - -shift - -build_cpu=$(dpkg-architecture -qDEB_BUILD_GNU_CPU) -build_host=$build_cpu-linux - -./configure --host=$compiler_name --target=$compiler_name --build=$build_host \ - --program-prefix='' --disable-sqlite --disable-static $@ diff --git a/libs/libsndfile/TODO b/libs/libsndfile/TODO deleted file mode 100644 index f6da6dff6a..0000000000 --- a/libs/libsndfile/TODO +++ /dev/null @@ -1,42 +0,0 @@ -Here's a list of what I (erikd AT mega-nerd DOT com) think needs to be -done. The list is by no means exhaustive and people are encouraged to -email me with suggestions. - - o Add pipe in/out capabilities. libsndfile should be able to read - its input from a pipe and write its output to a pipe. - - o Add checks of the error state after fseek???? Use ferror (). - - o Modify tests/lossy_comp_test.c to add tests for stereo files. - - o Testing compilation and correctness on more platforms. - - o Improve testing routines. Must test all combinations of inputs - and outputs. - - o Test sf_seek function on write??? - - o Add more sound file formats. People should contact me with their - requirements. - - o Add support for accessing sound formats with multiple audio - data sections (ie samples within tracker files, Soundfont II and - multi-sample sampler formats). - - o Add an interface to allow reading and writing of sample loop points - and other info within AIFF and other file formats. This must be a - general solution. - - o Improve documentation. Is HTML documentation good enough? - - o Look into the possibility of optional sample rate convert on file - read. - -As I am the person who knows libsndfile best, I can probably implement -any new features faster than anybody else (and you can spend your time -writing applications with libsndfile). All I need is some -documentation and some sample files. Please contact me before emailing -me documentation and sample files. I would much rather pull them off -the web than have them clogging up my email inbox. - - diff --git a/libs/libsndfile/Win32/Makefile.am b/libs/libsndfile/Win32/Makefile.am deleted file mode 100644 index 4fe8efa7b9..0000000000 --- a/libs/libsndfile/Win32/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = README-precompiled-dll.txt testprog.c - diff --git a/libs/libsndfile/Win32/README-precompiled-dll.txt b/libs/libsndfile/Win32/README-precompiled-dll.txt deleted file mode 100644 index bde8124219..0000000000 --- a/libs/libsndfile/Win32/README-precompiled-dll.txt +++ /dev/null @@ -1,40 +0,0 @@ -Notes on Using the Pre-compiled libsndfile DLL. -=============================================== - -In order to use this pre-compiled DLL with Visual Studio, you will need to -generate a .LIB file from the DLL. - -This can be achieved as follows: - - 1) In a CMD window, change to the directory containing this file and - run the command: - - lib /machine:i386 /def:libsndfile-1.def - -You now have two files: - - libsndfile-1.dll - libsndfile-1.lib - -to be used with VisualStudio. - -If the lib command fails with a command saying "'lib' is not recognized as -an internal or external command, operable program or batch file", you need -to find the location of "lib.exe" and add that directory to your PATH -environment variable. Another alternative is to use the "Visual Studio 2005 -Command Prompt" Start menu item: - - Start -> - All Programs -> - Visual Studio 2005 -> - Visual Studio Tools -> - Visual Studio 2005 Command Prompt - -If for some reason these instructions don't work for you or you are still -not able to use the libsndfile DLL with you project, please do not contact -the main author of libsndfile. Instead, join the libsndfile-users mailing -list : - - http://www.mega-nerd.com/libsndfile/lists.html - -and ask a question there. diff --git a/libs/libsndfile/Win32/testprog.c b/libs/libsndfile/Win32/testprog.c deleted file mode 100644 index d26d844adf..0000000000 --- a/libs/libsndfile/Win32/testprog.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Simple test program to make sure that Win32 linking to libsndfile is -** working. -*/ - -#include - -#include "sndfile.h" - -int -main (void) -{ static char strbuffer [256] ; - sf_command (NULL, SFC_GET_LIB_VERSION, strbuffer, sizeof (strbuffer)) ; - puts (strbuffer) ; - return 0 ; -} - diff --git a/libs/libsndfile/acinclude.m4 b/libs/libsndfile/acinclude.m4 deleted file mode 100644 index c411cebbda..0000000000 --- a/libs/libsndfile/acinclude.m4 +++ /dev/null @@ -1,637 +0,0 @@ -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -m4_include([M4/gcc_version.m4]) -m4_include([M4/octave.m4]) -m4_include([M4/mkoctfile_version.m4]) -m4_include([M4/extra_pkg.m4]) -m4_include([M4/lrint.m4]) -m4_include([M4/lrintf.m4]) -m4_include([M4/clang.m4]) -m4_include([M4/really_gcc.m4]) -m4_include([M4/stack_protect.m4]) -m4_include([M4/clip_mode.m4]) -m4_include([M4/add_cflags.m4]) -m4_include([M4/add_cxxflags.m4]) -m4_include([M4/flexible_array.m4]) -m4_include([M4/endian.m4]) -m4_include([M4/extra_largefile.m4]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_FLAGS(FLAGSNAME) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_FLAGS], - [AC_CACHE_CHECK([for $1 value to request large file support], - ac_cv_sys_largefile_$1, - [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { - ac_cv_sys_largefile_$1=no - ifelse($1, CFLAGS, - [case "$host_os" in - # IRIX 6.2 and later require cc -n32. -changequote(, )dnl - irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) -changequote([, ])dnl - if test "$GCC" != yes; then - ac_cv_sys_largefile_CFLAGS=-n32 - fi - ac_save_CC="$CC" - CC="$CC $ac_cv_sys_largefile_CFLAGS" - AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) - CC="$ac_save_CC" - esac]) - }])]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(VAR, VAL) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND], - [case $2 in - no) ;; - ?*) - case "[$]$1" in - '') $1=$2 ;; - *) $1=[$]$1' '$2 ;; - esac ;; - esac]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE], - [AC_CACHE_CHECK([for $1], $2, - [$2=no -changequote(, )dnl - $4 - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - -D$1) - $2=1 ;; - -D$1=*) - $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; - esac - done -changequote([, ])dnl - ]) - if test "[$]$2" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) - fi]) - -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], - [AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile omit support for large files]) - if test "$enable_largefile" != no; then - AC_CHECK_TOOL(GETCONF, getconf) - AC_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS) - AC_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS) - AC_SYS_EXTRA_LARGEFILE_FLAGS(LIBS) - - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - no) ;; - -D_FILE_OFFSET_BITS=*) ;; - -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; - -D_LARGE_FILES | -D_LARGE_FILES=*) ;; - -D?* | -I?*) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; - *) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; - esac - done - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.]) - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_file_offset_bits=64 ;; - esac] - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, - ac_cv_sys_largefile_source, - [Define to make fseeko etc. visible, on some hosts.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_largefile_source=1 ;; - esac]) - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGE_FILES, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - [case "$host_os" in - # AIX 4.2 and later - aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) - ac_cv_sys_large_files=1 ;; - esac]) - fi - ]) - - - - - - -dnl @synopsis AC_C_FIND_ENDIAN -dnl -dnl Determine endian-ness of target processor. -dnl @version 1.1 Mar 03 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Majority written from scratch to replace the standard autoconf macro -dnl AC_C_BIGENDIAN. Only part remaining from the original it the invocation -dnl of the AC_TRY_RUN macro. -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -dnl Find endian-ness in the following way: -dnl 1) Look in . -dnl 2) If 1) fails, look in and . -dnl 3) If 1) and 2) fails and not cross compiling run a test program. -dnl 4) If 1) and 2) fails and cross compiling then guess based on target. - -AC_DEFUN([AC_C_FIND_ENDIAN], -[AC_CACHE_CHECK(processor byte ordering, - ac_cv_c_byte_order, - -# Initialize to unknown -ac_cv_c_byte_order=unknown - -if test x$ac_cv_header_endian_h = xyes ; then - - # First try which should set BYTE_ORDER. - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=big - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - - [AC_TRY_LINK([ - #include - #include - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros - #endif - ], return 0 ;, - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - if test $cross_compiling = yes ; then - # This is the last resort. Try to guess the target processor endian-ness - # by looking at the target CPU type. - [ - case "$target_cpu" in - alpha* | i?86* | mipsel* | ia64*) - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=1 - ;; - - m68* | mips* | powerpc* | hppa* | sparc*) - ac_cv_c_big_endian=1 - ac_cv_c_little_endian=0 - ;; - - esac - ] - else - AC_TRY_RUN( - [[ - int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [sizeof (long) - 1] == 1); - } - ]], , ac_cv_c_byte_order=big, - ac_cv_c_byte_order=unknown - ) - - AC_TRY_RUN( - [[int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [0] == 1); - }]], , ac_cv_c_byte_order=little, - ac_cv_c_byte_order=unknown - ) - fi - fi - -) -] - -if test $ac_cv_c_byte_order = big ; then - ac_cv_c_big_endian=1 - ac_cv_c_little_endian=0 -elif test $ac_cv_c_byte_order = little ; then - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=1 -else - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=0 - - fi - -)# AC_C_FIND_ENDIAN - - - - - -dnl @synopsis AC_C99_FLEXIBLE_ARRAY -dnl -dnl Dose the compiler support the 1999 ISO C Standard "stuct hack". -dnl @version 1.1 Mar 15 2004 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -AC_DEFUN([AC_C99_FLEXIBLE_ARRAY], -[AC_CACHE_CHECK(C99 struct flexible array support, - ac_cv_c99_flexible_array, - -# Initialize to unknown -ac_cv_c99_flexible_array=no - -AC_TRY_LINK([[ - #include - typedef struct { - int k; - char buffer [] ; - } MY_STRUCT ; - ]], - [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], - ac_cv_c99_flexible_array=yes, - ac_cv_c99_flexible_array=no - ))] -) # AC_C99_FLEXIBLE_ARRAY - - - - - -dnl @synopsis AC_C99_FUNC_LRINT -dnl -dnl Check whether C99's lrint function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([AC_C99_FUNC_LRINT], -[AC_CACHE_CHECK(for lrint, - ac_cv_c99_lrint, -[ -lrint_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) - -CFLAGS=$lrint_save_CFLAGS - -]) - -if test "$ac_cv_c99_lrint" = yes; then - AC_DEFINE(HAVE_LRINT, 1, - [Define if you have C99's lrint function.]) -fi -])# AC_C99_FUNC_LRINT -dnl @synopsis AC_C99_FUNC_LRINTF -dnl -dnl Check whether C99's lrintf function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([AC_C99_FUNC_LRINTF], -[AC_CACHE_CHECK(for lrintf, - ac_cv_c99_lrintf, -[ -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) -]) - -if test "$ac_cv_c99_lrintf" = yes; then - AC_DEFINE(HAVE_LRINTF, 1, - [Define if you have C99's lrintf function.]) -fi -])# AC_C99_FUNC_LRINTF - - - - -dnl @synopsis AC_C99_FUNC_LLRINT -dnl -dnl Check whether C99's llrint function is available. -dnl @version 1.1 Sep 30 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([AC_C99_FUNC_LLRINT], -[AC_CACHE_CHECK(for llrint, - ac_cv_c99_llrint, -[ -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -#include -], int64_t x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) -]) - -if test "$ac_cv_c99_llrint" = yes; then - AC_DEFINE(HAVE_LLRINT, 1, - [Define if you have C99's llrint function.]) -fi -])# AC_C99_FUNC_LLRINT - - - -dnl @synopsis AC_C_CLIP_MODE -dnl -dnl Determine the clipping mode when converting float to int. -dnl @version 1.0 May 17 2003 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - - - -dnl Find the clipping mode in the following way: -dnl 1) If we are not cross compiling test it. -dnl 2) IF we are cross compiling, assume that clipping isn't done correctly. - -AC_DEFUN([AC_C_CLIP_MODE], -[AC_CACHE_CHECK(processor clipping capabilities, - ac_cv_c_clip_type, - -# Initialize to unknown -ac_cv_c_clip_positive=unknown -ac_cv_c_clip_negative=unknown - -if test $ac_cv_c_clip_positive = unknown ; then - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = 1.0 * 0x7FFFFFFF ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != 127) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_positive=yes, - ac_cv_c_clip_positive=no, - ac_cv_c_clip_positive=unknown - ) - - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = -8.0 * 0x10000000 ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != -128) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_negative=yes, - ac_cv_c_clip_negative=no, - ac_cv_c_clip_negative=unknown - ) - fi - -if test $ac_cv_c_clip_positive = yes ; then - ac_cv_c_clip_positive=1 -else - ac_cv_c_clip_positive=0 - fi - -if test $ac_cv_c_clip_negative = yes ; then - ac_cv_c_clip_negative=1 -else - ac_cv_c_clip_negative=0 - fi - -[[ -case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in - "00") - ac_cv_c_clip_type="none" - ;; - "10") - ac_cv_c_clip_type="positive" - ;; - "01") - ac_cv_c_clip_type="negative" - ;; - "11") - ac_cv_c_clip_type="both" - ;; - esac - ]] - -) -] - -)# AC_C_CLIP_MODE - - -dnl @synopsis AC_ADD_CFLAGS -dnl -dnl Add the given option to CFLAGS, if it doesn't break the compiler - -AC_DEFUN([AC_ADD_CFLAGS], -[AC_MSG_CHECKING([if $CC accepts $1]) - ac_add_cflags__old_cflags="$CFLAGS" - CFLAGS="$CFLAGS $1" - AC_TRY_LINK([#include ], - [printf("Hello, World!\n"); return 0;], - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) - CFLAGS="$ac_add_cflags__old_cflags") -]) - - - -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - - -ifelse(dnl - - Do not edit or modify anything in this comment block. - The arch-tag line is a file identity tag for the GNU Arch - revision control system. - - arch-tag: bc38294d-bb5c-42ad-90b9-779def5eaab7 - -)dnl diff --git a/libs/libsndfile/autogen.sh b/libs/libsndfile/autogen.sh deleted file mode 100644 index 5047159fe4..0000000000 --- a/libs/libsndfile/autogen.sh +++ /dev/null @@ -1,179 +0,0 @@ -#!/bin/sh -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) - -package="libsndfile" - -ACLOCAL_FLAGS="-I M4" - -olddir=`pwd` -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -DIE=0 - -printf "checking for autogen ... " -result="yes" -(autogen --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have GNU autogen installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - result="no" - DIE=1 -} -echo $result - -printf "checking for autoconf ... " -result="yes" -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - result="no" - DIE=1 -} -echo $result - -VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/" -VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/" -VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//" - -# do we need automake? -if test -r Makefile.am; then - AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` - AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` - if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then - AM_NEEDED="" - fi - if test -z $AM_NEEDED; then - printf "checking for automake ... " - AUTOMAKE=automake - ACLOCAL=aclocal - if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then - echo "yes" - else - echo "no" - AUTOMAKE= - fi - else - printf "checking for automake $AM_NEEDED or later ... " - majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ` - minneeded=`echo $AM_NEEDED | $VERSIONMKMIN` - for am in automake-$AM_NEEDED automake$AM_NEEDED \ - automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do - ($am --version < /dev/null > /dev/null 2>&1) || continue - ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP` - maj=`echo $ver | $VERSIONMKMAJ` - min=`echo $ver | $VERSIONMKMIN` - if test $maj -eq $majneeded -a $min -ge $minneeded; then - AUTOMAKE=$am - echo $AUTOMAKE - break - fi - done - test -z $AUTOMAKE && echo "no" - printf "checking for aclocal $AM_NEEDED or later ... " - for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ - aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do - ($ac --version < /dev/null > /dev/null 2>&1) || continue - ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP` - maj=`echo $ver | $VERSIONMKMAJ` - min=`echo $ver | $VERSIONMKMIN` - if test $maj -eq $majneeded -a $min -ge $minneeded; then - ACLOCAL=$ac - echo $ACLOCAL - break - fi - done - test -z $ACLOCAL && echo "no" - fi - test -z $AUTOMAKE || test -z $ACLOCAL && { - echo - echo "You must have automake installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - exit 1 - } -fi - -printf "checking for libtool ... " -for LIBTOOLIZE in libtoolize glibtoolize nope; do - ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break -done -if test x$LIBTOOLIZE = xnope; then - echo "nope." - LIBTOOLIZE=libtoolize -else - echo $LIBTOOLIZE -fi -($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -printf "checking for pkg-config ... " -result="yes" -(pkg-config --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have pkg-config installed to compile $package." - echo "Download the appropriate package for your distribution." - result="no" - DIE=1 -} -echo $result - - -printf "checking for python ... " -result="yes" -(python --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have Python installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at http://python.org/" - result="no" - DIE=1 -} -echo $result - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test ! -d Cfg ; then - echo "Creating 'Cfg' directory." - mkdir Cfg -fi - -echo "Generating configuration files for $package, please wait ... " - -echo " $ACLOCAL $ACLOCAL_FLAGS" -$ACLOCAL $ACLOCAL_FLAGS || exit 1 -echo " $LIBTOOLIZE --automake --force" -$LIBTOOLIZE --automake --force || exit 1 -echo " autoheader" -autoheader || exit 1 -echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" -$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 -echo " autoconf" -autoconf || exit 1 - -cd $olddir - -fprecommit=.git/hooks/pre-commit -if test ! -f $fprecommit ; then - echo - echo "Installing git pre-commit hook for this project." - cat > $fprecommit << 'foobar' -#!/bin/sh -exec Scripts/git-pre-commit-hook -foobar - chmod u+x $fprecommit - echo - fi diff --git a/libs/libsndfile/binheader_readf_check.py b/libs/libsndfile/binheader_readf_check.py deleted file mode 100644 index 774abcd988..0000000000 --- a/libs/libsndfile/binheader_readf_check.py +++ /dev/null @@ -1,62 +0,0 @@ -g#!/usr/bin/python - -import re, string, sys - -def trim_function_and_params (section): - k = string.find (section, "(") + 1 - brackets = 1 - section_len = len (section) - while k < section_len: - if section [k] == '(': - brackets += 1 - elif section [k] == ')': - brackets -= 1 - if brackets < 1: - return section [:k+1] - k += 1 - print "Whoops!!!!" - sys.exit (1) - -def get_function_calls (filedata): - filedata = string.split (filedata, "psf_binheader_readf") - filedata = filedata [1:] - - func_calls = [] - for section in filedata: - section = "psf_binheader_readf" + section - func_calls.append (trim_function_and_params (section)) - - return func_calls - -def search_for_problems (filename): - filedata = open (filename, "r").read () - - if len (filedata) < 1: - print "Error : file '%s' contains no data." % filename - sys.exit (1) - - count = 0 - - calls = get_function_calls (filedata) - for call in calls: - if string.find (call, "sizeof") > 0: - print "Found : ", call - count += 1 - - if count == 0: - print "%-20s : No problems found." % filename - else: - print "\n%-20s : Found %d errors." % (filename, count) - sys.exit (1) - return - - -#------------------------------------------------------------------------------- - -if len (sys.argv) < 2: - print "Usage : %s " % sys.argv [0] - sys.exit (1) - -for file in sys.argv [1:]: - search_for_problems (file) - diff --git a/libs/libsndfile/configure.ac b/libs/libsndfile/configure.ac deleted file mode 100644 index 5893db2a66..0000000000 --- a/libs/libsndfile/configure.ac +++ /dev/null @@ -1,697 +0,0 @@ -# Copyright (C) 1999-2013 Erik de Castro Lopo . - -dnl Require autoconf version -AC_PREREQ(2.57) - -AC_INIT([libsndfile],[1.0.26pre5],[sndfile@mega-nerd.com], - [libsndfile],[http://www.mega-nerd.com/libsndfile/]) - -# Put config stuff in Cfg. -AC_CONFIG_AUX_DIR(Cfg) - -AC_CONFIG_SRCDIR([src/sndfile.c]) -AC_CANONICAL_TARGET([]) - -AC_CONFIG_MACRO_DIR([M4]) -AC_CONFIG_HEADERS([src/config.h]) - -CFLAGS="$CFLAGS $CONFIGURE_CFLAGS" -CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS" -LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS" - -AM_INIT_AUTOMAKE -AC_SUBST(ACLOCAL_AMFLAGS, "-I M4") -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AC_LANG([C]) - -AC_PROG_CC_STDC -AC_USE_SYSTEM_EXTENSIONS -AM_PROG_CC_C_O -AC_PROG_CXX - -MN_C_COMPILER_IS_CLANG -MN_GCC_REALLY_IS_GCC - -AC_PROG_SED - -# Do not check for F77. -define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl - -AM_PROG_LIBTOOL -LT_PROG_RC - -AC_PROG_INSTALL -AC_PROG_LN_S - -AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no) -AC_CHECK_PROG(HAVE_WINE, wine, yes, no) -AC_CHECK_PROG(HAVE_XCODE_SELECT, xcode-select, yes, no) - -#------------------------------------------------------------------------------------ -# Rules for library version information: -# -# 1. Start with version information of `0:0:0' for each libtool library. -# 2. Update the version information only immediately before a public release of -# your software. More frequent updates are unnecessary, and only guarantee -# that the current interface number gets larger faster. -# 3. If the library source code has changed at all since the last update, then -# increment revision (`c:r:a' becomes `c:r+1:a'). -# 4. If any interfaces have been added, removed, or changed since the last update, -# increment current, and set revision to 0. -# 5. If any interfaces have been added since the last public release, then increment -# age. -# 6. If any interfaces have been removed since the last public release, then set age -# to 0. - -CLEAN_VERSION=`echo $PACKAGE_VERSION | $SED "s/p.*//"` -VERSION_MINOR=`echo $CLEAN_VERSION | $SED "s/.*\.//"` - -SHARED_VERSION_INFO="1:$VERSION_MINOR:0" - -#------------------------------------------------------------------------------------ - -AC_HEADER_STDC - -AC_CHECK_HEADERS(endian.h) -AC_CHECK_HEADERS(byteswap.h) -AC_CHECK_HEADERS(locale.h) -AC_CHECK_HEADERS(sys/time.h) - -AC_HEADER_SYS_WAIT - -AC_CHECK_DECLS(S_IRGRP) -if test x$ac_cv_have_decl_S_IRGRP = xyes ; then - AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],1,[Set to 1 if S_IRGRP is defined.]) -else - AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],0) - fi - -AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST], - [test "$build_os:$target_os:$host_os:$HAVE_WINE" = "linux-gnu:mingw32msvc:mingw32msvc:yes"]) - -#==================================================================================== -# Couple of initializations here. Fill in real values later. - -SHLIB_VERSION_ARG="" - -#==================================================================================== -# Finished checking, handle options. - -AC_ARG_ENABLE(experimental, - AC_HELP_STRING([--enable-experimental], [enable experimental code])) - -EXPERIMENTAL_CODE=0 -if test x$enable_experimental = xyes ; then - EXPERIMENTAL_CODE=1 - fi -AC_DEFINE_UNQUOTED([ENABLE_EXPERIMENTAL_CODE],${EXPERIMENTAL_CODE}, [Set to 1 to enable experimental code.]) - -AC_ARG_ENABLE(werror, - AC_HELP_STRING([--enable-werror], [enable -Werror in all Makefiles])) - -AC_ARG_ENABLE(stack-smash-protection, - AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection])) - -AC_ARG_ENABLE(gcc-pipe, - AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option])) - -AC_ARG_ENABLE(gcc-opt, - AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations])) - -AC_ARG_ENABLE(cpu-clip, - AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper])) - -AC_ARG_ENABLE(bow-docs, - AC_HELP_STRING([--enable-bow-docs], [enable black-on-white html docs])) - -AC_ARG_ENABLE(sqlite, - AC_HELP_STRING([--disable-sqlite], [disable use of sqlite])) - -AC_ARG_ENABLE(alsa, - AC_HELP_STRING([--disable-alsa], [disable use of ALSA])) - -AC_ARG_ENABLE(external-libs, - AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis [[default=no]]])) - -AC_ARG_ENABLE(octave, - AC_HELP_STRING([--enable-octave], [disable building of GNU Octave module])) - -AC_ARG_ENABLE(test-coverage, - AC_HELP_STRING([--enable-test-coverage], [enable test coverage])) -AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes]) - -#==================================================================================== -# Check types and their sizes. - -AC_CHECK_SIZEOF(wchar_t,4) -AC_CHECK_SIZEOF(short,2) -AC_CHECK_SIZEOF(int,4) -AC_CHECK_SIZEOF(long,4) -AC_CHECK_SIZEOF(float,4) -AC_CHECK_SIZEOF(double,4) -AC_CHECK_SIZEOF(void*,8) -AC_CHECK_SIZEOF(size_t,4) -AC_CHECK_SIZEOF(int64_t,8) -AC_CHECK_SIZEOF(long long,8) - -#==================================================================================== -# Find an appropriate type for sf_count_t. -# On systems supporting files larger than 2 Gig, sf_count_t must be a 64 bit value. -# Unfortunately there is more than one way of ensuring this so need to do some -# pretty rigourous testing here. - -# Check for common 64 bit file offset types. -AC_CHECK_SIZEOF(off_t,1) -AC_CHECK_SIZEOF(loff_t,1) -AC_CHECK_SIZEOF(off64_t,1) - -if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then - echo - echo "Error : Cannot disable large file support because sizeof (off_t) == 8." - echo - exit 1 - fi - - -case "$host_os" in - mingw32msvc | mingw32) - TYPEOF_SF_COUNT_T="__int64" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - AC_DEFINE([__USE_MINGW_ANSI_STDIO],1,[Set to 1 to use C99 printf/snprintf in MinGW.]) - ;; - *) - SIZEOF_SF_COUNT_T=0 - if test "x$ac_cv_sizeof_off_t" = "x8" ; then - # If sizeof (off_t) is 8, no further checking is needed. - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - elif test "x$ac_cv_sizeof_loff_t" = "x8" ; then - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - elif test "x$ac_cv_sizeof_off64_t" = "x8" ; then - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - else - # Save the old sizeof (off_t) value and then unset it to see if it - # changes when Large File Support is enabled. - pre_largefile_sizeof_off_t=$ac_cv_sizeof_off_t - unset ac_cv_sizeof_off_t - - AC_SYS_LARGEFILE - - if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then - ac_cv_sys_largefile_CFLAGS="" - fi - if test "x$ac_cv_sys_largefile_LDFLAGS" = "xno" ; then - ac_cv_sys_largefile_LDFLAGS="" - fi - if test "x$ac_cv_sys_largefile_LIBS" = "xno" ; then - ac_cv_sys_largefile_LIBS="" - fi - - AC_CHECK_SIZEOF(off_t,1) - - if test "x$ac_cv_sizeof_off_t" = "x8" ; then - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - elif test "x$TYPEOF_SF_COUNT_T" = "xunknown" ; then - echo - echo "*** The configure process has determined that this system is capable" - echo "*** of Large File Support but has not been able to find a type which" - echo "*** is an unambiguous 64 bit file offset." - echo "*** Please contact the author to help resolve this problem." - echo - AC_MSG_ERROR([[Bad file offset type.]]) - fi - fi - ;; - esac - -if test $SIZEOF_SF_COUNT_T = 4 ; then - SF_COUNT_MAX="0x7FFFFFFF" - fi - -AC_DEFINE_UNQUOTED([TYPEOF_SF_COUNT_T],${TYPEOF_SF_COUNT_T}, [Set to long if unknown.]) -AC_SUBST(TYPEOF_SF_COUNT_T) - -AC_DEFINE_UNQUOTED([SIZEOF_SF_COUNT_T],${SIZEOF_SF_COUNT_T}, [Set to sizeof (long) if unknown.]) -AC_SUBST(SIZEOF_SF_COUNT_T) - -AC_DEFINE_UNQUOTED([SF_COUNT_MAX],${SF_COUNT_MAX}, [Set to maximum allowed value of sf_count_t type.]) -AC_SUBST(SF_COUNT_MAX) - -AC_CHECK_TYPES(ssize_t) -AC_CHECK_SIZEOF(ssize_t,4) - -#==================================================================================== -# Determine endian-ness of target processor. - -MN_C_FIND_ENDIAN - -AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian}, - [Target processor is big endian.]) -AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian}, - [Target processor is little endian.]) -AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian}, - [Target processor is big endian.]) - -#==================================================================================== -# Check for functions. - -AC_CHECK_FUNCS(malloc calloc realloc free) -AC_CHECK_FUNCS(open read write lseek lseek64) -AC_CHECK_FUNCS(fstat fstat64 ftruncate fsync) -AC_CHECK_FUNCS(snprintf vsnprintf) -AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r gettimeofday) -AC_CHECK_FUNCS(mmap getpagesize) -AC_CHECK_FUNCS(setlocale) -AC_CHECK_FUNCS(pipe waitpid) - -AC_CHECK_LIB([m],floor) -AC_CHECK_FUNCS(floor ceil fmod lround) - -MN_C99_FUNC_LRINT -MN_C99_FUNC_LRINTF - -#==================================================================================== -# Check for requirements for building plugins for other languages/enviroments. - -dnl Octave maths environment http://www.octave.org/ -if test x$cross_compiling = xno ; then - if test x$enable_octave = xno ; then - AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) - else - AC_OCTAVE_BUILD - fi -else - AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) - fi - -#==================================================================================== -# Check for Ogg, Vorbis and FLAC. - -HAVE_EXTERNAL_LIBS=0 -EXTERNAL_CFLAGS="" -EXTERNAL_LIBS="" - -# Check for pkg-config outside the if statement. -#PKG_PROG_PKG_CONFIG -#m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig)) - -#if test -n "$PKG_CONFIG" ; then -# if test x$enable_external_libs = xno ; then -# AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]]) -# else -# PKG_CHECK_MOD_VERSION([FLAC], [flac >= 1.2.1], [ac_cv_flac=yes], [ac_cv_flac=no]) - - # Make sure the FLAC_CFLAGS value is sane. -# FLAC_CFLAGS=`echo $FLAC_CFLAGS | $SED "s|include/FLAC|include|"` - -# PKG_CHECK_MOD_VERSION([OGG], [ogg >= 1.1.3], [ac_cv_ogg=yes], [ac_cv_ogg=no]) - -# if test x$enable_experimental = xyes ; then -# PKG_CHECK_MOD_VERSION([SPEEX], [speex >= 1.2], [ac_cv_speex=yes], [ac_cv_speex=no]) -# else -# SPEEX_CFLAGS="" -# SPEEX_LIBS="" -# fi - - # Vorbis versions earlier than 1.2.3 have bugs that cause the libsndfile - # test suite to fail on MIPS, PowerPC and others. - # See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899 -# PKG_CHECK_MOD_VERSION([VORBIS], [vorbis >= 1.2.3], [ac_cv_vorbis=yes], [ac_cv_vorbis=no]) -# PKG_CHECK_MOD_VERSION([VORBISENC], [vorbisenc >= 1.2.3], [ac_cv_vorbisenc=yes], [ac_cv_vorbisenc=no]) -# enable_external_libs=yes -# fi - -# if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then -# HAVE_EXTERNAL_LIBS=1 -# enable_external_libs=yes - -# EXTERNAL_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS $SPEEX_CFLAGS" -# EXTERNAL_LIBS="$FLAC_LIBS $OGG_LIBS $VORBIS_LIBS $VORBISENC_LIBS $SPEEX_LIBS " -# else -# echo -# AC_MSG_WARN([[*** One or more of the external libraries (ie libflac, libogg and]]) -# AC_MSG_WARN([[*** libvorbis) is either missing (possibly only the development]]) -# AC_MSG_WARN([[*** headers) or is of an unsupported version.]]) -# AC_MSG_WARN([[***]]) -# AC_MSG_WARN([[*** Unfortunately, for ease of maintenance, the external libs]]) -# AC_MSG_WARN([[*** are an all or nothing affair.]]) -# echo -# enable_external_libs=no -# fi -# fi - -AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_LIBS], $HAVE_EXTERNAL_LIBS, [Will be set to 1 if flac, ogg and vorbis are available.]) - -#==================================================================================== -# Check for libsqlite3 (only used in regtest). - -ac_cv_sqlite3=no -#if test x$enable_sqlite != xno ; then -# PKG_CHECK_MOD_VERSION([SQLITE3], [sqlite3 >= 3.2], [ac_cv_sqlite3=yes], [ac_cv_sqlite3=no]) -# fi - -if test x$ac_cv_sqlite3 = "xyes" ; then - HAVE_SQLITE3=1 -else - HAVE_SQLITE3=0 - fi - -AC_DEFINE_UNQUOTED([HAVE_SQLITE3],$HAVE_SQLITE3,[Set to 1 if you have libsqlite3.]) - -#==================================================================================== -# Determine if the processor can do clipping on float to int conversions. - -if test x$enable_cpu_clip != "xno" ; then - MN_C_CLIP_MODE -else - echo "checking processor clipping capabilities... disabled" - ac_cv_c_clip_positive=0 - ac_cv_c_clip_negative=0 - fi - -AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive}, - [Target processor clips on positive float to int conversion.]) -AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative}, - [Target processor clips on negative float to int conversion.]) - -#==================================================================================== -# Target OS specific stuff. - -OS_SPECIFIC_CFLAGS="" -OS_SPECIFIC_LINKS="" -os_is_win32=0 -use_windows_api=0 -osx_darwin_version=0 - -case "$host_os" in - darwin* | rhapsody*) - osx_darwin_version=$(echo "$host_os" | sed 's/\..*//;s/darwin//g') - if test x$HAVE_XCODE_SELECT = xyes ; then - developer_path=`xcode-select --print-path` - else - developer_path="/Developer" - fi - OS_SPECIFIC_CFLAGS="-I${developer_path}/Headers/FlatCarbon" - OS_SPECIFIC_LINKS="-framework CoreAudio -framework AudioToolbox -framework CoreFoundation" - ;; - mingw*) - os_is_win32=1 - use_windows_api=1 - OS_SPECIFIC_LINKS="-lwinmm" - ;; - esac - -AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32]) -AC_DEFINE_UNQUOTED(USE_WINDOWS_API, ${use_windows_api}, [Set to 1 to use the native windows API]) -AC_DEFINE_UNQUOTED(OSX_DARWIN_VERSION, ${osx_darwin_version}, [The darwin version, no-zero is valid]) -AM_CONDITIONAL(USE_WIN_VERSION_FILE, test ${use_windows_api} -eq 1) - -#==================================================================================== -# Check for ALSA. - -ALSA_LIBS="" - -if test x$enable_alsa != xno ; then - AC_CHECK_HEADERS(alsa/asoundlib.h) - if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then - ALSA_LIBS="-lasound" - enable_alsa=yes - fi - fi - -#==================================================================================== -# Check for OpenBSD's sndio. - -SNDIO_LIBS="" -AC_CHECK_HEADERS(sndio.h) -if test x$ac_cv_header_sndio_h = xyes ; then - SNDIO_LIBS="-lsndio" - fi - -#==================================================================================== -# Test for sanity when cross-compiling. - -if test $ac_cv_sizeof_short != 2 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (short) != 2. ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test $ac_cv_sizeof_int != 4 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (int) != 4 ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test $ac_cv_sizeof_float != 4 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (float) != 4. ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test $ac_cv_sizeof_double != 8 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (double) != 8. ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test x"$ac_cv_prog_HAVE_AUTOGEN" = "xno" ; then - AC_MSG_WARN([[Touching files in directory tests/.]]) - touch tests/*.c tests/*.h - fi - -#==================================================================================== -# Settings for the HTML documentation. - -if test x$enable_bow_docs = "xyes" ; then - HTML_BGCOLOUR="white" - HTML_FGCOLOUR="black" -else - HTML_BGCOLOUR="black" - HTML_FGCOLOUR="white" - fi - -#==================================================================================== -# Now use the information from the checking stage. - -win32_target_dll=0 -COMPILER_IS_GCC=0 - -if test x$ac_cv_c_compiler_gnu = xyes ; then - MN_ADD_CFLAGS(-std=gnu99) - - MN_GCC_VERSION - - if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then - AC_MSG_WARN([****************************************************************]) - AC_MSG_WARN([** GCC version 4.2 warns about the inline keyword for no good **]) - AC_MSG_WARN([** reason but the maintainers do not see it as a bug. **]) - AC_MSG_WARN([** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 **]) - AC_MSG_WARN([** Using -fgnu-inline to avoid this stupidity. **]) - AC_MSG_WARN([****************************************************************]) - MN_ADD_CFLAGS([-fgnu89-inline]) - fi - - CFLAGS="$CFLAGS -Wall" - CXXFLAGS="$CXXFLAGS -Wall" - - MN_ADD_CFLAGS([-Wextra]) - - AC_LANG_PUSH([C++]) - MN_ADD_CXXFLAGS([-Wextra]) - AC_LANG_POP([C++]) - - MN_ADD_CFLAGS([-Wdeclaration-after-statement]) - MN_ADD_CFLAGS([-Wpointer-arith]) - MN_ADD_CFLAGS([-funsigned-char]) - - MN_ADD_CFLAGS([-D_FORTIFY_SOURCE=2]) - - if test x$enable_stack_smash_protection = "xyes" ; then - XIPH_GCC_STACK_PROTECTOR - XIPH_GXX_STACK_PROTECTOR - fi - - if test x$enable_test_coverage = "xyes" ; then - # MN_ADD_CFLAGS([-ftest-coverage]) - MN_ADD_CFLAGS([-coverage]) - fi - - CFLAGS="$CFLAGS -Wcast-align -Wcast-qual -Wshadow -Wbad-function-cast -Wwrite-strings -Wundef -Wuninitialized -Winit-self -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Waggregate-return" - # -Winline -Wconversion -Wunreachable-code" - CXXFLAGS="$CXXFLAGS -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo -Wundef -Wuninitialized -Winit-self" - - if test "x$enable_gcc_opt" = "xno" ; then - temp_CFLAGS=`echo $CFLAGS | $SED "s/O2/O0/"` - CFLAGS=$temp_CFLAGS - AC_MSG_WARN([[*** Compiler optimisations switched off. ***]]) - fi - - # OS specific tweaks. - case "$host_os" in - darwin* | rhapsody*) - # Disable -Wall, -pedantic and -Wshadow for Apple Darwin/Rhapsody. - # System headers on these systems are broken. - temp_CFLAGS=`echo $CFLAGS | $SED "s/-Wall -pedantic//" | $SED "s/-Wshadow//" | $SED "s/-Waggregate-return//"` - CFLAGS=$temp_CFLAGS - SHLIB_VERSION_ARG="-Wl,-exported_symbols_list -Wl,\$(builddir)/Symbols.darwin" - ;; - linux*|kfreebsd*-gnu*|gnu*) - SHLIB_VERSION_ARG="-Wl,--version-script=\$(builddir)/Symbols.gnu-binutils" - ;; - mingw*) - # Linker flag '-Wl,--out-implib' does not work with mingw cross compiler - # so we don't use it here. - SHLIB_VERSION_ARG="-Wl,\$(builddir)/libsndfile-1.def" - win32_target_dll=1 - if test x"$enable_shared" = xno ; then - win32_target_dll=0 - fi - ;; - os2*) - SHLIB_VERSION_ARG="-Wl,-export-symbols \$(builddir)/Symbols.os2" - ;; - *) - ;; - esac - if test x$enable_gcc_pipe != "xno" ; then - CFLAGS="$CFLAGS -pipe" - fi - - COMPILER_IS_GCC=1 - fi - -if test x$enable_werror = "xyes" ; then - MN_ADD_CFLAGS([-Werror]) - - AC_LANG_PUSH([C++]) - MN_ADD_CXXFLAGS([-Werror]) - AC_LANG_POP([C++]) - fi - - -AC_DEFINE_UNQUOTED([WIN32_TARGET_DLL], ${win32_target_dll}, [Set to 1 if windows DLL is being built.]) -AC_DEFINE_UNQUOTED([COMPILER_IS_GCC], ${COMPILER_IS_GCC}, [Set to 1 if the compile is GNU GCC.]) - -CFLAGS="$CFLAGS $OS_SPECIFIC_CFLAGS" - -if test x"$CFLAGS" = x ; then - echo "Error in configure script. CFLAGS has been screwed up." - exit - fi - -HOST_TRIPLET="${host_cpu}-${host_vendor}-${host_os}" - -AC_DEFINE_UNQUOTED([HOST_TRIPLET], "${HOST_TRIPLET}", [The host triplet of the compiled binary.]) - -if test "$HOST_TRIPLET" = "x86_64-w64-mingw32" ; then - OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS" - fi - -WIN_RC_VERSION=`echo $PACKAGE_VERSION | $SED -e "s/p.*//" -e "s/\./,/g"` - - -if test "$enable_static" = no ; then - SRC_BINDIR=src/.libs/ - TEST_BINDIR=tests/.libs/ -else - SRC_BINDIR=src/ - TEST_BINDIR=tests/ - fi - -#------------------------------------------------------------------------------- - -AC_SUBST(HOST_TRIPLET) - -AC_SUBST(HTML_BGCOLOUR) -AC_SUBST(HTML_FGCOLOUR) - -AC_SUBST(SHLIB_VERSION_ARG) -AC_SUBST(SHARED_VERSION_INFO) -AC_SUBST(CLEAN_VERSION) -AC_SUBST(WIN_RC_VERSION) - -AC_SUBST(OS_SPECIFIC_CFLAGS) -AC_SUBST(OS_SPECIFIC_LINKS) -AC_SUBST(ALSA_LIBS) -AC_SUBST(SNDIO_LIBS) - -AC_SUBST(EXTERNAL_CFLAGS) -AC_SUBST(EXTERNAL_LIBS) -AC_SUBST(SRC_BINDIR) -AC_SUBST(TEST_BINDIR) - -dnl The following line causes the libtool distributed with the source -dnl to be replaced if the build system has a more recent version. -AC_SUBST(LIBTOOL_DEPS) - -AC_CONFIG_FILES([ \ - src/Makefile man/Makefile examples/Makefile tests/Makefile regtest/Makefile \ - M4/Makefile Win32/Makefile Octave/Makefile programs/Makefile \ - Makefile \ - src/version-metadata.rc tests/test_wrapper.sh tests/pedantic-header-test.sh \ - doc/libsndfile.css Scripts/build-test-tarball.mk libsndfile.spec sndfile.pc \ - src/sndfile.h \ - echo-install-dirs - ]) -AC_OUTPUT - -# Make sure these are executable. -chmod u+x tests/test_wrapper.sh build-test-tarball.mk echo-install-dirs - -#==================================================================================== - -AC_MSG_RESULT([ --=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- - - Configuration summary : - - libsndfile version : .................. ${VERSION} - - Host CPU : ............................ ${host_cpu} - Host Vendor : ......................... ${host_vendor} - Host OS : ............................. ${host_os} - - Experimental code : ................... ${enable_experimental:-no} - Using ALSA in example programs : ...... ${enable_alsa:-no} - External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no} -]) - -if test -z "$PKG_CONFIG" ; then - echo " *****************************************************************" - echo " *** The pkg-config program is missing. ***" - echo " *** External FLAC/Ogg/Vorbis libs cannot be found without it. ***" - echo " *** http://pkg-config.freedesktop.org/wiki/ ***" - echo " *****************************************************************" - echo - fi - -echo " Tools :" -echo -echo " Compiler is Clang : ................... ${mn_cv_c_compiler_clang}" -echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}" - -if test x$ac_cv_c_compiler_gnu = xyes ; then - echo " GCC version : ......................... ${GCC_VERSION}" - if test $GCC_MAJOR_VERSION -lt 3 ; then - echo "\n" - echo " ** This compiler version allows applications to write" - echo " ** to static strings within the library." - echo " ** Compile with GCC version 3.X or above to avoid this problem." - fi - fi - -./echo-install-dirs - -# Remove symlink created by Scripts/android-configure.sh. -test -h gdbclient && rm -f gdbclient - -(cd src && make genfiles) diff --git a/libs/libsndfile/configure.gnu b/libs/libsndfile/configure.gnu deleted file mode 100644 index 80e107f2be..0000000000 --- a/libs/libsndfile/configure.gnu +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -srcpath=$(dirname $0 2>/dev/null ) || srcpath="." -$srcpath/configure "$@" --disable-sqlite --disable-shared --with-pic --disable-octave --disable-external-libs - diff --git a/libs/libsndfile/doc/FAQ.html b/libs/libsndfile/doc/FAQ.html deleted file mode 100644 index 4465b77bd5..0000000000 --- a/libs/libsndfile/doc/FAQ.html +++ /dev/null @@ -1,851 +0,0 @@ - - - - - - libsndfile : Frequently Asked Questions. - - - - - - - - - - -

libsndfile : Frequently Asked Questions.

-

-Q1 : Do you plan to support XYZ codec in libsndfile?
-Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field - but version 1 does not. Why?
-Q3 : Compiling is really slow on MacOS X. Why?
-Q4 : When trying to compile libsndfile on Solaris I get a "bad - substitution" error during linking. What can I do to fix this?
-Q5 : Why doesn't libsndfile do interleaving/de-interleaving?
-Q6 : What's the best format for storing temporary files?
-Q7 : On Linux/Unix/MacOS X, what's the best way of detecting the - presence of libsndfile?
-Q8 : I have libsndfile installed and now I want to use it. I - just want a simple Makefile! What do I do?
-Q9 : How about adding the ability to write/read sound files to/from - memory buffers?
-Q10 : Reading a 16 bit PCM file as normalised floats and then - writing them back changes some sample values. Why?
-Q11 : I'm having problems with u-law encoded WAV files generated by - libsndfile in Winamp. Why?
-Q12 : I'm looking at sf_read*. What are items? What are frames?
-Q13 : Why can't libsndfile open this Sound Designer II (SD2) - file?
-Q14 : I'd like to statically link libsndfile to my closed source - application. Can I buy a license so that this is possible?
-Q15 : My program is crashing during a call to a function in libsndfile. - Is this a bug in libsndfile?
-Q16 : Will you accept a fix for compiling libsndfile with compiler X? -
-Q17 : Can libsndfile read/write files from/to UNIX pipes? -
-Q18 : Is it possible to build a Universal Binary on Mac OS X? -
-Q19 : I have project files for Visual Studio / XCode / Whatever. Why - don't you distribute them with libsndfile? -
-Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source - projects support it! -
-Q21 : How do I use libsndfile in a closed source or commercial program - and comply with the license? -
-Q22 : What versions of windows does libsndfile work on? -
-Q23 : I'm cross compiling libsndfile for another platform. How can I - run the test suite? -
-


- - - -


Q1 : Do you plan to support XYZ codec in libsndfile?

-

-If source code for XYZ codec is available under a suitable license (LGPL, BSD, -MIT etc) then yes, I'd like to add it. -

-

-If suitable documentation is available on how to decode and encode the format -then maybe, depending on how much work is involved. -

-

-If XYZ is some proprietary codec where no source code or documentation is -available then no. -

-

-So if you want support for XYZ codec, first find existing source code or -documentation. -If you can't find either then the answer is no. -

- - -


Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field - but version 1 does not. Why?

-

- This was dropped for a number of reasons: -

-
    -
  • pcmbitwidth makes little sense on compressed or floating point formats -
  • with the new API you really don't need to know it -
-

-As documented - here -there is now a well defined behaviour which ensures that no matter what the -bit width of the source file, the scaling always does something sensible. -This makes it safe to read 8, 16, 24 and 32 bit PCM files using sf_read_short() -and always have the optimal behaviour. -

- - - -


Q3 : Compiling is really slow on MacOS X. Why?

-

-When you configure and compile libsndfile, it uses the /bin/sh shell for a number -of tasks (ie configure script and libtool). -Older versions of OS X (10.2?) shipped a really crappy Bourne shell as /bin/sh -which resulted in really slow compiles. -Newer version of OS X ship GNU Bash as /bin/sh and this answer doesn't apply in that -case. -

-

-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. -

-

-When I did this on my iBook running MacOS X, compile times dropped from 13 minutes -to 3 minutes. -

- - - -


Q4 : When trying to compile libsndfile on Solaris I get a "bad - substitution" error on linking. Why?

-

-It seems that the Solaris Bourne shell disagrees with GNU libtool. -

-

-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. -

- - - -


Q5 : Why doesn't libsndfile do interleaving/de-interleaving?

-

-This problem is bigger than it may seem at first. -

-

-For a stereo file, it is a pretty safe bet that a simple interleaving/de-interleaving -could satisfy most users. -However, for files with more than 2 channels this is unlikely to be the case. -If the user has a 4 channel file and want to play that file on a stereo output -sound card they either want the first 2 channels or they want some mixed combination -of the 4 channels. -

-

-When you add more channels, the combinations grow exponentially and it becomes -increasingly difficult to cover even a sensible subset of the possible combinations. -On top of that, coding any one style of interleaver/de-interleaver is trivial, while -coding one that can cover all combinations is far from trivial. -This means that this feature will not be added any time soon. -

- - - -


Q6 : What's the best format for storing temporary files?

- -

-When you want to store temporary data there are a number of requirements; -

-
    -
  • A simple, easy to parse header. -
  • The format must provide the fastest possible read and write rates (ie - avoid conversions and encoding/decoding). -
  • The file format must be reasonably common and playable by most players. -
  • Able to store data in either endian-ness. -
-

-The format which best meets these requirements is AU, which allows data to be -stored in any one of short, int, float and double (among others) formats. -

-

-For instance, if an application uses float data internally, its temporary files -should use a format of (SF_ENDIAN_CPU | SF_FORMAT_AU | SF_FORMAT_FLOAT) which -will store big endian float data in big endian CPUs and little endian float data -on little endian CPUs. -Reading and writing this format will not require any conversions or byte swapping -regardless of the host CPU. -

- - - - -


Q7 : On Linux/Unix/MaxOS X, what's the best way of detecting the presence - of libsndfile using autoconf?

- -

-libsndfile uses the pkg-config (man pkg-config) method of registering itself with the -host system. -The best way of detecting its presence is using something like this in configure.ac -(or configure.in): -

-
-        PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2, ac_cv_sndfile=1, ac_cv_sndfile=0)
-
-        AC_DEFINE_UNQUOTED([HAVE_SNDFILE],${ac_cv_sndfile},
-			[Set to 1 if you have libsndfile.])
-
-        AC_SUBST(SNDFILE_CFLAGS)
-        AC_SUBST(SNDFILE_LIBS)
-
-

-This will automatically set the SNDFILE_CFLAGS and SNDFILE_LIBS -variables which can be used in Makefile.am like this: -

-
-        SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
-        SNDFILE_LIBS = @SNDFILE_LIBS@
-
-

-If you install libsndfile from source, you will probably need to set the -PKG_CONFIG_PATH environment variable as suggested at the end of the -libsndfile configure process. For instance on my system I get this: -

-
-        -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
-
-          Configuration summary :
-
-            Version : ..................... 1.0.5
-            Experimental code : ........... no
-
-          Tools :
-
-            Compiler is GCC : ............. yes
-            GCC major version : ........... 3
-
-          Installation directories :
-
-            Library directory : ........... /usr/local/lib
-            Program directory : ........... /usr/local/bin
-            Pkgconfig directory : ......... /usr/local/lib/pkgconfig
-
-        Compiling some other packages against libsndfile may require
-        the addition of "/usr/local/lib/pkgconfig" to the
-        PKG_CONFIG_PATH environment variable.
-
- - - - -


Q8 : I have libsndfile installed and now I want to use it. I just want - a simple Makefile! What do I do?

- -

-The pkg-config program makes finding the correct compiler flag values and -library location far easier. -During the installation of libsndfile, a file named sndfile.pc is installed -in the directory ${libdir}/pkgconfig (ie if libsndfile is installed in -/usr/local/lib, sndfile.pc will be installed in -/usr/local/lib/pkgconfig/). -

-

-In order for pkg-config to find sndfile.pc it may be necessary to point the -environment variable PKG_CONFIG_PATH in the right direction. -

-
-        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-
- -

-Then, to compile a C file into an object file, the command would be: -

-
-        gcc `pkg-config --cflags sndfile` -c somefile.c
-
-

-and to link a number of objects into an executable that links against libsndfile, -the command would be: -

-
-        gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
-
- - - - -


Q9 : How about adding the ability to write/read sound files to/from - memory buffers?

- -

-This has been added for version 1.0.13. -

- - - - -


Q10 : Reading a 16 bit PCM file as normalised floats and then - writing them back changes some sample values. Why?

- -

-This is caused by the fact that the conversion from 16 bit short to float is -done by dividing by 32768 (0x8000 in hexadecimal) while the conversion from -float to 16 bit short is done by multiplying by 32767 (0x7FFF in hex). -So for instance, a value in a 16 bit PCM file of 20000 gets read as a floating -point number of 0.6103515625 (20000.0 / 0x8000). -Converting that back to a 16 bit short results in a value of 19999.3896484375 -(0.6103515625 * 0x7FFF) which then gets rounded down to 19999. -

-

-You will notice that for this particular case, the error is 1 in 20000 or -0.005%. -Interestingly, for values of less than 16369, dividing by 0x8000 followed -by multiplying by 0x7FFF and then rounding the result, gives back the -original value. -It turns out that as long as the host operating system supplies the 1999 ISO -C Standard functions lrintf and lrint (or a replacement has -been supplied) then the maximum possible error is 1 in 16369 or about 0.006%. -

-

-Regardless of the size of the error, the reason why this is done is rather -subtle. -

-

-In a file containing 16 bit PCM samples, the values are restricted to the range -[-32768, 32767] while we want floating point values in the range [-1.0, 1.0]. -The only way to do this conversion is to do a floating point division by a value -of 0x8000. -Converting the other way, the only way to ensure that floating point values in -the range [-1.0, 1.0] are within the valid range allowed by a 16 bit short is -to multiply by 0x7FFF. -

-

-Some people would say that this is a severe short-coming of libsndfile. -I would counter that anybody who is constantly converting back and forth -between 16 bit shorts and normalised floats is going to suffer other losses -in audio quality that they should also be concerned about. -

-

-Since this problem only occurs when converting between integer data on disk and -normalized floats in the application, it can be avoided by using something -other than normalized floats in the application. -Alternatives to normalized floats are the short and int data -types (ie using sf_read_short or sf_read_int) or using un-normalized floats -(see - - SFC_SET_NORM_FLOAT). -

-

-Another way to deal with this problem is to consider 16 bit short data as a -final destination format only, not as an intermediate storage format. -All intermediate data (ie which is going to be processed further) should be -stored in floating point format which is supported by all of the most common -file formats. -If floating point files are considered too large (2 times the size of a 16 bit -PCM file), it would also be possible to use 24 bit PCM as an intermediate -storage format (and which is also supported by most common file types). -

- - - - -


Q11 : I'm having problems with u-law encoded WAV files generated by - libsndfile in Winamp. Why? -

- -

-This is actually a Winamp problem. -The official Microsoft spec suggests that the 'fmt ' chunk should be 18 bytes. -Unfortunately at least one of Microsoft's own applications (Sound Recorder on -Win98 I believe) did not accept 18 bytes 'fmt ' chunks. -

-

-Michael Lee did some experimenting and found that: -

-
-    I have checked that Windows Media Player 9, QuickTime Player 6.4,
-    RealOne Player 2.0 and GoldWave 5.06 can all play u-law files with
-    16-byte or 18-byte 'fmt ' chunk. Only Winamp (2.91) and foobar2000
-    are unable to play u-law files with 16-byte 'fmt ' chunk.
-
- -

-Even this is a very small sampling of all the players out there. -For that reason it is probably not a good idea to change this now because there -is the risk of breaking something that currently works. -

- - - - -


Q12 : I'm looking at sf_read*. What are items? What are frames? -

- -

-An item is a single sample of the data type you are reading; ie a -single short value for sf_read_short or a single float -for sf_read_float. -

- -

-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. -

- -

-Here are two simple, correct examples, both of which are assumed to be working -on a stereo file, first using items: -

- -
-        #define CHANNELS 2
-        short data [CHANNELS * 100] ;
-        sf_count items_read = sf_read_short (file, data, 200) ;
-        assert (items_read == 200) ;
-
- -

-and now readng the exact same amount of data using frames: -

- -
-        #define CHANNELS 2
-        short data [CHANNELS * 100] ;
-        sf_count frames_read = sf_readf_short (file, data, 100) ;
-        assert (frames_read == 100) ;
-
- - - - -


Q13 : Why can't libsndfile open this Sound Designer II (SD2) file? -

- -

-This is somewhat complicated. -First some background. -

- -

-SD2 files are native to the Apple Macintosh platform and use features of -the Mac filesystem (file resource forks) to store the file's sample rate, -number of channels, sample width and more. -When you look at a file and its resource fork on Mac OS X it looks like -this: -

- -
-        -rw-r--r--  1 erikd erikd   46512 Oct 18 22:57 file.sd2
-        -rw-r--r--  1 erikd erikd     538 Oct 18 22:57 file.sd2/rsrc
-
- -

-Notice how the file itself looks like a directory containing a single file -named rsrc. -When libsndfile is compiled for MacOS X, it should open (for write and read) -SD2 file with resource forks like this without any problems. -It will also handle files with the resource fork in a separate file as -described below. -

- -

-When SD2 files are moved to other platforms, the resource fork of the file -can sometimes be dropped altogether. -All that remains is the raw audio data and no information about the number -of channels, sample rate or bit width which makes it a little difficult for -libsndfile to open the file. -

- -

-However, it is possible to safely move an SD2 file to a Linux or Windows -machine. -For instance, when an SD2 file is copied from inside MacOS X to a windows -shared directory or a Samba share (ie Linux), MacOS X is clever enough to -store the resource fork of the file in a separate hidden file in the -same directory like this: -

-
-        -rw-r--r--  1 erikd erikd     538 Oct 18 22:57 ._file.sd2
-        -rw-r--r--  1 erikd erikd   46512 Oct 18 22:57 file.sd2
-
- -

-Regardless of what platform it is running on, when libsndfile is asked to -open a file named "foo" and it can't recognize the file type from -the data in the file, it will attempt to open the resource fork and if -that fails, it then tries to open a file named "._foo" to see if -the file has a valid resource fork. -This is the same regardless of whether the file is being opened for read -or write. -

- -

-In short, libsndfile should open SD2 files with a valid resource fork on -all of the platforms that libsndfile supports. -If a file has lost its resource fork, the only option is the open the file -using the SF_FORMAT_RAW option and guessing its sample rate, channel count -and bit width. -

- -

-Occasionally, when SD2 files are moved to other systems, the file is - BinHexed -which wraps the resource fork and the data fork together. -For these files, it would be possible to write a BinHex parser but -there is not a lot to gain considering how rare these BinHexed SD2 -files are. -

- - - -


Q14 : I'd like to statically link libsndfile to my closed source - application. Can I buy a license so that this is possible? -

- -

-Unfortunately no. -libsndfile contains code written by other people who have agreed that their -code be used under the GNU LGPL but no more. -Even if they were to agree, there would be significant difficulties in -dividing up the payments fairly. -

- -

-The only way you can legally use libsndfile as a statically linked -library is if your application is released under the GNU GPL or LGPL. -

- - - -


Q15 : My program is crashing during a call to a function in libsndfile. - Is this a bug in libsndfile? -

- -

-libsndfile is being used by large numbers of people all over the world -without any problems like this. That means that it is much more likely -that your code has a bug than libsndfile. However, it is still possible -that there is a bug in libsndfile. -

-

-To figure out whether it is your code or libsndfile you should do the -following: -

-
    -
  • Make sure you are compiling your code with warnings switched on and - that you fix as many warnings as possible. - With the GNU compiler (gcc) I would recommend at least - -W -Wall -Werror which will force you to fix all warnings - before you can run the code. -
  • Try using a memory debugger. - Valgrind on x86 Linux is excellent. - Purify also - has a good reputation. -
  • If the code is clean after the above two steps and you still get - a crash in libsndfile, then send me a small snippet of code (no - more than 30-40 lines) which includes the call to sf_open() and - also shows how all variables passed to/returned from sf_open() - are defined. -
- - - -


Q16 : Will you accept a fix for compiling libsndfile with compiler X? -

- -

-If compiler X is a C++ compiler then no. -C and C++ are different enough to make writing code that compiles as valid C -and valid C++ too difficult. -I would rather spend my time fixing bugs and adding features. -

- -

-If compiler X is a C compiler then I will do what I can as long as that does -not hamper the correctness, portability and maintainability of the existing -code. -It should be noted however that libsndfile uses features specified by the 1999 -ISO C Standard. -This can make compiling libsndfile with some older compilers difficult. -

- - - -


Q17 : Can libsndfile read/write files from/to UNIX pipes? -

- -

-Yes, libsndfile can read files from pipes. -Unfortunately, the write case is much more complicated. -

- -

-File formats like AIFF and WAV have information at the start of the file (the -file header) which states the length of the file, the number of sample frames -etc. -This information must be filled in correctly when the file header is written, -but this information is not reliably known until the file is closed. -This means that libsndfile cannot write AIFF, WAV and many other file types -to a pipe. -

- -

-However, there is at least one file format (AU) which is specifically designed -to be written to a pipe. -Like AIFF and WAV, AU has a header with a sample frames field, but it is -specifically allowable to set that frames field to 0x7FFFFFFF if the file -length is not known when the header is written. -The AU file format can also hold data in many of the standard formats (ie -SF_FORMAT_PCM_16, SF_FORMAT_PCM_24, SF_FORMAT_FLOAT etc) as well as allowing -data in both big and little endian format. -

- -

-See also FAQ Q6. -

- - - -


Q18 : Is it possible to build a Universal Binary on Mac OS X? -

- -

-Yes, but you must do two separate configure/build/test runs; one on PowerPC -and one on Intel. -It is then possible to merge the binaries into a single universal binary using -one of the programs in the Apple tool chain. -

- -

-It is not possible to build a working universal binary via a single -compile/build run on a single CPU. -

- -

-The problem is that the libsndfile build process detects features of the CPU its -being built for during the configure process and when building a universal binary, -configure is only run once and that data is then used for both CPUs. -That configure data will be wrong for one of those CPUs. -You will still be able to compile libsndfile, and the test suite will pass on -the machine you compiled it on. -However, if you take the universal binary test suite programs compiled on one -CPU and run them on the other, the test suite will fail. -

- -

-Part of the problem is the 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. -

- -

-Endian issues are not the only reason why the cross compiled binary will fail. -The configure script also detects other CPU specific idiosyncrasies to provide -more optimized code. -

- -

-Finally, the real show stopper problem with universal binaries is the problem -with the test suite. -libsndfile contains a huge, comprehensive test suite. -When you compile a universal binary and run the test suite, you only test the -native compile. -The cross compiled binary (the one with the much higher chance of having -problems) cannot be tested. -

- -

-Now, if you have read this far you're probably thinking there must be a way -to fix this and there probably is. -The problem is that its a hell of a lot of work and would require significant -changes to the configure process, the internal code and the test suite. -In addition, these changes must not break compilation on any of the platforms -libsndfile is currently working on. -

- - - - -


Q19 : I have project files for Visual Studio / XCode / Whatever. Why - don't you distribute them with libsndfile? -

- -

-There's a very good reason for this. -I will only distribute things that I actually have an ability to test and -maintain. -Project files for a bunch of different compilers and Integrated Development -Environments are simply too difficult to maintain. -

- -

-The problem is that every time I add a new file to libsndfile or rename an -existing file I would have to modify all the project files and then test that -libsndfile still built with all the different compilers. -

- -

-Maintaining these project files is also rather difficult if I don't have access -to the required compiler/IDE. -If I just edit the project files without testing them I will almost certainly -get it wrong. -If I release a version of libsndfile with broken project files, I'll get a bunch -of emails from people complaining about it not building and have no way of -fixing or even testing it. -

- -

-I currently release sources that I personally test on Win32, Linux and -MacOS X (PowerPC) using the compiler I trust (GNU GCC). -Supporting one compiler on three (actually much more because GCC is available -almost everywhere) platforms is doable without too much pain. -I also release binaries for Win32 with instructions on how to use those -binaries with Visual Studio. -As a guy who is mainly interested in Linux, I'm not to keen to jump through -a bunch of hoops to support compilers and operating systems I don't use. -

- -

-So, I hear you want to volunteer to maintain the project files for Some Crappy -Compiler 2007? -Well sorry, that won't work either. -I have had numerous people over the years offer to maintaining the project -files for Microsoft's Visual Studio. -Every single time that happened, they maintained it for a release or two and -then disappeared off the face of the earth. -Hence, I'm not willing to enter into an arrangement like that again. -

- - - -


Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source - projects support it! -

- -

-MP3 is not supported for one very good reason; doing so requires the payment -of licensing fees. -As can be seen from - - mp3licensing.com -the required royalty payments are not cheap. -

- -

-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. -

- -

-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 under legal threat. -

- -

-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. -

- - - - -


Q21 : How do I use libsndfile in a closed source or commercial program - and comply with the license? -

- -

-Here is a checklist of things you need to do to make sure your use of libsndfile -in a closed source or commercial project complies with the license libsndfile is -released under, the GNU Lesser General Public License (LGPL): -

- -
    -
  • Make sure you are linking to libsndfile as a shared library (Linux and Unix - systems), Dynamic Link Library (Microsoft Windows) or dynlib (Mac OS X). - If you are using some other operating system that doesn't allow dynamically - linked libraries, you will not be able to use libsndfile unless you release - the source code to your program. -
  • In the licensing documentation for your program, add a statement that your - software depends on libsndfile and that libsndfile is released under the GNU - Lesser General Public License, either - version 2.1 - or optionally - version 3. -
  • Include the text for both versions of the license, possibly as separate - files named libsndfile_lgpl_v2_1.txt and libsndfile_lgpl_v3.txt. -
- - - -


Q22 : What versions of Windows does libsndfile work on? -

- -

-Currently the precompiled windows binaries are thoroughly tested on Windows XP. -As such, they should also work on Win2k and Windows Vista. -They may also work on earlier versions of Windows. -

- -

-Since version 0.1.18 I have also been releasing precompiled binaries for Win64, -the 64 bit version of Windows. -These binaries have received much less testing than the 32 bit versions, but -should work as expected. -I'd be very interested in receiving feedback on these binaries. -

- - - -


Q23 : I'm cross compiling libsndfile for another platform. How can I - run the test suite? -

- -

-

- -

-Since version 1.0.21 the top level Makefile has an extra make target, -'test-tarball'. -Building this target creates a tarball called called: -

- -
-libsndfile-testsuite-${host_triplet}-${version}.tar.gz -
- -

-in the top level directory. -This tarball can then be copied to the target platform. -Once untarred and test script test_wrapper.sh can be run from -the top level of the extracted tarball. -

- - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -
-Version : 1.0.25 -

- - - diff --git a/libs/libsndfile/doc/Makefile.am b/libs/libsndfile/doc/Makefile.am deleted file mode 100644 index b89f1454aa..0000000000 --- a/libs/libsndfile/doc/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Process this file with automake to produce Makefile.in - -html_DATA = index.html libsndfile.jpg libsndfile.css api.html command.html \ - bugs.html sndfile_info.html new_file_type.HOWTO \ - win32.html FAQ.html lists.html embedded_files.html octave.html \ - dither.html tutorial.html - -EXTRA_DIST = $(html_DATA) - diff --git a/libs/libsndfile/doc/api.html b/libs/libsndfile/doc/api.html deleted file mode 100644 index 33d53dd02f..0000000000 --- a/libs/libsndfile/doc/api.html +++ /dev/null @@ -1,781 +0,0 @@ - - - - - - The libsndfile API - - - - - - - - - - -
-

libsndfile

-

- Libsndfile is a library designed to allow the reading and writing of many - different sampled sound file formats (such as MS Windows WAV and the Apple/SGI - AIFF format) through one standard library interface. -

- -

- During read and write operations, formats are seamlessly converted between the - format the application program has requested or supplied and the file's data - format. The application programmer can remain blissfully unaware of issues - such as file endian-ness and data format. See Note 1 and - Note 2. -

- -

- 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. - If any errors, omissions or ambiguities are found, please notify me (erikd) - at mega-nerd dot com. -

- -

- To supplement this reference documentation, there are simple example programs - included in the source code tarball. - The test suite which is also part of the source code tarball is also a good - place to look for the correct usage of the library functions. -

- -

- Finally, if you think there is some feature missing from libsndfile, check that - it isn't already implemented (and documented) - here. - -

- -

Synopsis

-

-The functions of libsndfile are defined as follows: -

- -
-      #include <stdio.h>
-      #include <sndfile.h>
-
-      SNDFILE*    sf_open          (const char *path, int mode, SF_INFO *sfinfo) ;
-      SNDFILE*    sf_open_fd       (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
-      SNDFILE* 	  sf_open_virtual  (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
-      int         sf_format_check  (const SF_INFO *info) ;
-
-      sf_count_t  sf_seek          (SNDFILE *sndfile, sf_count_t frames, int whence) ;
-
-      int         sf_command       (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
-      int         sf_error         (SNDFILE *sndfile) ;
-      const char* sf_strerror      (SNDFILE *sndfile) ;
-      const char* sf_error_number  (int errnum) ;
-
-      int         sf_perror        (SNDFILE *sndfile) ;
-      int         sf_error_str     (SNDFILE *sndfile, char* str, size_t len) ;
-
-      int         sf_close         (SNDFILE *sndfile) ;
-      void        sf_write_sync    (SNDFILE *sndfile) ;
-
-      sf_count_t  sf_read_short    (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_int      (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_float    (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_double   (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
-      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) ;
-      sf_count_t  sf_readf_float   (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_double  (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
-      sf_count_t  sf_write_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_int     (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
-      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) ;
-      sf_count_t  sf_writef_float  (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
-      sf_count_t  sf_read_raw      (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-      sf_count_t  sf_write_raw     (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-
-      const char* sf_get_string    (SNDFILE *sndfile, int str_type) ;
-      int         sf_set_string    (SNDFILE *sndfile, int str_type, const char* str) ;
-
-
- -

-SNDFILE* is an anonymous pointer to data which is private to the library. -

- - - -

File Open Function

- -
-      SNDFILE*  sf_open    (const char *path, int mode, SF_INFO *sfinfo) ;
-
- -

-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: -

- -
-      typedef struct
-      {    sf_count_t  frames ;     /* Used to be called samples. */
-           int         samplerate ;
-           int         channels ;
-           int         format ;
-           int         sections ;
-           int         seekable ;
-       } SF_INFO ;
-
- -

-The mode parameter for this function can be any one of the following three values: -

- -
-      SFM_READ    - read only mode
-      SFM_WRITE   - write only mode
-      SFM_RDWR    - read/write mode
-
- -

-When opening a file for read, the format field should be set to zero before -calling sf_open(). -The only exception to this is the case of RAW files where the caller has to set -the samplerate, channels and format fields to valid values. -All other fields of the structure are filled in by the library. -

- -

-When opening a file for write, the caller must fill in structure members samplerate, -channels, and format. -

- -

-The format field in the above SF_INFO structure is made up of the bit-wise OR of a -major format type (values between 0x10000 and 0x08000000), a minor format type -(with values less than 0x10000) and an optional endian-ness value. -The currently understood formats are listed in sndfile.h as follows and also include -bitmasks for separating major and minor file types. -Not all combinations of endian-ness and major and minor file types are valid. -

- -
-      enum
-      {   /* Major formats. */
-          SF_FORMAT_WAV          = 0x010000,     /* Microsoft WAV format (little endian). */
-          SF_FORMAT_AIFF         = 0x020000,     /* Apple/SGI AIFF format (big endian). */
-          SF_FORMAT_AU           = 0x030000,     /* Sun/NeXT AU format (big endian). */
-          SF_FORMAT_RAW          = 0x040000,     /* RAW PCM data. */
-          SF_FORMAT_PAF          = 0x050000,     /* Ensoniq PARIS file format. */
-          SF_FORMAT_SVX          = 0x060000,     /* Amiga IFF / SVX8 / SV16 format. */
-          SF_FORMAT_NIST         = 0x070000,     /* Sphere NIST format. */
-          SF_FORMAT_VOC          = 0x080000,     /* VOC files. */
-          SF_FORMAT_IRCAM        = 0x0A0000,     /* Berkeley/IRCAM/CARL */
-          SF_FORMAT_W64          = 0x0B0000,     /* Sonic Foundry's 64 bit RIFF/WAV */
-          SF_FORMAT_MAT4         = 0x0C0000,     /* Matlab (tm) V4.2 / GNU Octave 2.0 */
-          SF_FORMAT_MAT5         = 0x0D0000,     /* Matlab (tm) V5.0 / GNU Octave 2.1 */
-          SF_FORMAT_PVF          = 0x0E0000,     /* Portable Voice Format */
-          SF_FORMAT_XI           = 0x0F0000,     /* Fasttracker 2 Extended Instrument */
-          SF_FORMAT_HTK          = 0x100000,     /* HMM Tool Kit format */
-          SF_FORMAT_SDS          = 0x110000,     /* Midi Sample Dump Standard */
-          SF_FORMAT_AVR          = 0x120000,     /* Audio Visual Research */
-          SF_FORMAT_WAVEX        = 0x130000,     /* MS WAVE with WAVEFORMATEX */
-          SF_FORMAT_SD2          = 0x160000,     /* Sound Designer 2 */
-          SF_FORMAT_FLAC         = 0x170000,     /* FLAC lossless file format */
-          SF_FORMAT_CAF          = 0x180000,     /* Core Audio File format */
-          SF_FORMAT_WVE          = 0x190000,     /* Psion WVE format */
-          SF_FORMAT_OGG          = 0x200000,     /* Xiph OGG container */
-          SF_FORMAT_MPC2K        = 0x210000,     /* Akai MPC 2000 sampler */
-          SF_FORMAT_RF64         = 0x220000,     /* RF64 WAV file */
-
-          /* Subtypes from here on. */
-
-          SF_FORMAT_PCM_S8       = 0x0001,       /* Signed 8 bit data */
-          SF_FORMAT_PCM_16       = 0x0002,       /* Signed 16 bit data */
-          SF_FORMAT_PCM_24       = 0x0003,       /* Signed 24 bit data */
-          SF_FORMAT_PCM_32       = 0x0004,       /* Signed 32 bit data */
-
-          SF_FORMAT_PCM_U8       = 0x0005,       /* Unsigned 8 bit data (WAV and RAW only) */
-
-          SF_FORMAT_FLOAT        = 0x0006,       /* 32 bit float data */
-          SF_FORMAT_DOUBLE       = 0x0007,       /* 64 bit float data */
-
-          SF_FORMAT_ULAW         = 0x0010,       /* U-Law encoded. */
-          SF_FORMAT_ALAW         = 0x0011,       /* A-Law encoded. */
-          SF_FORMAT_IMA_ADPCM    = 0x0012,       /* IMA ADPCM. */
-          SF_FORMAT_MS_ADPCM     = 0x0013,       /* Microsoft ADPCM. */
-
-          SF_FORMAT_GSM610       = 0x0020,       /* GSM 6.10 encoding. */
-          SF_FORMAT_VOX_ADPCM    = 0x0021,       /* Oki Dialogic ADPCM encoding. */
-
-          SF_FORMAT_G721_32      = 0x0030,       /* 32kbs G721 ADPCM encoding. */
-          SF_FORMAT_G723_24      = 0x0031,       /* 24kbs G723 ADPCM encoding. */
-          SF_FORMAT_G723_40      = 0x0032,       /* 40kbs G723 ADPCM encoding. */
-
-          SF_FORMAT_DWVW_12      = 0x0040,       /* 12 bit Delta Width Variable Word encoding. */
-          SF_FORMAT_DWVW_16      = 0x0041,       /* 16 bit Delta Width Variable Word encoding. */
-          SF_FORMAT_DWVW_24      = 0x0042,       /* 24 bit Delta Width Variable Word encoding. */
-          SF_FORMAT_DWVW_N       = 0x0043,       /* N bit Delta Width Variable Word encoding. */
-
-          SF_FORMAT_DPCM_8       = 0x0050,       /* 8 bit differential PCM (XI only) */
-          SF_FORMAT_DPCM_16      = 0x0051,       /* 16 bit differential PCM (XI only) */
-
-          SF_FORMAT_VORBIS       = 0x0060,       /* Xiph Vorbis encoding. */
-
-          /* Endian-ness options. */
-
-          SF_ENDIAN_FILE         = 0x00000000,   /* Default file endian-ness. */
-          SF_ENDIAN_LITTLE       = 0x10000000,   /* Force little endian-ness. */
-          SF_ENDIAN_BIG          = 0x20000000,   /* Force big endian-ness. */
-          SF_ENDIAN_CPU          = 0x30000000,   /* Force CPU endian-ness. */
-
-          SF_FORMAT_SUBMASK      = 0x0000FFFF,
-          SF_FORMAT_TYPEMASK     = 0x0FFF0000,
-          SF_FORMAT_ENDMASK      = 0x30000000
-      } ;
-
- -

-Every call to sf_open() should be matched with a call to sf_close() to free up -memory allocated during the call to sf_open(). -

- -

-On success, the sf_open function returns a non-NULL pointer which should be -passed as the first parameter to all subsequent libsndfile calls dealing with -that audio file. -On fail, the sf_open function returns a NULL pointer. -An explanation of the error can obtained by passing NULL to - sf_strerror. -

- - -

File Descriptor Open

- -
-      SNDFILE*  sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
-
- -

-Note: On Microsoft Windows, this function does not work if the -application and the libsndfile DLL are linked to different versions of the -Microsoft C runtime DLL. -

-

-The second open function takes a file descriptor of a file that has already been -opened. -Care should be taken to ensure that the mode of the file represented by the -descriptor matches the mode argument. -This function is useful in the following circumstances: -

- -
    -
  • Opening temporary files securely (ie use the tmpfile() to return a - FILE* pointer and then using fileno() to retrieve the file descriptor - which is then passed to libsndfile). -
  • Opening files with file names using OS specific character encodings - and then passing the file descriptor to sf_open_fd(). -
  • Opening sound files embedded within larger files. - More info. -
- -

-Every call to sf_open_fd() should be matched with a call to sf_close() to free up -memory allocated during the call to sf_open(). -

- -

-When sf_close() is called, the file descriptor is only closed if the close_desc -parameter was TRUE when the sf_open_fd() function was called. -

- -

-On success, the sf_open_fd function returns a non-NULL pointer which should be -passed as the first parameter to all subsequent libsndfile calls dealing with -that audio file. -On fail, the sf_open_fd function returns a NULL pointer. -

- - -

Virtual File Open Function

-
-      SNDFILE* 	sf_open_virtual	(SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
-
-

- Opens a soundfile from a virtual file I/O context which is provided - by the caller. This is usually used to interface libsndfile to a stream or buffer - based system. Apart from the sfvirtual and the user_data parameters this function behaves - like sf_open. -

- -
-      typedef struct
-      {    sf_vio_get_filelen  get_filelen ;
-           sf_vio_seek         seek ;
-           sf_vio_read         read ;
-           sf_vio_write        write ;
-           sf_vio_tell         tell ;
-      } SF_VIRTUAL_IO ;
-
-

-Libsndfile calls the callbacks provided by the SF_VIRTUAL_IO structure when opening, reading -and writing to the virtual file context. The user_data pointer is a user defined context which -will be available in the callbacks. -

-
-      typedef sf_count_t  (*sf_vio_get_filelen) (void *user_data) ;
-      typedef sf_count_t  (*sf_vio_seek)        (sf_count_t offset, int whence, void *user_data) ;
-      typedef sf_count_t  (*sf_vio_read)        (void *ptr, sf_count_t count, void *user_data) ;
-      typedef sf_count_t  (*sf_vio_write)       (const void *ptr, sf_count_t count, void *user_data) ;
-      typedef sf_count_t  (*sf_vio_tell)        (void *user_data) ;
-
-

sf_vio_get_filelen

-
-      typedef sf_count_t  (*sf_vio_get_filelen) (void *user_data) ;
-
-

-The virtual file contex must return the length of the virtual file in bytes.
-

-

sf_vio_seek

-
-      typedef sf_count_t  (*sf_vio_seek)        (sf_count_t offset, int whence, void *user_data) ;
-
-

-The virtual file context must seek to offset using the seek mode provided by whence which is one of
-

-
-      SEEK_CUR
-      SEEK_SET
-      SEEK_END
-
-

-The return value must contain the new offset in the file. -

-

sf_vio_read

-
-      typedef sf_count_t  (*sf_vio_read)        (void *ptr, sf_count_t count, void *user_data) ;
-
-

-The virtual file context must copy ("read") "count" bytes into the -buffer provided by ptr and return the count of actually copied bytes. -

-

sf_vio_write

-
-      typedef sf_count_t  (*sf_vio_write)       (const void *ptr, sf_count_t count, void *user_data) ;
-
-

-The virtual file context must process "count" bytes stored in the -buffer passed with ptr and return the count of actually processed bytes.
-

-

sf_vio_tell

-
-      typedef sf_count_t  (*sf_vio_tell)        (void *user_data) ;
-
-

-Return the current position of the virtual file context.
-

- - - -

Format Check Function

- -
-      int  sf_format_check (const SF_INFO *info) ;
-
- -

-This function allows the caller to check if a set of parameters in the SF_INFO struct -is valid before calling sf_open (SFM_WRITE). -

-

-sf_format_check returns TRUE if the parameters are valid and FALSE otherwise. -

- - -

File Seek Functions

- -
-      sf_count_t  sf_seek  (SNDFILE *sndfile, sf_count_t frames, int whence) ;
-
- -

-The file seek functions work much like lseek in unistd.h with the exception that -the non-audio data is ignored and the seek only moves within the audio data section of -the file. -In addition, seeks are defined in number of (multichannel) frames. -Therefore, a seek in a stereo file from the current position forward with an offset -of 1 would skip forward by one sample of both channels. -

- -

-like lseek(), the whence parameter can be any one of the following three values: -

- -
-      SEEK_SET  - The offset is set to the start of the audio data plus offset (multichannel) frames.
-      SEEK_CUR  - The offset is set to its current location plus offset (multichannel) frames.
-      SEEK_END  - The offset is set to the end of the data plus offset (multichannel) frames.
-
- -

-Internally, libsndfile keeps track of the read and write locations using separate -read and write pointers. -If a file has been opened with a mode of SFM_RDWR, bitwise OR-ing the standard whence -values above with either SFM_READ or SFM_WRITE allows the read and write pointers to -be modified separately. -If the SEEK_* values are used on their own, the read and write pointers are -both modified. -

- -

-Note that the frames offset can be negative and in fact should be when SEEK_END is used for the -whence parameter. -

-

-sf_seek will return the offset in (multichannel) frames from the start of the audio data -or -1 if an error occured (ie an attempt is made to seek beyond the start or end of the file). -

- - -


Error Reporting Functions

- - -
-      int         sf_error        (SNDFILE *sndfile) ;
-
-

-This function returns the current error number for the given SNDFILE. -The error number may be one of the following: -

-
-        enum
-        {   SF_ERR_NO_ERROR             = 0,
-            SF_ERR_UNRECOGNISED_FORMAT  = 1,
-            SF_ERR_SYSTEM               = 2,
-            SF_ERR_MALFORMED_FILE       = 3,
-            SF_ERR_UNSUPPORTED_ENCODING = 4
-        } ;
-
- -

-or any one of many other internal error values. -Applications should only test the return value against error values defined in -<sndfile.h> as the internal error values are subject to change at any -time. -For errors not in the above list, the function sf_error_number() can be used to -convert it to an error string. -

- -
-      const char* sf_strerror     (SNDFILE *sndfile) ;
-      const char* sf_error_number (int errnum) ;
-
- -

-The error functions sf_strerror() and sf_error_number() convert the library's internal -error enumerations into text strings. -

-
-      int         sf_perror     (SNDFILE *sndfile) ;
-      int         sf_error_str  (SNDFILE *sndfile, char* str, size_t len) ;
-
- -

-The functions sf_perror() and sf_error_str() are deprecated and will be dropped -from the library at some later date. -

- - -


File Close Function

- -
-      int  sf_close  (SNDFILE *sndfile) ;
-
- -

-The close function closes the file, deallocates its internal buffers and returns -0 on success or an error value otherwise. -

-
- - -


Write Sync Function

- -
-      void  sf_write_sync  (SNDFILE *sndfile) ;
-
- -

-If the file is opened SFM_WRITE or SFM_RDWR, call the operating system's function -to force the writing of all file cache buffers to disk. If the file is opened -SFM_READ no action is taken. -

-
- - - -


File Read Functions (Items)

- -
-      sf_count_t  sf_read_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_int     (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
- -

-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. -

- -

-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 -Note 1. -

- -

-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. -

- - -


File Read Functions (Frames)

- -
-      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) ;
-      sf_count_t  sf_readf_float   (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_double  (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
- -

-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. -

- -

-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). -

- -

-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. -

- - -


File Write Functions (Items)

- -
-      sf_count_t  sf_write_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_int     (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
- -

-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. -

- -

-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 -Note 1. -

-

-The sf_write_XXXX functions return the number of items written (which should be the -same as the items parameter). -

- - -


File Write Functions (Frames)

- -
-      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) ;
-      sf_count_t  sf_writef_float  (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
- -

-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 sf_writef_XXXX functions return the number of frames written (which should be the -same as the frames parameter). -

- - -


Raw File Read and Write Functions

- -
-      sf_count_t  sf_read_raw     (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-      sf_count_t  sf_write_raw    (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-
- -

-Note: Unless you are writing an external decoder/encode that uses -libsndfile to handle the file headers, you should not be using these -functions. -

- -

-The raw read and write functions read raw audio data from the audio file (not to be -confused with reading RAW header-less PCM files). The number of bytes read or written -must always be an integer multiple of the number of channels multiplied by the number -of bytes required to represent one sample from one channel. -

- -

-The raw read and write functions return the number of bytes read or written (which -should be the same as the bytes parameter). -

- -

- -Note : The result of using of both regular reads/writes and raw reads/writes on -compressed file formats other than SF_FORMAT_ALAW and SF_FORMAT_ULAW is undefined. - -

- -

-See also : SFC_RAW_NEEDS_ENDSWAP -

- - -


Functions for Reading and Writing String Data

- - -
-      const char* sf_get_string   (SNDFILE *sndfile, int str_type) ;
-      int         sf_set_string   (SNDFILE *sndfile, int str_type, const char* str) ;
-
- -

-These functions allow strings to be set on files opened for write and to be -retrieved from files opened for read where supported by the given file type. -The str_type parameter can be any one of the following string types: -

- -
-          enum
-          {   SF_STR_TITLE,
-              SF_STR_COPYRIGHT,
-              SF_STR_SOFTWARE,
-              SF_STR_ARTIST,
-              SF_STR_COMMENT,
-              SF_STR_DATE,
-              SF_STR_ALBUM,
-              SF_STR_LICENSE,
-              SF_STR_TRACKNUMBER,
-              SF_STR_GENRE
-          } ;
-
- -

-The sf_get_string() function returns the specified string if it exists and a -NULL pointer otherwise. -In addition to the string ids above, SF_STR_FIRST (== SF_STR_TITLE) and -SF_STR_LAST (always the same as the highest numbers string id) are also -available to allow iteration over all the available string ids. -

- -

-The sf_set_string() function sets the string data. -It returns zero on success and non-zero on error. -The error code can be converted to a string using sf_error_number(). -

- - -

- -

- -
- - -


Note 1

- -

-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: -

- -

-Whenever integer data is moved from one sized container to another sized container, -the most significant bit in the source container will become the most significant bit -in the destination container. -

- -

-When converting between integer data and floating point data, different rules apply. -The default behaviour when reading floating point data (sf_read_float() or -sf_read_double ()) from a file with integer data is normalisation. Regardless of -whether data in the file is 8, 16, 24 or 32 bit wide, the data will be read as -floating point data in the range [-1.0, 1.0]. Similarly, data in the range [-1.0, 1.0] -will be written to an integer PCM file so that a data value of 1.0 will be the largest -allowable integer for the given bit width. This normalisation can be turned on or off -using the sf_command interface. -

- - -


Note 2

- -

-Reading a file containg floating point data (allowable with WAV, AIFF, AU and other -file formats) using integer read methods (sf_read_short() or sf_read_int()) can -produce unexpected results. -For instance the data in the file may have a maximum absolute value < 1.0 which -would mean that all sample values read from the file will be zero. -In order to read these files correctly using integer read methods, it is recommended -that you use the - sf_command -interface, a command of - SFC_SET_SCALE_FLOAT_INT_READ -and a parameter of SF_TRUE to force correct scaling. -

- -
- -

- The libsndfile home page is - here. -

-

-Version : 1.0.25 -

- - - - - - - diff --git a/libs/libsndfile/doc/bugs.html b/libs/libsndfile/doc/bugs.html deleted file mode 100644 index 3a441fef11..0000000000 --- a/libs/libsndfile/doc/bugs.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - Bug Reporting - - - - - - - - -
-

Reporting Bugs in libsndfile

-
-

- Before even attempting to report a bug in libsndfile please make sure you have - read the - Frequently Asked Questions. - If you are having a problem writing code using libsndfile make sure you read - the - Application Programming Interface - documentation. -

-

- That said, I am interested in finding and fixing all genuine bugs in libsndfile. - Bugs I want to fix include any of the following problems (and probably others) : -

-
    -
  • Compilation problems on new platforms. -
  • Errors being detected during the `make check' process. -
  • Segmentation faults occuring inside libsndfile. -
  • libsndfile hanging when opening a file. -
  • Supported sound file types being incorrectly read or written. -
  • Omissions, errors or spelling mistakes in the documentation. -
- -

- When submitting a bug report you must include : -

-
    -
  • Your system (CPU and memory size should be enough). -
  • The operating system you are using. -
  • Whether you are using a package provided by your distribution or you - compiled it youself. -
  • If you compiled it yourself, the compiler you are using. (Also make - sure to run 'make check'.) -
  • A description of the problem. -
  • Information generated by the sndfile-info program (see next paragraph). -
  • If you are having problems with sndfile-play and ALSA on Linux, I will - need information about your kernel, ALSA version, compiler version, - whether you compiled the kernel/ALSA your self or installed from a - package etc. -
- -

- If libsndfile compiles and installs correctly but has difficulty reading a particular - file or type of file you should run the sndfile-info program (from the examples - directory of the libsndfile distribution) on the file. See - here - for an example of the use of the sndfile-info program. -

-

- Please do not send me a sound file which fails to open under libsndfile unless I - specifically ask you to. The above information should usually suffice for most - problems. -

-

- Once you have the above information you should submit a ticket on the libsnfile - github issue tracker. - -

- - diff --git a/libs/libsndfile/doc/command.html b/libs/libsndfile/doc/command.html deleted file mode 100644 index f2ed083760..0000000000 --- a/libs/libsndfile/doc/command.html +++ /dev/null @@ -1,1687 +0,0 @@ - - - - - - libsndfile : the sf_command function. - - - - - - - - - - - -

sf_command

-
-
-        int    sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
-

- This function allows the caller to retrieve information from or change aspects of the - library behaviour. - Examples include retrieving a string containing the library version or changing the - scaling applied to floating point sample data during read and write. - Most of these operations are performed on a per-file basis. -

-

- The cmd parameter is an integer identifier which is defined in <sndfile.h>. - All of the valid command identifiers have names beginning with "SFC_". - Data is passed to and returned from the library by use of a void pointer. - The library will not read or write more than datasize bytes from the void pointer. - For some calls no data is required in which case data should be NULL and datasize - may be used for some other purpose. -

-

- The available commands are as follows: -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SFC_GET_LIB_VERSIONRetrieve the version of the library.
SFC_GET_LOG_INFORetrieve the internal per-file operation log.
SFC_CALC_SIGNAL_MAXCalculate the measured maximum signal value.
SFC_CALC_NORM_SIGNAL_MAXCalculate the measured normalised maximum signal value.
SFC_CALC_MAX_ALL_CHANNELSCalculate the peak value for each channel.
SFC_CALC_NORM_MAX_ALL_CHANNELSCalculate the normalised peak for each channel.
SFC_GET_SIGNAL_MAXRetrieve the peak value for the file (as stored in the file header).
SFC_GET_MAX_ALL_CHANNELSRetrieve the peak value for each channel (as stored in the file header).
SFC_SET_NORM_FLOATModify the normalisation behaviour of the floating point reading and writing functions.
SFC_SET_NORM_DOUBLEModify the normalisation behaviour of the double precision floating point reading and writing functions.
SFC_GET_NORM_FLOATRetrieve the current normalisation behaviour of the floating point reading and writing functions.
SFC_GET_NORM_DOUBLERetrieve the current normalisation behaviour of the double precision floating point reading and writing functions.
SFC_SET_SCALE_FLOAT_INT_READSet/clear the scale factor when integer (short/int) data is read from a file - containing floating point data.
SFC_SET_SCALE_INT_FLOAT_WRITESet/clear the scale factor when integer (short/int) data is written to a file - as floating point data.
SFC_GET_SIMPLE_FORMAT_COUNTRetrieve the number of simple formats supported by libsndfile.
SFC_GET_SIMPLE_FORMATRetrieve information about a simple format.
SFC_GET_FORMAT_INFORetrieve information about a major or subtype format.
SFC_GET_FORMAT_MAJOR_COUNTRetrieve the number of major formats.
SFC_GET_FORMAT_MAJORRetrieve information about a major format type.
SFC_GET_FORMAT_SUBTYPE_COUNTRetrieve the number of subformats.
SFC_GET_FORMAT_SUBTYPERetrieve information about a subformat.
SFC_SET_ADD_PEAK_CHUNKSwitch the code for adding the PEAK chunk to WAV and AIFF files on or off.
SFC_UPDATE_HEADER_NOWUsed when a file is open for write, this command will update the file - header to reflect the data written so far.
SFC_SET_UPDATE_HEADER_AUTOUsed when a file is open for write, this command will cause the file header - to be updated after each write to the file.
SFC_FILE_TRUNCATETruncate a file open for write or for read/write.
SFC_SET_RAW_START_OFFSETChange the data start offset for files opened up as SF_FORMAT_RAW.
SFC_SET_CLIPPINGTurn on/off automatic clipping when doing floating point to integer - conversion.
SFC_GET_CLIPPINGRetrieve current clipping setting.
SFC_GET_EMBED_FILE_INFORetrieve information about audio files embedded inside other files.
SFC_GET_AMBISONICTest a WAVEX file for Ambisonic format
SFC_SET_AMBISONICModify a WAVEX header for Ambisonic format
SFC_SET_VBR_ENCODING_QUALITYSet the Variable Bit Rate encoding quality
SFC_SET_COMPRESSION_LEVELSet the compression level.
SFC_RAW_NEEDS_ENDSWAPDetermine if raw data needs endswapping
SFC_GET_BROADCAST_INFORetrieve the Broadcast Chunk info
SFC_SET_BROADCAST_INFOSet the Broadcast Chunk info
SFC_SET_CART_INFOSet the Cart Chunk info
SFC_GET_CART_INFORetrieve the Cart Chunk info
SFC_GET_LOOP_INFOGet loop info
SFC_GET_INSTRUMENTGet instrument info
SFC_SET_INSTRUMENTSet instrument info
-
- -

- -
- - - -


SFC_GET_LIB_VERSION

-

-Retrieve the version of the library as a string. -

-

-Parameters: -

-        sndfile  : Not used
-        cmd      : SFC_GET_LIB_VERSION
-        data     : A pointer to a char buffer
-        datasize : The size of the the buffer
-
-

-Example: -

-
-        char  buffer [128] ;
-        sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_GET_LOG_INFO

-

-Retrieve the log buffer generated when opening a file as a string. This log -buffer can often contain a good reason for why libsndfile failed to open a -particular file. -

-

-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
-
-

-Example: -

-
-        char  buffer [2048] ;
-        sf_command (sndfile, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_CALC_SIGNAL_MAX

-

-Retrieve the measured maximum signal value. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_NORM_SIGNAL_MAX

-

-Retrieve the measured normalised maximum signal value. This involves reading -through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_NORM_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_MAX_ALL_CHANNELS

-

-Calculate the peak value (ie a single number) for each channel. -This involves reading through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - -


SFC_CALC_NORM_MAX_ALL_CHANNELS

-

-Calculate the normalised peak for each channel. -This involves reading through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_NORM_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - - - -


SFC_GET_SIGNAL_MAX

-

-Retrieve the peak value for the file as stored in the file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_peak ;
-        sf_command (sndfile, SFC_GET_SIGNAL_MAX, &max_peak, sizeof (max_peak)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contained the peak value. SF_FALSE otherwise. -
- - - -


SFC_GET_MAX_ALL_CHANNELS

-

-Retrieve the peak value for the file as stored in the file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_SIGNAL_MAX
-        data     : A pointer to an array of doubles
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_GET_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains per channel peak values for the file. - SF_FALSE otherwise. -
- - - - -


SFC_SET_NORM_FLOAT

-

-This command only affects data read from or written to using the floating point functions: -

-
-	size_t    sf_read_float    (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_readf_float   (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-	size_t    sf_write_float   (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_writef_float  (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_FLOAT
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data from all -subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the float write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns the previous float normalisation mode. -
- - - -


SFC_SET_NORM_DOUBLE

-

-This command only affects data read from or written to using the double precision -floating point functions: -

-
-	size_t    sf_read_double    (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_readf_double   (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-	size_t    sf_write_double   (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_writef_double  (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_DOUBLE
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data -from all subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the double write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns the previous double normalisation mode. -
- - - -


SFC_GET_NORM_FLOAT

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_FLOAT
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_FLOAT, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normalisation is on and FALSE otherwise. -
- - - -


SFC_GET_NORM_DOUBLE

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_DOUBLE
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_DOUBLE, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normalisation is on and FALSE otherwise. -
- - - - -


SFC_SET_SCALE_FLOAT_INT_READ

-

-Set/clear the scale factor when integer (short/int) data is read from a file -containing floating point data. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_SCALE_FLOAT_INT_READ
-        data     : NULL
-        datasize : TRUE or FALSE
-
-

-Example: -

-
-        sf_command (sndfile, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ;
-
-
-
Return value:
-
Returns the previous SFC_SET_SCALE_FLOAT_INT_READ setting for this file. -
- - - - -


SFC_SET_SCALE_INT_FLOAT_WRITE

-

-Set/clear the scale factor when integer (short/int) data is written to a file -as floating point data. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_SCALE_FLOAT_INT_READ
-        data     : NULL
-        datasize : TRUE or FALSE
-
-

-Example: -

-
-        sf_command (sndfile, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ;
-
-
-
Return value:
-
Returns the previous SFC_SET_SCALE_INT_FLOAT_WRITE setting for this file. -
- - - -


SFC_GET_SIMPLE_FORMAT_COUNT

-

-Retrieve the number of simple formats supported by libsndfile. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_SIMPLE_FORMAT

-

-Retrieve information about a simple format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_SIMPLE_FORMAT, the value of the format -field should be the format number (ie 0 <= format <= count value obtained using -SF_GET_SIMPLE_FORMAT_COUNT). -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field of the SF_FORMAT_INFO struct will be a value which - can be placed in the format field of an SF_INFO struct when a file is to be opened - for write. -
The name field will contain a char* pointer to the name of the string, eg. "WAV (Microsoft 16 bit PCM)". -
The extension field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_INFO

-

-Retrieve information about a major or subtype format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_INFO
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_FORMAT_INFO, the format field is -examined and if (format & SF_FORMAT_TYPEMASK) is a valid format then the struct -is filled in with information about the given major type. -If (format & SF_FORMAT_TYPEMASK) is FALSE and (format & SF_FORMAT_SUBMASK) is a -valid subtype format then the struct is filled in with information about the given -subtype. -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-
-        format_info.format = SF_FORMAT_WAV ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-
-        format_info.format = SF_FORMAT_ULAW ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s\n", format_info.format, format_info.name) ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
- - -


SFC_GET_FORMAT_MAJOR_COUNT

-

-Retrieve the number of major formats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_MAJOR

-

-Retrieve information about a major format type. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will be one of the major format identifiers such as - SF_FORMAT_WAV or SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string, eg. "WAV (Microsoft)". -
The extension field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_SUBTYPE_COUNT

-

-Retrieve the number of subformats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int   count ;
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_SUBTYPE

-

-Enumerate the subtypes (this function does not translate a subtype into -a string describing that subtype). -A typical use case might be retrieving a string description of all subtypes -so that a dialog box can be filled in. -

-

- -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example 1: Retrieve all sybtypes supported by the WAV format. -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
-            if (! sf_format_check (format_info.format | SF_FORMAT_WAV))
-               continue ;
-            printf ("%08x  %s\n", format_info.format, format_info.name) ;
-            } ;
-
-

-Example 2: Print a string describing the SF_FORMAT_PCM_16 subtype. -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
-            if (format_info.format == SF_FORMAT_PCM_16)
-            {   printf ("%08x  %s\n", format_info.format, format_info.name) ;
-                break ;
-                } ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will be one of the major format identifiers such as - SF_FORMAT_WAV or SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string; for instance - "WAV (Microsoft)" or "AIFF (Apple/SGI)". -
The extension field will be a NULL pointer. -
- - - -


SFC_SET_ADD_PEAK_CHUNK

-

-By default, WAV and AIFF files which contain floating point data (subtype SF_FORMAT_FLOAT -or SF_FORMAT_DOUBLE) have a PEAK chunk. -By using this command, the addition of a PEAK chunk can be turned on or off. -

-

-Note : This call must be made before any data is written to the file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_ADD_PEAK_CHUNK
-        data     : Not used (should be NULL)
-        datasize : TRUE or FALSE.
-
-

-Example: -

-
-        /* Turn on the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ;
-
-        /* Turn off the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns SF_TRUE if the peak chunk will be written after this call. -
Returns SF_FALSE if the peak chunk will not be written after this call. -
- - - -


SFC_UPDATE_HEADER_NOW

-

-The header of an audio file is normally written by libsndfile when the file is -closed using sf_close(). -

-

-There are however situations where large files are being generated and it would -be nice to have valid data in the header before the file is complete. -Using this command will update the file header to reflect the amount of data written -to the file so far. -Other programs opening the file for read (before any more data is written) will -then read a valid sound file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : Not used.
-
-

-Example: -

-
-        /* Update the header now. */
-        sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_SET_UPDATE_HEADER_AUTO

-

-Similar to SFC_UPDATE_HEADER_NOW but updates the header at the end of every call -to the sf_write* functions. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : SF_TRUE or SF_FALSE
-
-

-Example: -

-
-        /* Turn on auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ;
-
-        /* Turn off auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_FALSE) ;
-
-
-
Return value:
-
TRUE if auto update header is now on; FALSE otherwise. -
- - - -


SFC_FILE_TRUNCATE

-

-Truncate a file that was opened for write or read/write. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_FILE_TRUNCATE
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-Truncate the file to the number of frames specified by the sf_count_t pointed -to by data. -After this command, both the read and the write pointer will be -at the new end of the file. -This command will fail (returning non-zero) if the requested truncate position -is beyond the end of the file. -

-

-Example: -

-
-        /* Truncate the file to a length of 20 frames. */
-        sf_count_t  frames = 20 ;
-        sf_command (sndfile, SFC_FILE_TRUNCATE, &frames, sizeof (frames)) ;
-
-
-
Return value:
-
Zero on sucess, non-zero otherwise. -
- - - -


SFC_SET_RAW_START_OFFSET

-

-Change the data start offset for files opened up as SF_FORMAT_RAW. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_RAW_START_OFFSET
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-For a file opened as format SF_FORMAT_RAW, set the data offset to the value -given by data. -

-

-Example: -

-
-        /* Reset the data offset to 5 bytes from the start of the file. */
-        sf_count_t  offset = 5 ;
-        sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &offset, sizeof (offset)) ;
-
-
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_SET_CLIPPING

-

-Turn on/off automatic clipping when doing floating point to integer conversion. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_CLIPPING
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE.
-
- -

-Turn on (datasize == SF_TRUE) or off (datasize == SF_FALSE) clipping. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_CLIPPING, NULL, SF_TRUE) ;
-
-
-
Return value:
-
Clipping mode (SF_TRUE or SF_FALSE). -
- - - - -


SFC_GET_CLIPPING

-

-Turn on/off automatic clipping when doing floating point to integer conversion. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_CLIPPING
-        data     : NULL
-        datasize : 0
-
- -

-Retrieve the current cliiping setting. -

-

-Example: -

-
-        sf_command (sndfile, SFC_GET_CLIPPING, NULL, 0) ;
-
-
-
Return value:
-
Clipping mode (SF_TRUE or SF_FALSE). -
- - - -


SFC_GET_EMBED_FILE_INFO

-

-Get the file offset and file length of a file enbedded within another -larger file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_CLIPPING
-        data     : a pointer to an  SF_EMBED_FILE_INFO struct
-        datasize : sizeof (SF_EMBED_FILE_INFO)
-
-

-The SF_EMBED_FILE_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   sf_count_t	offset ;
-            sf_count_t	length ;
-        } SF_EMBED_FILE_INFO ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the offset field of the SF_EMBED_FILE_INFO struct will be - the offsets in bytes from the start of the outer file to the start of - the audio file. -
The value of the offset field of the SF_EMBED_FILE_INFO struct will be - the length in bytes of the embedded file. -
- - - - - -


SFC_WAVEX_GET_AMBISONIC

-

-Test if the current file has the GUID of a WAVEX file for any of the Ambisonic -formats. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_WAVEX_GET_AMBISONIC
-        data     : NULL
-        datasize : 0
-
-

- The Ambisonic WAVEX formats are defined here : - - http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html. -

-
-
Return value:
-
SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT or zero if the file format - does not support ambisonic formats. -
- - - -


SFC_WAVEX_SET_AMBISONIC

-

-Set the GUID of a new WAVEX file to indicate an Ambisonics format. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_WAVEX_SET_AMBISONIC
-        data     : NULL
-        datasize : SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT
-
-

-Turn on (SF_AMBISONIC_B_FORMAT) or off (SF_AMBISONIC_NONE) encoding. -This command is currently only supported for files with SF_FORMAT_WAVEX format. -

-

- The Ambisonic WAVEX formats are defined here : - - http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html. -

-
-
Return value:
-
Return the ambisonic value that has just been set or zero if the file - format does not support ambisonic encoding. -
- - - -


SFC_SET_VBR_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. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_VBR_ENCODING_QUALITY
-        data     : A pointer to a double value
-        datasize : sizeof (double)
-
-

-The command must be sent before any audio data is written to the file. -

-

-

-
-
Return value:
-
SF_TRUE if VBR encoding quality was set. - SF_FALSE otherwise. -
- - - -


SFC_SET_COMPRESSION_LEVEL

-

-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. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_COMPRESSION_LEVEL
-        data     : A pointer to a double value
-        datasize : sizeof (double)
-
-

-The command must be sent before any audio data is written to the file. -

-

-

-
-
Return value:
-
SF_TRUE if compression level was set. - SF_FALSE otherwise. -
- - - -


SFC_RAW_NEEDS_ENDSWAP

-

-Determine if raw data read using - - sf_read_raw -needs to be end swapped on the host CPU. -

-

-For instance, will return SF_TRUE on when reading WAV containing -SF_FORMAT_PCM_16 data on a big endian machine and SF_FALSE on a little endian -machine. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_RAW_NEEDS_ENDSWAP
-        data     : NULL
-        datasize : 0
-
- -
-
Return value:
-
SF_TRUE or SF_FALSE -
- - - - -


SFC_GET_BROADCAST_INFO

-

-Retrieve the Broadcast Extension Chunk from WAV (and related) files. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_BROADCAST_INFO
-        data     : a pointer to an SF_BROADCAST_INFO struct
-        datasize : sizeof (SF_BROADCAST_INFO)
-
-

-The SF_BROADCAST_INFO struct is defined in <sndfile.h> as: -

-
-    typedef struct
-    {   char            description [256] ;
-        char            originator [32] ;
-        char            originator_reference [32] ;
-        char            origination_date [10] ;
-        char            origination_time [8] ;
-        unsigned int    time_reference_low ;
-        unsigned int    time_reference_high ;
-        short           version ;
-        char            umid [64] ;
-        char            reserved [190] ;
-        unsigned int    coding_history_size ;
-        char            coding_history [256] ;
-    } SF_BROADCAST_INFO ;
-
- -
-
Return value:
-
SF_TRUE if the file contained a Broadcast Extension chunk or SF_FALSE - otherwise. -
- - - -


SFC_SET_BROADCAST_INFO

-

-Set the Broadcast Extension Chunk for WAV (and related) files. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_BROADCAST_INFO
-        data     : a pointer to an SF_BROADCAST_INFO struct
-        datasize : sizeof (SF_BROADCAST_INFO)
-
- -
-
Return value:
-
SF_TRUE if setting the Broadcast Extension chunk was successful and SF_FALSE - otherwise. - -
- - - -


SFC_GET_CART_INFO

-

Retrieve the Cart Chunk from WAV (and related) files. Based on AES46 standard for CartChunk (see CartChunk.org for more information. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_CART_INFO
-        data     : a pointer to an SF_CART_INFO struct
-        datasize : sizeof (SF_CART_INFO)
-
-

-The SF_CART_INFO struct is defined in <sndfile.h> as: -

-
-#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] ;
-                        }
-
- -
-
Return value:
-
SF_TRUE if the file contained a Cart chunk or SF_FALSE - otherwise. -
- - - -


SFC_SET_CART_INFO

-

-Set the Cart Chunk for WAV (and related) files. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_CART_INFO
-        data     : a pointer to an SF_CART_INFO struct
-        datasize : sizeof (SF_CART_INFO)
-
- -
-
Return value:
-
SF_TRUE if setting the Cart chunk was successful and SF_FALSE - otherwise. -
- - - -


SFC_GET_LOOP_INFO

-

-Retrieve loop information for file including time signature, length in -beats and original MIDI base note -

-

-Parameters: -

-
-         sndfile  : A valid SNDFILE* pointer
-         cmd      : SFC_GET_LOOP_INFO
-         data     : a pointer to an SF_LOOP_INFO struct
-         datasize : sizeof (SF_LOOP_INFO)
-
-

-The SF_BROADCAST_INFO struct is defined in <sndfile.h> as: -

-
-        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 ;
-
-

-Example: -

-
-         SF_LOOP_INFO loop;
-         sf_command (sndfile, SFC_GET_LOOP_INFO, &loop, sizeof (loop)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains loop information for the file. - SF_FALSE otherwise. -
- - - - - -


SFC_GET_INSTRUMENT

-

-Retrieve instrument information from file including MIDI base note, -keyboard mapping and looping informations(start/stop and mode). -

-

-Parameters: -

-
-         sndfile  : A valid SNDFILE* pointer
-         cmd      : SFC_GET_INSTRUMENT
-         data     : a pointer to an SF_INSTRUMENT struct
-         datasize : sizeof (SF_INSTRUMENT)
-
- -

-The SF_INSTRUMENT struct is defined in <sndfile.h> as: -

-
-        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 ;
-
- -

-Example: -

-
-         SF_INSTRUMENT inst ;
-         sf_command (sndfile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains instrument information for the - file. SF_FALSE otherwise. -
- - - - - -


SFC_SET_INSTRUMENT

-

-Set the instrument information for the file. -

-

-Parameters: -

-
-         sndfile  : A valid SNDFILE* pointer
-         cmd      : SFC_GET_INSTRUMENT
-         data     : a pointer to an SF_INSTRUMENT struct
-         datasize : sizeof (SF_INSTRUMENT)
-
-

-Example: -

-
-         SF_INSTRUMENT inst ;
-         sf_command (sndfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains instrument information for the - file. SF_FALSE otherwise. -
- - - - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -
-Version : 1.0.25 -

- - - diff --git a/libs/libsndfile/doc/development.html b/libs/libsndfile/doc/development.html deleted file mode 100644 index 4236cdbb87..0000000000 --- a/libs/libsndfile/doc/development.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - libsndfile Development - - - - - - - - -


libsndfile Development

- -

-libsndfile is being developed by a small but growing community of users -and hackers led by Erik de Castro Lopo. -People interested in helping should join the libsndfile-devel - mailing list -where most of the discussion about new features takes place. -

- -

-The main repository can be found on Github: -

- -
- - https://github.com/erikd/libsndfile/ -
- -

-and includes - - instuctions -on how to build libsndfilefrom the Git repo. -

- - - - diff --git a/libs/libsndfile/doc/dither.html b/libs/libsndfile/doc/dither.html deleted file mode 100644 index 01a416f8b3..0000000000 --- a/libs/libsndfile/doc/dither.html +++ /dev/null @@ -1,1017 +0,0 @@ - - - - - - libsndfile : the sf_command function. - - - - - - - - - - - -

sf_command

-
-
-        int    sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
-

- This function allows the caller to retrieve information from or change aspects of the - library behaviour. - Examples include retrieving a string containing the library version or changing the - scaling applied to floating point sample data during read and write. - Most of these operations are performed on a per-file basis. -

-

- The cmd parameter is a integer identifier which is defined in <sndfile.h>. - All of the valid command identifiers have names begining with "SFC_". - Data is passed to and returned from the library by use of a void pointer. - The library will not read or write more than datasize bytes from the void pointer. - For some calls no data is required in which case data should be NULL and datasize - may be used for some other purpose. -

-

- The available commands are as follows: -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SFC_GET_LIB_VERSIONRetrieve the version of the library.
SFC_GET_LOG_INFORetrieve the internal per-file operation log.
SFC_CALC_SIGNAL_MAXRetrieve the measured maximum signal value.
SFC_CALC_NORM_SIGNAL_MAXRetrieve the measured normalised maximum signal value.
SFC_CALC_MAX_ALL_CHANNELSCalculate peaks for all channels.
SFC_CALC_NORM_MAX_ALL_CHANNELSCalculate normalised peaks for all channels.
SFC_SET_NORM_FLOATModify the normalisation behaviour of the floating point reading and writing functions.
SFC_SET_NORM_DOUBLEModify the normalisation behaviour of the double precision floating point reading and writing functions.
SFC_GET_NORM_FLOATRetrieve the current normalisation behaviour of the floating point reading and writing functions.
SFC_GET_NORM_DOUBLERetrieve the current normalisation behaviour of the double precision floating point reading and writing functions.
SFC_GET_SIMPLE_FORMAT_COUNTRetrieve the number of simple formats supported by libsndfile.
SFC_GET_SIMPLE_FORMATRetrieve information about a simple format.
SFC_GET_FORMAT_INFORetrieve information about a major or subtype format.
SFC_GET_FORMAT_MAJOR_COUNTRetrieve the number of major formats.
SFC_GET_FORMAT_MAJORRetrieve information about a major format type.
SFC_GET_FORMAT_SUBTYPE_COUNTRetrieve the number of subformats.
SFC_GET_FORMAT_SUBTYPERetrieve information about a subformat.
SFC_SET_ADD_PEAK_CHUNKSwitch the code for adding the PEAK chunk to WAV and AIFF files on or off.
SFC_UPDATE_HEADER_NOWUsed when a file is open for write, this command will update the file - header to reflect the data written so far.
SFC_SET_UPDATE_HEADER_AUTOUsed when a file is open for write, this command will cause the file header - to be updated after each write to the file.
SFC_FILE_TRUNCATETruncate a file open for write or for read/write.
SFC_SET_RAW_START_OFFSETChange the data start offset for files opened up as SF_FORMAT_RAW.
-
- -

- -
- - - -


SFC_GET_LIB_VERSION

-

-Retrieve the version of the library as a string. -

-

-Parameters: -

-        sndfile  : Not used
-        cmd      : SFC_GET_LIB_VERSION
-        data     : A pointer to a char buffer
-        datasize : The size of the the buffer
-
-

-Example: -

-
-        char  buffer [128] ;
-        sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_GET_LOG_INFO

-

-Retrieve the log buffer generated when opening a file as a string. This log -buffer can often contain a good reason for why libsndfile failed to open a -particular file. -

-

-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
-
-

-Example: -

-
-        char  buffer [2048] ;
-        sf_command (sndfile, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_CALC_SIGNAL_MAX

-

-Retrieve the measured maximum signal value. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_NORM_SIGNAL_MAX

-

-Retrieve the measured normailised maximum signal value. This involves reading -through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_NORM_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_MAX_ALL_CHANNELS

-

-Calculate peaks for all channels. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - -


SFC_CALC_NORM_MAX_ALL_CHANNELS

-

-Calculate normalised peaks for all channels. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_NORM_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - - - - - - - - -


SFC_SET_NORM_FLOAT

-

-This command only affects data read from or written to using the floating point functions: -

-
-	size_t    sf_read_float    (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_readf_float   (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-	size_t    sf_write_float   (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_writef_float  (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_FLOAT
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data from all -subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the float write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns 1 on success or 0 for failure. -
- - - -


SFC_SET_NORM_DOUBLE

-

-This command only affects data read from or written to using the double precision -floating point functions: -

-
-	size_t    sf_read_double    (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_readf_double   (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-	size_t    sf_write_double   (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_writef_double  (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_DOUBLE
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data -from all subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the double write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns 1 on success or 0 for failure. -
- - - -


SFC_GET_NORM_FLOAT

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_FLOAT
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_FLOAT, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normaisation is on and FALSE otherwise. -
- - - -


SFC_GET_NORM_DOUBLE

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_DOUBLE
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_DOUBLE, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normalisation is on and FALSE otherwise. -
- - - -


SFC_GET_SIMPLE_FORMAT_COUNT

-

-Retrieve the number of simple formats supported by libsndfile. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_SIMPLE_FORMAT

-

-Retrieve information about a simple format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_SIMPLE_FORMAT, the value of the format -field should be the format number (ie 0 <= format <= count value obtained using -SF_GET_SIMPLE_FORMAT_COUNT). -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field of the SF_FORMAT_INFO struct will be an value which - can be placed in the format field of an SF_INFO struct when a file is to be opened - for write. -
The name field will contain a char* pointer to the name of the string ie "WAV (Microsoft 16 bit PCM)". -
The extention field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_INFO

-

-Retrieve information about a major or subtype format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_INFO
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_FORMAT_INFO, the format field is -examined and if (format & SF_FORMAT_TYPEMASK) is a valid format then the struct -is filled in with information about the given major type. -If (format & SF_FORMAT_TYPEMASK) is FALSE and (format & SF_FORMAT_SUBMASK) is a -valid subtype format then the struct is filled in with information about the given -subtype. -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-
-        format_info.format = SF_FORMAT_WAV ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-
-        format_info.format = SF_FORMAT_ULAW ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s\n", format_info.format, format_info.name) ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
- - -


SFC_GET_FORMAT_MAJOR_COUNT

-

-Retrieve the number of major formats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_MAJOR

-

-Retrieve information about a major format type. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will one of the major format identifiers suc as SF_FORMAT_WAV - SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string ie "WAV (Microsoft)". -
The extention field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_SUBTYPE_COUNT

-

-Retrieve the number of subformats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int   count ;
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_SUBTYPE

-

-Retrieve information about a subformat. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-        /* Retrieve all the subtypes supported by the WAV format. */
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
-            if (! sf_format_check (format.info | SF_FORMAT_WAV))
-               continue ;
-            printf ("%08x  %s\n", format_info.format, format_info.name) ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will one of the major format identifiers such as SF_FORMAT_WAV - SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string; for instance - "WAV (Microsoft)" or "AIFF (Apple/SGI)". -
The extention field will be a NULL pointer. -
- - - -


SFC_SET_ADD_PEAK_CHUNK

-

-By default, WAV and AIFF files which contain floating point data (subtype SF_FORMAT_FLOAT -or SF_FORMAT_DOUBLE) have a PEAK chunk. -By using this command, the addition of a PEAK chunk can be turned on or off. -

-

-Note : This call must be made before any data is written to the file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_ADD_PEAK_CHUNK
-        data     : Not used (should be NULL)
-        datasize : TRUE or FALSE.
-
-

-Example: -

-
-        /* Turn on the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ;
-
-        /* Turn off the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns SF_TRUE if the peak chunk will be written after this call. -
Returns SF_FALSE if the peak chunk will not be written after this call. -
- - - -


SFC_UPDATE_HEADER_NOW

-

-The header of an audio file is normally written by libsndfile when the file is -closed using sf_close(). -

-

-There are however situations where large files are being generated and it would -be nice to have valid data in the header before the file is complete. -Using this command will update the file header to reflect the amount of data written -to the file so far. -Other programs opening the file for read (before any more data is written) will -then read a valid sound file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : Not used.
-
-

-Example: -

-
-        /* Update the header now. */
-        sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_SET_UPDATE_HEADER_AUTO

-

-Similar to SFC_UPDATE_HEADER_NOW but updates the header at the end of every call -to the sf_write* functions. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : SF_TRUE or SF_FALSE
-
-

-Example: -

-
-        /* Turn on auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ;
-
-        /* Turn off auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_FALSE) ;
-
-
-
Return value:
-
TRUE if auto update header is now on; FALSE otherwise. -
- - - -


SFC_FILE_TRUNCATE

-

-Truncate a file open for write or for read/write. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_FILE_TRUNCATE
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-Truncate the file to the number of frames specified by the sf_count_t pointed -to by data. -After this command, both the read and the write pointer will be -at the new end of the file. -This command will fail (returning non-zero) if the requested truncate position -is beyond the end of the file. -

-

-Example: -

-
-        /* Truncate the file to a length of 20 frames. */
-        sf_count_t  frames = 20 ;
-        sf_command (sndfile, SFC_FILE_TRUNCATE, &frames, sizeof (frames)) ;
-
-
-
Return value:
-
Zero on sucess, non-zero otherwise. -
- - - -


SFC_SET_RAW_START_OFFSET

-

-Change the data start offset for files opened up as SF_FORMAT_RAW. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_RAW_START_OFFSET
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-For a file opened as format SF_FORMAT_RAW, set the data offset to the value -given by data. -

-

-Example: -

-
-        /* Reset the data offset to 5 bytes from the start of the file. */
-        sf_count_t  offset = 5 ;
-        sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &offset, sizeof (offset)) ;
-
-
-
Return value:
-
Zero on sucess, non-zero otherwise. -
- - - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -
-Version : 1.0.25 -

- - - diff --git a/libs/libsndfile/doc/donate.html b/libs/libsndfile/doc/donate.html deleted file mode 100644 index c611f47ffd..0000000000 --- a/libs/libsndfile/doc/donate.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - libsndfile : donate. - - - - - - - - - - - -
- -
- libsndfile.jpg -
- -
- -

-Dear libsndfile user, -

- -

-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. -

- -

-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. -

- - -

-You are free to donate any amount you chose. -As a guideline: -

- -
    -
  • 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. -
  • -
  • 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. -
  • -
  • 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. -
  • -
- - -

-Donations can be made in Bitcoin to the Bitcoin address - 15hVWemFiH6DLJ22SBYPk9b4fgWtxBEvfQ - -which can be verified by checking the following GPG signature. -

- -
------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-----
-
- -

-Thanks and regards, -
-Erik de Castro Lopo -
-Main libsndfile author and maintainer -

- - - - - - - - diff --git a/libs/libsndfile/doc/embedded_files.html b/libs/libsndfile/doc/embedded_files.html deleted file mode 100644 index c73e86a3b5..0000000000 --- a/libs/libsndfile/doc/embedded_files.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - libsndfile : Embedded Sound Files. - - - - - - - - - - -

Embedded Sound Files.

- -

-By using the open SNDFILE with a file descriptor function: -

- -
-      SNDFILE*  sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
-
- -

-it is possible to open sound files embedded within larger files. -There are however a couple of caveats: -

- -

    -
  • Read/Write mode (SFM_RDWR) is not supported. -
  • Writing of embedded files is only supported at the end of the file. -
  • Reading of embedded files is only supported at file offsets greater - than zero. -
  • Not all file formats are supported (currently only WAV, AIFF and AU). -
- -

-The test program multi_file_test.c in the tests/ directory of the -source code tarball shows how this functionality is used to read and write -embedded files. -

- - - diff --git a/libs/libsndfile/doc/index.html b/libs/libsndfile/doc/index.html deleted file mode 100644 index bdd25aad10..0000000000 --- a/libs/libsndfile/doc/index.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - libsndfile - - - - - - - - - - - - -
- libsndfile.jpg -
- -
- History -+- - Features -+- - Similar or Related Projects -+- - News -
- Development -+- - Programming Interface -+- - Bug Reporting -+- - Download -
- FAQ -+- - Mailing Lists -+- - Change Log -+- - Licensing Information -+- - See Also -
- -

-

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

- -

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

-

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

- -

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

- -
    -
  • 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.
  • -
  • powerpc-apple-darwin7.0 (Mac OS X 10.3)
  • -
  • sparc-sun-solaris2.8 (using gcc)
  • -
  • mips-sgi-irix5.3 (using gcc)
  • -
  • QNX 6.0
  • -
  • i386-unknown-openbsd2.9
  • -
- -

- At the moment, each new release is being tested on i386 Linux, x86_64 Linux, - PowerPC Linux, Win32 and Win64. -

- - - - -

Features

-

- libsndfile has the following main features : -

-
    -
  • Ability to read and write a large number of file formats. -
  • A simple, elegant and easy to use Applications Programming Interface. -
  • Usable on Unix, Win32, MacOS and others. -
  • On the fly format conversion, including endian-ness swapping, type conversion - and bitwidth scaling. -
  • Optional normalisation when reading floating point data from files containing - integer data. -
  • Ability to open files in read/write mode. -
  • The ability to write the file header without closing the file (only on files - open for write or read/write). -
  • Ability to query the library about all supported formats and retrieve text - strings describing each format. -
-

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

-

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

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Micro- soft
WAV
SGI / Apple
AIFF / AIFC
Sun / DEC /
NeXT
AU / SND
Header- less
RAW
Paris Audio
File
PAF
Commo- dore
Amiga
IFF / SVX
Sphere
Nist
WAV
IRCAM
SF
Creative
VOC
Sound forge
W64
GNU Octave 2.0
MAT4
GNU Octave 2.1
MAT5
Portable Voice Format
PVF
Fasttracker 2
XI
HMM Tool Kit
HTK
Apple
CAF
Sound
Designer II
SD2
Free Lossless Audio Codec
FLAC
Unsigned 8 bit PCMR/WR/W R/W    R/WR/W R/W      
Signed 8 bit PCM R/WR/WR/WR/WR/WR/W     R/W  R/WR/WR/W
Signed 16 bit PCMR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/W R/WR/WR/WR/W
Signed 24 bit PCMR/WR/WR/WR/WR/W R/WR/W R/W     R/WR/WR/W
Signed 32 bit PCMR/WR/WR/WR/W  R/WR/W R/WR/WR/WR/W  R/W  
32 bit floatR/WR/WR/WR/W   R/W R/WR/WR/W   R/W  
64 bit doubleR/WR/WR/WR/W     R/WR/WR/W   R/W  
u-law encodingR/WR/WR/WR/W  R/WR/WR/WR/W     R/W  
A-law encodingR/WR/WR/WR/W  R/WR/WR/WR/W     R/W  
IMA ADPCMR/W        R/W        
MS ADPCMR/W        R/W        
GSM 6.10R/WR/W R/W     R/W        
G721 ADPCM 32kbpsR/W R/W               
G723 ADPCM 24kbps  R/W               
G723 ADPCM 40kbps  R/W               
12 bit DWVW R/W R/W              
16 bit DWVW R/W R/W              
24 bit DWVW R/W R/W              
Ok Dialogic ADPCM   R/W              
8 bit DPCM             R/W    
16 bit DPCM             R/W    
- -

-From version 1.0.18, libsndfile also reads and writes - FLAC -and - Ogg/Vorbis. -

- - - -

- Some of the file formats I am also interested in adding are: -

-
    -
  • Kurzweil K2000 sampler files. -
  • Ogg Speex. -
-

- 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 - - the FAQ - for more. -

-

- Other file formats may also be added on request. -

- - - - -

History

-

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

-

- Here is the release history for libsndfile : -

-
    -
  • Version 0.0.8 (Feb 15 1999) First official release. -
  • Version 0.0.28 (Apr 26 2002) Final release of version 0 of libsndfile. -
  • Version 1.0.0rc1 (Jun 24 2002) Release candidate 1 of version 1 of libsndfile. -
  • Version 1.0.0rc6 (Aug 14 2002) MacOS 9 fixes. -
  • Version 1.0.0 (Aug 16 2002) First 1.0.X release. -
  • Version 1.0.1 (Sep 14 2002) Added MAT4 and MAT5 file formats. -
  • Version 1.0.2 (Nov 24 2002) Added VOX ADPCM format. -
  • Version 1.0.3 (Dec 09 2002) Fixes for Linux on ia64 CPUs. -
  • Version 1.0.4 (Feb 02 2003) New file formats and functionality. -
  • Version 1.0.5 (May 03 2003) One new file format and new functionality. -
  • Version 1.0.6 (Feb 08 2004) Large file fix for Linux/Solaris, new functionality - and Win32 improvements. -
  • Version 1.0.7 (Feb 24 2004) Fix build problems on MacOS X and fix ia64/MIPS etc - clip mode detction. -
  • Version 1.0.8 (Mar 14 2004) Minor bug fixes. -
  • Version 1.0.9 (Mar 30 2004) Add AVR format. Improve handling of some WAV files. -
  • Version 1.0.10 (Jun 15 2004) Minor bug fixes. Fix support for Win32 MinGW compiler. -
  • Version 1.0.11 (Nov 15 2004) Add SD2 file support, reading of loop data in WAV and AIFF. - Minor bug fixes. -
  • Version 1.0.12 (Sep 30 2005) Add FLAC and CAF file support, virtual I/O interface. - Minor bug fixes and cleanups. -
  • Version 1.0.13 (Jan 21 2006) Add read/write of instrument chunks. Minor bug fixes. -
  • Version 1.0.14 (Feb 19 2006) Minor bug fixes. Start shipping windows binary/source ZIP. -
  • Version 1.0.15 (Mar 16 2006) Minor bug fixes. -
  • Version 1.0.16 (Apr 30 2006) Add support for RIFX. Other minor feature enhancements and - bug fixes. -
  • Version 1.0.17 (Aug 31 2006) Add C++ wrapper sndfile.hh. Minor bug fixes and cleanups. -
  • Version 1.0.18 (Feb 07 2009) Add Ogg/Vorbis suppport, remove captive libraries, many - new features and bug fixes. Generate Win32 and Win64 pre-compiled binaries. -
  • Version 1.0.19 (Mar 02 2009) Fix for CVE-2009-0186. Huge number of minor fixes as a - result of static analysis. -
  • Version 1.0.20 (May 14 2009) Fix for potential heap overflow. -
  • Version 1.0.21 (December 13 2009) Bunch of minor bug fixes. -
  • Version 1.0.22 (October 04 2010) Bunch of minor bug fixes. -
  • Version 1.0.23 (October 10 2010) Minor bug fixes. -
  • Version 1.0.24 (March 23 2011) Minor bug fixes. -
  • Version 1.0.25 (July 13 2011) Fix for Secunia Advisory SA45125. Minor bug fixes and - improvements. -
- - -

Similar or Related Projects

- -
    -
  • SoX is a program for - converting between sound file formats. -
  • Wavplay started out - as a minimal WAV file player under Linux and has mutated into Gnuwave, a client/server - application for more general multimedia and games sound playback. -
  • Audiofile (libaudiofile) is - a library similar to libsndfile but with a different programming interface. The - author Michael Pruett has set out to clone (and fix some bugs in) the libaudiofile - library which ships with SGI's IRIX OS. -
  • sndlib.tar.gz is - another library written by Bill Schottstaedt of CCRMA. -
- - -

Licensing

-

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

-

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

-

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

- - -

Download

-

- Here is the latest version. It is available in the following formats: -

- - -

-The Win32 installer was compiled for Windows XP but should also work on Windows -2000, Vista and Windows 7. -

- -

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

- - -

See Also

- - -

- -
- -

- The latest version of this document can be found - here. -

-

-Author : - - Erik de Castro Lopo -

- -

-This page has been accessed - counter.gif -times. -

- - - - -

- - diff --git a/libs/libsndfile/doc/libsndfile.css.in b/libs/libsndfile/doc/libsndfile.css.in deleted file mode 100644 index 40fca0f145..0000000000 --- a/libs/libsndfile/doc/libsndfile.css.in +++ /dev/null @@ -1,92 +0,0 @@ -body { - background : @HTML_BGCOLOUR@ ; - color : @HTML_FGCOLOUR@ ; - font-family : arial, helvetica, sans-serif ; - line-height: 1.5 ; -} -td { - font-family : arial, helvetica, sans-serif ; - background : @HTML_BGCOLOUR@ ; - color : @HTML_FGCOLOUR@ ; -} -center { - font-family : arial, helvetica, sans-serif ; -} -p { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -.indent_block { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 10% ; - margin-right : 10% ; -} -br { - font-family : arial, helvetica, sans-serif ; -} -form { - font-family : arial, helvetica, sans-serif ; -} -ul { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 6% ; -} -ol { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 6% ; -} -dl { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h1 { - font-size : xx-large ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h2 { - font-size : x-large ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h3 { - font-size : large ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h4 { - font-size : medium ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -pre { - font-family : courier, monospace ; - font-size : medium ; - margin-left : 6% ; - margin-right : 6% ; -} -a:link { color : #9090FF ; } -a:visited { color : #5050FF ; } -a:active { color : #FF00FF ; } -a:hover { background-color : #202080 ; } diff --git a/libs/libsndfile/doc/linux_games_programming.txt b/libs/libsndfile/doc/linux_games_programming.txt deleted file mode 100644 index 747f59db26..0000000000 --- a/libs/libsndfile/doc/linux_games_programming.txt +++ /dev/null @@ -1,434 +0,0 @@ -# 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 -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 -To: Paul -Subject: Re: Can you help with a problem? - -On Tue, 20 Jul 2004 22:49:21 +0100 -Paul 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 -To: Erik de Castro Lopo -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 -To: PFJ -Subject: Re: Can you help with a problem? - -On Wed, 21 Jul 2004 09:07:39 +0100 -PFJ 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 -To: Erik de Castro Lopo -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; - } - - - - /* 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 -To: PFJ -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 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... - diff --git a/libs/libsndfile/doc/lists.html b/libs/libsndfile/doc/lists.html deleted file mode 100644 index 7d95170271..0000000000 --- a/libs/libsndfile/doc/lists.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - libsndfile Mailing Lists - - - - - - - - -


libsndfile Mailing Lists

- -

-There are three mailing lists for libsndfile: -

- -
    -
  • libsndfile-announce@mega-nerd.com   - Subscribe -
    - A list which will announce each new release of libsndfile. - Noone can post to this list except the author. -

    - -
  • libsndfile-devel@mega-nerd.com   - Subscribe -
    - A list for discussing bugs, porting issues and feature requests. - Posting is restricted to subscribers. -

    - -
  • libsndfile-users@mega-nerd.com   - Subscribe -
    - A list for discussing the use of libsndfile in other programs. - Posting is restricted to subscribers. - -

    -
- -

-The libsndfile-devel and libsndfile-users list will automatically receive a -copy of all emails to the libsndfile-announce list. -

-
- - - diff --git a/libs/libsndfile/doc/new_file_type.HOWTO b/libs/libsndfile/doc/new_file_type.HOWTO deleted file mode 100644 index a6da80aeff..0000000000 --- a/libs/libsndfile/doc/new_file_type.HOWTO +++ /dev/null @@ -1,135 +0,0 @@ -new_file_type.HOWTO -=================== - - Original : Wed May 23 19:05:07 EST 2001 - Update 1 : Fri Jul 11 22:12:38 EST 2003 - -This document will attempt to explain as fully as possible how to add code to -libsndfile to allow the reading and writing of new file types. By new file -type I particularly mean a new header type rather than a new encoding method -for an existing file type. - -This HOWTO will take the form of a step by step guide. It will assume that you -have all required tools including : - - - gcc - - make (should really be the GNU version) - - autoconf - - automake - - libtool - -These should all be available on the GNU ftp site: ftp://ftp.gnu.org/pub/gnu/. - -To help make these steps clearer let's suppose we are adding support for the -Whacky file format whose files contain 'W','A','C' and 'K' as the first four -bytes of the file format. Lets also assume that Whacky files contain PCM encoded -data. - -Step 1 ------- -Create a new .c file in the src/ directory of the libsndfile source tree. The -file name should be reasonable descriptive so that is is obvious that files of -the new type are handled by this file. In this particular case the file might -be named 'whacky.c'. - -Step 2 ------- -Add your new source code file to the build process. - -Edit the file src/Makefile.am and add the name of your file handler to the -FILESPECIFIC list of handlers. This list looks something like this: - -FILESPECIFIC = aiff.c au.c au_g72x.c nist.c paf.c raw.c samplitude.c \ - svx.c wav.c wav_float.c wav_gsm610.c wav_ima_adpcm.c \ - wav_ms_adpcm.c - -Then, run the script named 'reconf' in the libsndfile top level directory, -which will run autoconf and other associated tools. Finally run "./configure" -in the top level directory. You may want to use the "--disable-gcc-opt" option -to disable gcc optimisations and make debugging with gdb/ddd easier. - -Step 3 ------- -Add a unique identifier for the new file type. - -Edit src/sndfile.h.in and find the enum containing the SF_FORMAT_XXX identifiers. -Since you will be adding a major file type you should add your identifier to the -top part of the list where the values are above 0x10000 in value. The easiest -way to do this is to find the largest value in the list, add 0x10000 to it and -make that your new identifier value. The identifier should be something like -SF_FORMAT_WACK. - -Step 4 ------- -Add code to the file type recogniser function. - -Edit src/sndfile.c and find the function guess_file_type (). This function -reads the first 3 ints of the file and from that makes a guess at the file -type. In our case we would add: - - - if (buffer [0] == MAKE_MARKER ('W','A','C','K')) - return SF_FORMAT_WACK ; - -The use of the MAKE_MARKER macro should be pretty obvious and it is defined at the -top of file should you need to have a look at it. - -Step 5 ------- -Add a call to your open function from psf_open_file (). - -Edit src/sndfile.c and find the switch statement in psf_open_file (). It starts -like this: - - switch (filetype) - { case SF_FORMAT_WAV : - error = wav_open (psf) ; - break ; - - case SF_FORMAT_AIFF : - error = aiff_open (psf) ; - break ; - -Towards the bottom of this switch statement your should add one for the new file -type. Something like: - - case SF_FORMAT_WACK : - sf_errno = whacky_open (psf) ; - break ; - -Setp 6 ------- -Add prototypes for new open read and open write functions. - -Edit src/common.h, go to the bottom of the file and add something like - - int whacky_open (SF_PRIVATE *psf) ; - -Step 7 ------- - -Implement your open read function. The best way to do this is by coding -something much like one of the other file formats. The file src/au.c might be -a good place to start. - -In src/whacky.c you should now implement the function whacky_open() which -was prototyped in src/common.h. This function should return 0 on success and -a non-zero number on error. - -Error values are defined in src/common.h in a enum which starts at SFE_NO_ERROR. -When adding a new error value, you also need to add an error string to the -SndfileErrors array in src/sndfile.c. - -To parse the header of your new file type you should avoid using standard read/ -write/seek functions (and the fread/fwrite/fseek etc) and instead use -psf_binheader_readf () which is implemented and documented in src/common.h. - -During the parsing process, you should also print logging information to -libsndfile's internal log buffer using the psf_log_printf() function. - -At the end of the open read process, you should have set a number of fields in the -SF_PRIVATE structure pointed to by psf. - - - -*** THIS FILE IS INCOMPLETE *** diff --git a/libs/libsndfile/doc/octave.html b/libs/libsndfile/doc/octave.html deleted file mode 100644 index b696e6b81a..0000000000 --- a/libs/libsndfile/doc/octave.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - libsndfile and GNU Octave - - - - - - - - -
-

libsndfile and GNU Octave

-

- GNU Octave 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 - MATLAB. - 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 - format. -

-

- 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. -

-

- For instance it is now possible to do the following: -

- -
    -
  • Load a WAV file into a sound file editor such as - Sweep. -
  • Save it as a MAT4 file. -
  • Load the data into Octave for manipulation. -
  • Save the modified data. -
  • Reload it in Sweep. -
-

- 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 - which can be played with command line players such as the one included with - libsndfile. -

- -

Details

-

- Octave, like most programming languages, uses variables to store data, and - Octave variables can contain both arrays and matrices. - It is also able to store one or more of these variables in a file. - When reading Octave files, libsndfile expects a file to contain two - variables and their associated data. - The first variable should contain a variable holding the file sample rate - while the second variable contains the audio data. -

-

- For example, to generate a sine wave and store it as a binary file which - is compatible with libsndfile, do the following: -

-
-        octave:1 > samplerate = 44100 ;
-        octave:2 > wavedata = sin ((0:1023)*2*pi/1024) ;
-        octave:3 > save sine.mat samplerate wavedata
-
- -

- The process of reading and writing files compatible with libsndfile can be - made easier by use of two Octave script files : -

-
-        octave:4 > [data fs] = sndfile_load ("sine.mat") ;
-        octave:5 > sndfile_save ("sine2.mat", data, fs) ;
-
-

- 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 sndfile-play and a third Octave script - file allows Octave data to be played from within Octave on any of the platforms - which sndfile-play supports (at the moment: Linux, MacOS X, Solaris and - Win32). -

-
-        octave:6 > sndfile_play (data, fs) ;
-
-

- These three Octave scripts are installed automatically in Octave's site - script directory when libsndfile is installed (except on Win32) ie when - libsndfile is being installed into /usr/local, the Octave scripts will - be installed in /usr/local/share/octave/site/m/. -

- -

- There are some other Octave scripts for audio to be found - here. -

- -
- - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -

- - - diff --git a/libs/libsndfile/doc/pkgconfig.html b/libs/libsndfile/doc/pkgconfig.html deleted file mode 100644 index c89193d1ed..0000000000 --- a/libs/libsndfile/doc/pkgconfig.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - libsndfile : pkg-config - - - - - - - - -
-

libsndfile and pkg-config

- -

- 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. -

-

- 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. -

-

- 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. -

-

- The pkg-config program makes finding the correct compiler flag values and - library location far easier. - During the installation of libsndfile, a file named sndfile.pc is installed - in the directory ${libdir}/pkgconfig (ie if libsndfile is installed in - /usr/local/lib, sndfile.pc will be installed in - /usr/local/lib/pkgconfig/). -

-

- In order for pkg-config to find sndfile.pc it may be necessary to point the - environment variable PKG_CONFIG_PATH in the right direction. -

-
-        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-	
- -

- Then, to compile a C file into an object file, the command would be: -

-
-        gcc `pkg-config --cflags sndfile` -c somefile.c
-	
-

- and to link a number of objects into an executable that links against libsndfile, - the command would be: -

-
-        gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
-	
- -

- Obviously all this can be rolled into a Makefile for easier maintenance. -

- - diff --git a/libs/libsndfile/doc/print.css b/libs/libsndfile/doc/print.css deleted file mode 100644 index deb5b13da0..0000000000 --- a/libs/libsndfile/doc/print.css +++ /dev/null @@ -1,14 +0,0 @@ -body { - background:white; - color:black; -} - -h1{ - background:white; - color:black; -} - -h2 { - background:white; - color:#666; -} diff --git a/libs/libsndfile/doc/sndfile_info.html b/libs/libsndfile/doc/sndfile_info.html deleted file mode 100644 index a84f24150f..0000000000 --- a/libs/libsndfile/doc/sndfile_info.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - sndfile-info - - - - - - - - -

- Here is an example of the output from the sndfile-info program distributed with - libsndfile. -

- -

- This file was opened and parsed correctly but had been truncated so that the values - in the FORM and SSND chunks were incorrect. -

-
-        erikd@hendrix > examples/sndfile-info truncated.aiff 
-        truncated.aiff
-        size : 200000
-        FORM : 307474 (should be 199992)
-         AIFF
-         COMM : 18
-          Sample Rate : 16000
-          Samples     : 76857
-          Channels    : 2
-          Sample Size : 16
-         SSND : 307436 (should be 199946)
-          Offset     : 0
-          Block Size : 0
-        
-        --------------------------------
-        Sample Rate : 16000
-        Frames      : 76857
-        Channels    : 2
-        Bit Width   : 16
-        Format      : 0x00020001
-        Sections    : 1
-        Seekable    : TRUE
-        Signal Max  : 32766
-        	
-
- - - - diff --git a/libs/libsndfile/doc/tutorial.html b/libs/libsndfile/doc/tutorial.html deleted file mode 100644 index e3112393ad..0000000000 --- a/libs/libsndfile/doc/tutorial.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - libsndfile Tutorial - - - - - - - - -


libsndfile Tutorial

- -

-More coming soon. -

- -

-For now, the best place to look for example code is the examples/ -directory of the source code distribution and the libsndfile test suite which -is located in the tests/ directory of the source code distribution. -

- - - - - - - - - diff --git a/libs/libsndfile/doc/win32.html b/libs/libsndfile/doc/win32.html deleted file mode 100644 index 6ee3153c7d..0000000000 --- a/libs/libsndfile/doc/win32.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Building libsndfile on Win32 - - - - - - - - -


Building libsndfile on Win32

- -

-Note : For pre-compiled binaries for windows, both for win32 and win64, see the -main web page. -

- -

-There is currently only one way of building libsndfile for Win32 and Win64; -cross compiling from Linux using the MinGW cross compiler. -

- -

-libsndfile is written to be compiled by a compiler which supports large -chunks of the 1999 ISO C Standard. -Unfortunately, the microsoft compiler supports close to nothing of this -standard and hence is not suitable for libsndfile. -

- -

-It may be possible to compile libsndfile on windows using the - MinGW -compiler suite, but I haven't tested that and have no interest in supporting -that. -

- - - - - - -
- - - - - - - diff --git a/libs/libsndfile/echo-install-dirs.in b/libs/libsndfile/echo-install-dirs.in deleted file mode 100644 index 48d54b4e2d..0000000000 --- a/libs/libsndfile/echo-install-dirs.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# @configure_input@ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ -pkgconfigdir=@pkgconfigdir@ -datadir=@datadir@ -datarootdir=@datarootdir@ -docdir=@docdir@ -htmldir=@htmldir@ - -echo " - Installation directories : - - Library directory : ................... $libdir - Program directory : ................... $bindir - Pkgconfig directory : ................. $pkgconfigdir - HTML docs directory : ................. $htmldir -" -echo "Compiling some other packages against libsndfile may require" -echo "the addition of '$pkgconfigdir' to the" -echo "PKG_CONFIG_PATH environment variable." -echo diff --git a/libs/libsndfile/examples/Makefile.am b/libs/libsndfile/examples/Makefile.am deleted file mode 100644 index da841fa218..0000000000 --- a/libs/libsndfile/examples/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## Process this file with automake to produce Makefile.in - -noinst_PROGRAMS = make_sine sfprocess list_formats generate sndfilehandle sndfile-to-text - -AM_CPPFLAGS = -I$(top_srcdir)/src - -sndfile_to_text_SOURCES = sndfile-to-text.c -sndfile_to_text_LDADD = $(top_builddir)/src/libsndfile.la - -make_sine_SOURCES = make_sine.c -make_sine_LDADD = $(top_builddir)/src/libsndfile.la - -sfprocess_SOURCES = sfprocess.c -sfprocess_LDADD = $(top_builddir)/src/libsndfile.la - -list_formats_SOURCES = list_formats.c -list_formats_LDADD = $(top_builddir)/src/libsndfile.la - -generate_SOURCES = generate.c -generate_LDADD = $(top_builddir)/src/libsndfile.la - -sndfilehandle_SOURCES = sndfilehandle.cc -sndfilehandle_LDADD = $(top_builddir)/src/libsndfile.la - -CLEANFILES = *~ *.exe diff --git a/libs/libsndfile/examples/cooledit-fixer.c b/libs/libsndfile/examples/cooledit-fixer.c deleted file mode 100644 index 06ceae6a92..0000000000 --- a/libs/libsndfile/examples/cooledit-fixer.c +++ /dev/null @@ -1,231 +0,0 @@ -/* -** Copyright (C) 2002-2005 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - -static void usage_exit (char *progname) ; -static int is_data_really_float (SNDFILE *sndfile) ; -static void fix_file (char *filename) ; -static off_t file_size (char *filename) ; - -static union -{ int i [BUFFER_LEN] ; - float f [BUFFER_LEN] ; -} buffer ; - -int -main (int argc, char *argv []) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, data_is_float, converted = 0 ; - - puts ("\nCooledit Fixer.\n---------------") ; - - if (argc < 2) - usage_exit (argv [0]) ; - - for (k = 1 ; k < argc ; k++) - { if ((sndfile = sf_open (argv [k], SFM_READ, &sfinfo)) == NULL) - { /*-printf ("Failed to open : %s\n", argv [k]) ;-*/ - continue ; - } ; - - if (sfinfo.format != (SF_FORMAT_WAV | SF_FORMAT_PCM_32)) - { /*-printf ("%-50s : not a 32 bit PCM WAV file.\n", argv [k]) ;-*/ - sf_close (sndfile) ; - continue ; - } ; - - data_is_float = is_data_really_float (sndfile) ; - - sf_close (sndfile) ; - - if (data_is_float == SF_FALSE) - { /*-printf ("%-50s : not a Cooledit abomination.\n", argv [k]) ;-*/ - continue ; - } ; - - fix_file (argv [k]) ; - converted ++ ; - } ; - - if (converted == 0) - puts ("\nNo files converted.") ; - - puts ("") ; - - return 0 ; -} /* main */ - - -static void -usage_exit (char *progname) -{ char *cptr ; - - if ((cptr = strrchr (progname, '/'))) - progname = cptr + 1 ; - if ((cptr = strrchr (progname, '\\'))) - progname = cptr + 1 ; - - printf ("\n Usage : %s \n", progname) ; - puts ("\n" - "Fix broken files created by Syntrillium's Cooledit. These files are \n" - "marked as containing PCM data but actually contain floating point \n" - "data. Only the broken files created by Cooledit are processed. All \n" - "other files remain untouched.\n" - "\n" - "More than one file may be included on the command line. \n" - ) ; - - exit (1) ; -} /* usage_exit */ - -static int -is_data_really_float (SNDFILE *sndfile) -{ int k, readcount ; - - while ((readcount = sf_read_int (sndfile, buffer.i, BUFFER_LEN)) > 0) - { for (k = 0 ; k < readcount ; k++) - { if (buffer.i [k] == 0) - continue ; - - if (fabs (buffer.f [k]) > 32768.0) - return SF_FALSE ; - } ; - } ; - - return SF_TRUE ; -} /* is_data_really_float */ - -static void -fix_file (char *filename) -{ static char newfilename [512] ; - - SNDFILE *infile, *outfile ; - SF_INFO sfinfo ; - int readcount, k ; - float normfactor ; - char *cptr ; - - printf ("\nFixing : %s\n", filename) ; - - if ((infile = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s\n", filename) ; - exit (1) ; - } ; - - if (strlen (filename) >= sizeof (newfilename) - 1) - { puts ("Error : Path name too long.\n") ; - exit (1) ; - } ; - - strncpy (newfilename, filename, sizeof (newfilename)) ; - newfilename [sizeof (newfilename) - 1] = 0 ; - - if ((cptr = strrchr (newfilename, '/')) == NULL) - cptr = strrchr (newfilename, '\\') ; - - if (cptr) - { cptr [1] = 0 ; - strncat (newfilename, "fixed.wav", sizeof (newfilename) - strlen (newfilename) - 1) ; - } - else - strncpy (newfilename, "fixed.wav", sizeof (newfilename) - 1) ; - - newfilename [sizeof (newfilename) - 1] = 0 ; - - printf (" Output : %s\n", newfilename) ; - - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_FLOAT ; - - if ((outfile = sf_open (newfilename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to output open file %s\n", filename) ; - exit (1) ; - } ; - - /* Find the file peak. sf-command (SFC_CALC_SIGNAL_MAX) cannot be used. */ - - normfactor = 0.0 ; - - while ((readcount = sf_read_int (infile, buffer.i, BUFFER_LEN)) > 0) - { for (k = 0 ; k < readcount ; k++) - if (fabs (buffer.f [k]) > normfactor) - normfactor = fabs (buffer.f [k]) ; - } ; - - printf (" Peak : %g\n", normfactor) ; - - normfactor = 1.0 / normfactor ; - - sf_seek (infile, 0, SEEK_SET) ; - - while ((readcount = sf_read_int (infile, buffer.i, BUFFER_LEN)) > 0) - { for (k = 0 ; k < readcount ; k++) - buffer.f [k] *= normfactor ; - sf_write_float (outfile, buffer.f, readcount) ; - } ; - - sf_close (infile) ; - sf_close (outfile) ; - - if (abs (file_size (filename) - file_size (newfilename)) > 50) - { puts ("Error : file size mismatch.\n") ; - exit (1) ; - } ; - - printf (" Renaming : %s\n", filename) ; - - if (remove (filename) != 0) - { perror ("rename") ; - exit (1) ; - } ; - - if (rename (newfilename, filename) != 0) - { perror ("rename") ; - exit (1) ; - } ; - - return ; -} /* fix_file */ - -static off_t -file_size (char *filename) -{ struct stat buf ; - - if (stat (filename, &buf) != 0) - { perror ("stat") ; - exit (1) ; - } ; - - return buf.st_size ; -} /* file_size */ -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 5475655e-3898-40ff-969b-c8ab2351b0e4 -*/ diff --git a/libs/libsndfile/examples/generate.c b/libs/libsndfile/examples/generate.c deleted file mode 100644 index 884e8d79d3..0000000000 --- a/libs/libsndfile/examples/generate.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#define BUFFER_LEN 4096 - -static void encode_file (const char *infilename, const char *outfilename, int filetype) ; - -int -main (int argc, char **argv) -{ - if (argc != 2) - { puts ("\nEncode a single input file into a number of different output ") ; - puts ("encodings. These output encodings can then be moved to another ") ; - puts ("OS for testing.\n") ; - puts (" Usage : generate \n") ; - exit (1) ; - } ; - - /* A couple of standard WAV files. Make sure Win32 plays these. */ - encode_file (argv [1], "pcmu8.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_U8) ; - encode_file (argv [1], "pcm16.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - encode_file (argv [1], "imaadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM) ; - encode_file (argv [1], "msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM) ; - encode_file (argv [1], "gsm610.wav" , SF_FORMAT_WAV | SF_FORMAT_GSM610) ; - - /* Soundforge W64. */ - encode_file (argv [1], "pcmu8.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_U8) ; - encode_file (argv [1], "pcm16.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - encode_file (argv [1], "imaadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM) ; - encode_file (argv [1], "msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM) ; - encode_file (argv [1], "gsm610.w64" , SF_FORMAT_W64 | SF_FORMAT_GSM610) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Helper functions and macros. -*/ - -#define PUT_DOTS(k) \ - { while (k--) \ - putchar ('.') ; \ - putchar (' ') ; \ - } - -/*======================================================================================== -*/ - -static void -encode_file (const char *infilename, const char *outfilename, int filetype) -{ static float buffer [BUFFER_LEN] ; - - SNDFILE *infile, *outfile ; - SF_INFO sfinfo ; - int k, readcount ; - - printf (" %s -> %s ", infilename, outfilename) ; - fflush (stdout) ; - - k = 16 - strlen (outfilename) ; - PUT_DOTS (k) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if (! (infile = sf_open (infilename, SFM_READ, &sfinfo))) - { printf ("Error : could not open file : %s\n", infilename) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } - - sfinfo.format = filetype ; - - if (! sf_format_check (&sfinfo)) - { sf_close (infile) ; - printf ("Invalid encoding\n") ; - return ; - } ; - - if (! (outfile = sf_open (outfilename, SFM_WRITE, &sfinfo))) - { printf ("Error : could not open file : %s\n", outfilename) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - while ((readcount = sf_read_float (infile, buffer, BUFFER_LEN)) > 0) - sf_write_float (outfile, buffer, readcount) ; - - sf_close (infile) ; - sf_close (outfile) ; - - printf ("ok\n") ; - - return ; -} /* encode_file */ - diff --git a/libs/libsndfile/examples/generate.cs b/libs/libsndfile/examples/generate.cs deleted file mode 100644 index 1817856fa7..0000000000 --- a/libs/libsndfile/examples/generate.cs +++ /dev/null @@ -1,250 +0,0 @@ -/* (c) 2004 James Robson, http://www.arbingersys.com -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -** -** **************************** -** -** How to use: -** - libsndfile.dll must have already been compiled and be in this -** application's search path -** -** - You must edit this file to point to the file you want to convert. Set -** the following line of code (found in the Main() function further below) -** to the name of a .WAV file that exists on your system. -** 186: string sfn = "input.wav"; -** -** - From a command prompt type -** csc generate.cs -** -** - Run the resulting executable 'generate.exe' -** -** -** Note: You will obviously need the csc compiler and the .NET runtime. I think -** these are freely available for download from Microsoft's website -** (part of the .NET SDK?). -*/ - - -using System; -using System.Runtime.InteropServices; -using sf_count_t = System.Int64; //alias; see SF_INFO struct - -#if PLATFORM_64 -using size_t = System.UInt64; -#else -using size_t = System.UInt32; -#endif - - -class lsndf_example { - - -//sound file formats - public enum lsndf_frmts { - SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian). */ - SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */ - SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */ - SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */ - SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */ - SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */ - SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */ - SF_FORMAT_VOC = 0x080000, /* VOC files. */ - SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */ - SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */ - SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */ - SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */ - SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */ - SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */ - SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */ - SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */ - - /* Subtypes from here on. */ - - SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */ - SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */ - SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */ - SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */ - - SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */ - - SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */ - SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */ - - SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */ - SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */ - SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */ - SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */ - - SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */ - SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */ - - SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */ - SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */ - SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */ - - SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */ - - SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */ - SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */ - - - /* Endian-ness options. */ - - SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */ - SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */ - SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */ - SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */ - - SF_FORMAT_SUBMASK = 0x0000FFFF, - SF_FORMAT_TYPEMASK = 0x0FFF0000, - SF_FORMAT_ENDMASK = 0x30000000 - } - - -//modes and other - public enum lsndf_tf - { /* True and false */ - SF_FALSE = 0, - SF_TRUE = 1, - - /* Modes for opening files. */ - SFM_READ = 0x10, - SFM_WRITE = 0x20, - SFM_RDWR = 0x30 - } - - -//important SF_INFO structure - [StructLayout(LayoutKind.Sequential)] - public struct SF_INFO - { - public sf_count_t frames ; // Used to be called samples. Changed to avoid confusion. - public int samplerate ; - public int channels ; - public int format ; - public int sections ; - public int seekable ; - }; - - -//function declarations -//Note: Not all functions have been prototyped here. Only the ones necessary to -// make this application work. The below code should give some clues as to -// how to add the rest since they have a lot of parameter and return type -// similarities. - [DllImport("libsndfile.dll")] - public static extern IntPtr sf_open ([MarshalAs(UnmanagedType.LPStr)] string path, int mode, ref SF_INFO sfinfo); - - [DllImport("libsndfile.dll")] - static extern int sf_error (IntPtr sndfile); - - [DllImport("libsndfile.dll")] - static extern IntPtr sf_strerror (IntPtr sndfile); - - [DllImport("libsndfile.dll")] - static extern int sf_format_check (ref SF_INFO info); - - [DllImport("libsndfile.dll")] - static extern sf_count_t sf_read_float (IntPtr sndfile, float[] ptr, sf_count_t items); - - [DllImport("libsndfile.dll")] - static extern sf_count_t sf_write_float (IntPtr sndfile, float[] ptr, sf_count_t items); - - [DllImport("libsndfile.dll")] - static extern int sf_close (IntPtr sndfile); - - - public const sf_count_t BUFFER_LEN = 4096; - - -//program entry - static void Main( ) { - - -//declarations - SF_INFO sfinfo = new SF_INFO(); - float[] buffer = new float[BUFFER_LEN]; - sf_count_t rcnt; - -//set the input file - string sfn = "input.wav"; //set to a file on YOUR system - //string sfn = "noexist.wav"; //test with non-existent file - -//set the output file - string ofn = "output.wav"; - -//read in sound file to convert - IntPtr infile = sf_open (sfn, (int)lsndf_tf.SFM_READ, ref sfinfo); - -//exit if error was thrown - if ( (int)infile == 0 ) { - Console.WriteLine("Error opening " + sfn); - Console.WriteLine("Error #" + sf_error(infile)); - return; - } - -//set the file type for the output file -//uncomment one and only one of the statements below to change the output -//file encoding. - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_PCM_U8); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_PCM_16); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_MS_ADPCM); - sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_IMA_ADPCM); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_GSM610); - /* Soundforge W64. */ - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_PCM_U8); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_PCM_16); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_MS_ADPCM); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_IMA_ADPCM); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_GSM610); - - -//check that SF_INFO is valid - if ( sf_format_check(ref sfinfo) == 0 ) { - Console.WriteLine("sf_format_check failed. Invalid encoding"); - return; - } - -//open output file - IntPtr outfile = sf_open (ofn, (int)lsndf_tf.SFM_WRITE, ref sfinfo); - -//exit if error was thrown - if ( (int)outfile == 0 ) { - Console.WriteLine("Error opening " + ofn); - Console.WriteLine("Error #" + sf_error(outfile)); - return; - } - -//infile -> outfile - Console.Write(sfn + " -> " + ofn); - while ( (rcnt = sf_read_float (infile, buffer, BUFFER_LEN)) > 0) { - Console.Write("."); - sf_write_float (outfile, buffer, BUFFER_LEN); - } - Console.WriteLine("done."); - -//close up shop - sf_close(infile); - sf_close(outfile); - - - } //main() - - -} //class lsndf_example {} - diff --git a/libs/libsndfile/examples/list_formats.c b/libs/libsndfile/examples/list_formats.c deleted file mode 100644 index 6d462f0790..0000000000 --- a/libs/libsndfile/examples/list_formats.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -int -main (void) -{ SF_FORMAT_INFO info ; - SF_INFO sfinfo ; - char buffer [128] ; - int format, major_count, subtype_count, m, s ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - buffer [0] = 0 ; - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - if (strlen (buffer) < 1) - { printf ("Line %d: could not retrieve lib version.\n", __LINE__) ; - exit (1) ; - } ; - printf ("Version : %s\n\n", buffer) ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &subtype_count, sizeof (int)) ; - - sfinfo.channels = 1 ; - for (m = 0 ; m < major_count ; m++) - { info.format = m ; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; - printf ("%s (extension \"%s\")\n", info.name, info.extension) ; - - format = info.format ; - - for (s = 0 ; s < subtype_count ; s++) - { info.format = s ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) ; - - format = (format & SF_FORMAT_TYPEMASK) | info.format ; - - sfinfo.format = format ; - if (sf_format_check (&sfinfo)) - printf (" %s\n", info.name) ; - } ; - puts ("") ; - } ; - puts ("") ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/examples/make_sine.c b/libs/libsndfile/examples/make_sine.c deleted file mode 100644 index 1db0e00d26..0000000000 --- a/libs/libsndfile/examples/make_sine.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define SAMPLE_RATE 44100 -#define SAMPLE_COUNT (SAMPLE_RATE * 4) /* 4 seconds */ -#define AMPLITUDE (1.0 * 0x7F000000) -#define LEFT_FREQ (344.0 / SAMPLE_RATE) -#define RIGHT_FREQ (466.0 / SAMPLE_RATE) - -int -main (void) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - int *buffer ; - - if (! (buffer = malloc (2 * SAMPLE_COUNT * sizeof (int)))) - { printf ("Malloc failed.\n") ; - exit (0) ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = SAMPLE_COUNT ; - sfinfo.channels = 2 ; - sfinfo.format = (SF_FORMAT_WAV | SF_FORMAT_PCM_24) ; - - if (! (file = sf_open ("sine.wav", SFM_WRITE, &sfinfo))) - { printf ("Error : Not able to open output file.\n") ; - return 1 ; - } ; - - if (sfinfo.channels == 1) - { for (k = 0 ; k < SAMPLE_COUNT ; k++) - buffer [k] = AMPLITUDE * sin (LEFT_FREQ * 2 * k * M_PI) ; - } - else if (sfinfo.channels == 2) - { for (k = 0 ; k < SAMPLE_COUNT ; k++) - { buffer [2 * k] = AMPLITUDE * sin (LEFT_FREQ * 2 * k * M_PI) ; - buffer [2 * k + 1] = AMPLITUDE * sin (RIGHT_FREQ * 2 * k * M_PI) ; - } ; - } - else - { printf ("makesine can only generate mono or stereo files.\n") ; - exit (1) ; - } ; - - if (sf_write_int (file, buffer, sfinfo.channels * SAMPLE_COUNT) != - sfinfo.channels * SAMPLE_COUNT) - puts (sf_strerror (file)) ; - - sf_close (file) ; - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/examples/sfprocess.c b/libs/libsndfile/examples/sfprocess.c deleted file mode 100644 index 1c141a4981..0000000000 --- a/libs/libsndfile/examples/sfprocess.c +++ /dev/null @@ -1,142 +0,0 @@ -/* -** Copyright (C) 2001-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include - -/* Include this header file to use functions from libsndfile. */ -#include - -/* This will be the length of the buffer used to hold.frames while -** we process them. -*/ -#define BUFFER_LEN 1024 - -/* libsndfile can handle more than 6 channels but we'll restrict it to 6. */ -#define MAX_CHANNELS 6 - -/* Function prototype. */ -static void process_data (double *data, int count, int channels) ; - - -int -main (void) -{ /* This is a buffer of double precision floating point values - ** which will hold our data while we process it. - */ - static double data [BUFFER_LEN] ; - - /* A SNDFILE is very much like a FILE in the Standard C library. The - ** sf_open function return an SNDFILE* pointer when they sucessfully - ** open the specified file. - */ - SNDFILE *infile, *outfile ; - - /* A pointer to an SF_INFO struct is passed to sf_open. - ** On read, the library fills this struct with information about the file. - ** On write, the struct must be filled in before calling sf_open. - */ - SF_INFO sfinfo ; - int readcount ; - const char *infilename = "input.wav" ; - const char *outfilename = "output.wav" ; - - /* The SF_INFO struct must be initialized before using it. - */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Here's where we open the input file. We pass sf_open the file name and - ** a pointer to an SF_INFO struct. - ** On successful open, sf_open returns a SNDFILE* pointer which is used - ** for all subsequent operations on that file. - ** If an error occurs during sf_open, the function returns a NULL pointer. - ** - ** If you are trying to open a raw headerless file you will need to set the - ** format and channels fields of sfinfo before calling sf_open(). For - ** instance to open a raw 16 bit stereo PCM file you would need the following - ** two lines: - ** - ** sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ; - ** sfinfo.channels = 2 ; - */ - if (! (infile = sf_open (infilename, SFM_READ, &sfinfo))) - { /* Open failed so print an error message. */ - printf ("Not able to open input file %s.\n", infilename) ; - /* Print the error message from libsndfile. */ - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - if (sfinfo.channels > MAX_CHANNELS) - { printf ("Not able to process more than %d channels\n", MAX_CHANNELS) ; - return 1 ; - } ; - /* Open the output file. */ - if (! (outfile = sf_open (outfilename, SFM_WRITE, &sfinfo))) - { printf ("Not able to open output file %s.\n", outfilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - /* While there are.frames in the input file, read them, process - ** them and write them to the output file. - */ - while ((readcount = sf_read_double (infile, data, BUFFER_LEN))) - { process_data (data, readcount, sfinfo.channels) ; - sf_write_double (outfile, data, readcount) ; - } ; - - /* Close input and output files. */ - sf_close (infile) ; - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -process_data (double *data, int count, int channels) -{ double channel_gain [MAX_CHANNELS] = { 0.5, 0.8, 0.1, 0.4, 0.4, 0.9 } ; - int k, chan ; - - /* Process the data here. - ** If the soundfile contains more then 1 channel you need to take care of - ** the data interleaving youself. - ** Current we just apply a channel dependant gain. - */ - - for (chan = 0 ; chan < channels ; chan ++) - for (k = chan ; k < count ; k+= channels) - data [k] *= channel_gain [chan] ; - - return ; -} /* process_data */ - diff --git a/libs/libsndfile/examples/sndfile-convert.c b/libs/libsndfile/examples/sndfile-convert.c deleted file mode 100644 index e1422579bd..0000000000 --- a/libs/libsndfile/examples/sndfile-convert.c +++ /dev/null @@ -1,376 +0,0 @@ -/* -** Copyright (C) 1999-2005 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - - -typedef struct -{ char *infilename, *outfilename ; - SF_INFO infileinfo, outfileinfo ; -} OptionData ; - -typedef struct -{ const char *ext ; - int len ; - int format ; -} OUTPUT_FORMAT_MAP ; - -static void copy_metadata (SNDFILE *outfile, SNDFILE *infile) ; -static void copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels) ; -static void copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) ; - -static OUTPUT_FORMAT_MAP format_map [] = -{ - { "aif", 3, SF_FORMAT_AIFF }, - { "wav", 0, SF_FORMAT_WAV }, - { "au", 0, SF_FORMAT_AU }, - { "caf", 0, SF_FORMAT_CAF }, - { "flac", 0, SF_FORMAT_FLAC }, - { "snd", 0, SF_FORMAT_AU }, - { "svx", 0, SF_FORMAT_SVX }, - { "paf", 0, SF_ENDIAN_BIG | SF_FORMAT_PAF }, - { "fap", 0, SF_ENDIAN_LITTLE | SF_FORMAT_PAF }, - { "gsm", 0, SF_FORMAT_RAW }, - { "nist", 0, SF_FORMAT_NIST }, - { "ircam", 0, SF_FORMAT_IRCAM }, - { "sf", 0, SF_FORMAT_IRCAM }, - { "voc", 0, SF_FORMAT_VOC }, - { "w64", 0, SF_FORMAT_W64 }, - { "raw", 0, SF_FORMAT_RAW }, - { "mat4", 0, SF_FORMAT_MAT4 }, - { "mat5", 0, SF_FORMAT_MAT5 }, - { "mat", 0, SF_FORMAT_MAT4 }, - { "pvf", 0, SF_FORMAT_PVF }, - { "sds", 0, SF_FORMAT_SDS }, - { "sd2", 0, SF_FORMAT_SD2 }, - { "vox", 0, SF_FORMAT_RAW }, - { "xi", 0, SF_FORMAT_XI } -} ; /* format_map */ - -static int -guess_output_file_type (char *str, int format) -{ char buffer [16], *cptr ; - int k ; - - format &= SF_FORMAT_SUBMASK ; - - if ((cptr = strrchr (str, '.')) == NULL) - return 0 ; - - strncpy (buffer, cptr + 1, 15) ; - buffer [15] = 0 ; - - for (k = 0 ; buffer [k] ; k++) - buffer [k] = tolower ((buffer [k])) ; - - if (strcmp (buffer, "gsm") == 0) - return SF_FORMAT_RAW | SF_FORMAT_GSM610 ; - - if (strcmp (buffer, "vox") == 0) - return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; - - for (k = 0 ; k < (int) (sizeof (format_map) / sizeof (format_map [0])) ; k++) - { if (format_map [k].len > 0 && strncmp (buffer, format_map [k].ext, format_map [k].len) == 0) - return format_map [k].format | format ; - else if (strcmp (buffer, format_map [k].ext) == 0) - return format_map [k].format | format ; - } ; - - return 0 ; -} /* guess_output_file_type */ - - -static void -print_usage (char *progname) -{ SF_FORMAT_INFO info ; - - int k ; - - printf ("\nUsage : %s [encoding] \n", progname) ; - puts ("\n" - " where [encoding] may be one of the following:\n\n" - " -pcms8 : force the output to signed 8 bit pcm\n" - " -pcmu8 : force the output to unsigned 8 bit pcm\n" - " -pcm16 : force the output to 16 bit pcm\n" - " -pcm24 : force the output to 24 bit pcm\n" - " -pcm32 : force the output to 32 bit pcm\n" - " -float32 : force the output to 32 bit floating point" - ) ; - puts ( - " -ulaw : force the output ULAW\n" - " -alaw : force the output ALAW\n" - " -ima-adpcm : force the output to IMA ADPCM (WAV only)\n" - " -ms-adpcm : force the output to MS ADPCM (WAV only)\n" - " -gsm610 : force the GSM6.10 (WAV only)\n" - " -dwvw12 : force the output to 12 bit DWVW (AIFF only)\n" - " -dwvw16 : force the output to 16 bit DWVW (AIFF only)\n" - " -dwvw24 : force the output to 24 bit DWVW (AIFF only)\n" - ) ; - - puts ( - " The format of the output file is determined by the file extension of the\n" - " output file name. The following extensions are currently understood:\n" - ) ; - - for (k = 0 ; k < (int) (sizeof (format_map) / sizeof (format_map [0])) ; k++) - { info.format = format_map [k].format ; - sf_command (NULL, SFC_GET_FORMAT_INFO, &info, sizeof (info)) ; - printf (" %-10s : %s\n", format_map [k].ext, info.name) ; - } ; - - puts ("") ; -} /* print_usage */ - -int -main (int argc, char * argv []) -{ char *progname, *infilename, *outfilename ; - SNDFILE *infile = NULL, *outfile = NULL ; - SF_INFO sfinfo ; - int k, outfilemajor, outfileminor = 0, infileminor ; - - progname = strrchr (argv [0], '/') ; - progname = progname ? progname + 1 : argv [0] ; - - if (argc < 3 || argc > 5) - { print_usage (progname) ; - return 1 ; - } ; - - infilename = argv [argc-2] ; - outfilename = argv [argc-1] ; - - if (strcmp (infilename, outfilename) == 0) - { printf ("Error : Input and output filenames are the same.\n\n") ; - print_usage (progname) ; - return 1 ; - } ; - - if (infilename [0] == '-') - { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ; - print_usage (progname) ; - return 1 ; - } ; - - if (outfilename [0] == '-') - { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ; - print_usage (progname) ; - return 1 ; - } ; - - for (k = 1 ; k < argc - 2 ; k++) - { if (! strcmp (argv [k], "-pcms8")) - { outfileminor = SF_FORMAT_PCM_S8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcmu8")) - { outfileminor = SF_FORMAT_PCM_U8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm16")) - { outfileminor = SF_FORMAT_PCM_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm24")) - { outfileminor = SF_FORMAT_PCM_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm32")) - { outfileminor = SF_FORMAT_PCM_32 ; - continue ; - } ; - if (! strcmp (argv [k], "-float32")) - { outfileminor = SF_FORMAT_FLOAT ; - continue ; - } ; - if (! strcmp (argv [k], "-ulaw")) - { outfileminor = SF_FORMAT_ULAW ; - continue ; - } ; - if (! strcmp (argv [k], "-alaw")) - { outfileminor = SF_FORMAT_ALAW ; - continue ; - } ; - if (! strcmp (argv [k], "-ima-adpcm")) - { outfileminor = SF_FORMAT_IMA_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-ms-adpcm")) - { outfileminor = SF_FORMAT_MS_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-gsm610")) - { outfileminor = SF_FORMAT_GSM610 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw12")) - { outfileminor = SF_FORMAT_DWVW_12 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw16")) - { outfileminor = SF_FORMAT_DWVW_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw24")) - { outfileminor = SF_FORMAT_DWVW_24 ; - continue ; - } ; - - printf ("Error : Not able to decode argunment '%s'.\n", argv [k]) ; - exit (1) ; - } ; - - if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s.\n", infilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - infileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if ((sfinfo.format = guess_output_file_type (outfilename, sfinfo.format)) == 0) - { printf ("Error : Not able to determine output file type for %s.\n", outfilename) ; - return 1 ; - } ; - - outfilemajor = sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_ENDMASK) ; - - if (outfileminor == 0) - outfileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (outfileminor != 0) - sfinfo.format = outfilemajor | outfileminor ; - else - sfinfo.format = outfilemajor | (sfinfo.format & SF_FORMAT_SUBMASK) ; - - if ((sfinfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_XI) - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_16 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_16 ; - break ; - - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_8 ; - break ; - } ; - - if (sf_format_check (&sfinfo) == 0) - { printf ("Error : output file format is invalid (0x%08X).\n", sfinfo.format) ; - return 1 ; - } ; - - /* Open the output file. */ - if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Copy the metadata */ - copy_metadata (outfile, infile) ; - - if ((outfileminor == SF_FORMAT_DOUBLE) || (outfileminor == SF_FORMAT_FLOAT) || - (infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT)) - copy_data_fp (outfile, infile, sfinfo.channels) ; - else - copy_data_int (outfile, infile, sfinfo.channels) ; - - sf_close (infile) ; - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -copy_metadata (SNDFILE *outfile, SNDFILE *infile) -{ SF_INSTRUMENT inst ; - const char *str ; - int k, err = 0 ; - - for (k = SF_STR_FIRST ; k <= SF_STR_LAST ; k++) - { str = sf_get_string (infile, k) ; - if (str != NULL) - err = sf_set_string (outfile, k, str) ; - } ; - - memset (&inst, 0, sizeof (inst)) ; - if (sf_command (infile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE) - sf_command (outfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ; - -} /* copy_metadata */ - -static void -copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels) -{ static double data [BUFFER_LEN], max ; - int frames, readcount, k ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_command (infile, SFC_CALC_SIGNAL_MAX, &max, sizeof (max)) ; - - if (max < 1.0) - { while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - sf_writef_double (outfile, data, readcount) ; - } ; - } - else - { sf_command (infile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - for (k = 0 ; k < readcount * channels ; k++) - data [k] /= max ; - sf_writef_double (outfile, data, readcount) ; - } ; - } ; - - return ; -} /* copy_data_fp */ - -static void -copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) -{ static int data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - while (readcount > 0) - { readcount = sf_readf_int (infile, data, frames) ; - sf_writef_int (outfile, data, readcount) ; - } ; - - return ; -} /* copy_data_int */ - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 259682b3-2887-48a6-b5bb-3cde00521ba3 -*/ diff --git a/libs/libsndfile/examples/sndfile-info.c b/libs/libsndfile/examples/sndfile-info.c deleted file mode 100644 index 44e2ec174f..0000000000 --- a/libs/libsndfile/examples/sndfile-info.c +++ /dev/null @@ -1,354 +0,0 @@ -/* -** Copyright (C) 1999-2006 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include - -#include - -#define BUFFER_LEN (1 << 16) - -#if (defined (WIN32) || defined (_WIN32)) -#define snprintf _snprintf -#endif - -static void print_version (void) ; -static void print_usage (const char *progname) ; - -static void info_dump (const char *filename) ; -static void instrument_dump (const char *filename) ; -static void broadcast_dump (const char *filename) ; - -int -main (int argc, char *argv []) -{ int k ; - - print_version () ; - - if (argc < 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - { char *progname ; - - progname = strrchr (argv [0], '/') ; - progname = progname ? progname + 1 : argv [0] ; - - print_usage (progname) ; - return 1 ; - } ; - - if (strcmp (argv [1], "-i") == 0) - { instrument_dump (argv [2]) ; - return 0 ; - } ; - - if (strcmp (argv [1], "-b") == 0) - { broadcast_dump (argv [2]) ; - return 0 ; - } ; - - for (k = 1 ; k < argc ; k++) - info_dump (argv [k]) ; - - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static double data [BUFFER_LEN] ; - -static void -print_version (void) -{ char buffer [256] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - printf ("\nVersion : %s\n\n", buffer) ; -} /* print_version */ - - -static void -print_usage (const char *progname) -{ printf ("Usage :\n %s ...\n", progname) ; - printf (" Prints out information about one or more sound files.\n\n") ; - printf (" %s -i \n", progname) ; - printf (" Prints out the instrument data for the given file.\n\n") ; - printf (" %s -b \n", progname) ; - printf (" Prints out the broadcast WAV info for the given file.\n\n") ; -#if (defined (_WIN32) || defined (WIN32)) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - fflush (stdout) ; - - /* This is the officially blessed by microsoft way but I can't get - ** it to link. - ** Sleep (15) ; - ** Instead, use this: - */ - _sleep (5 * 1000) ; -#endif -} /* print_usage */ - -/*============================================================================== -** Dumping of sndfile info. -*/ - -static double data [BUFFER_LEN] ; - -static double -get_signal_max (SNDFILE *file) -{ double max, temp ; - int readcount, k, save_state ; - - save_state = sf_command (file, SFC_GET_NORM_DOUBLE, NULL, 0) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - max = 0.0 ; - while ((readcount = sf_read_double (file, data, BUFFER_LEN))) - { for (k = 0 ; k < readcount ; k++) - { temp = fabs (data [k]) ; - if (temp > max) - max = temp ; - } ; - } ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, save_state) ; - - return max ; -} /* get_signal_max */ - -static double -calc_decibels (SF_INFO * sfinfo, double max) -{ double decibels ; - - switch (sfinfo->format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - decibels = max / 0x80 ; - break ; - - case SF_FORMAT_PCM_16 : - decibels = max / 0x8000 ; - break ; - - case SF_FORMAT_PCM_24 : - decibels = max / 0x800000 ; - break ; - - case SF_FORMAT_PCM_32 : - decibels = max / 0x80000000 ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - decibels = max / 1.0 ; - break ; - - default : - decibels = max / 0x8000 ; - break ; - } ; - - return 20.0 * log10 (decibels) ; -} /* calc_decibels */ - -static const char * -generate_duration_str (SF_INFO *sfinfo) -{ static char str [128] ; - - int seconds ; - - memset (str, 0, sizeof (str)) ; - - if (sfinfo->samplerate < 1) - return NULL ; - - if (sfinfo->frames / sfinfo->samplerate > 0x7FFFFFFF) - return "unknown" ; - - seconds = sfinfo->frames / sfinfo->samplerate ; - - snprintf (str, sizeof (str) - 1, "%02d:", seconds / 60 / 60) ; - - seconds = seconds % (60 * 60) ; - snprintf (str + strlen (str), sizeof (str) - strlen (str) - 1, "%02d:", seconds / 60) ; - - seconds = seconds % 60 ; - snprintf (str + strlen (str), sizeof (str) - strlen (str) - 1, "%02d.", seconds) ; - - seconds = ((1000 * sfinfo->frames) / sfinfo->samplerate) % 1000 ; - snprintf (str + strlen (str), sizeof (str) - strlen (str) - 1, "%03d", seconds) ; - - return str ; -} /* generate_duration_str */ - -static void -info_dump (const char *filename) -{ static char strbuffer [BUFFER_LEN] ; - SNDFILE *file ; - SF_INFO sfinfo ; - double signal_max, decibels ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - printf ("========================================\n") ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - printf ("----------------------------------------\n") ; - - if (file == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - } - else - { printf ("Sample Rate : %d\n", sfinfo.samplerate) ; - if (sfinfo.frames > 0x7FFFFFFF) - printf ("Frames : unknown\n") ; - else - printf ("Frames : %ld\n", (long) sfinfo.frames) ; - printf ("Channels : %d\n", sfinfo.channels) ; - printf ("Format : 0x%08X\n", sfinfo.format) ; - printf ("Sections : %d\n", sfinfo.sections) ; - printf ("Seekable : %s\n", (sfinfo.seekable ? "TRUE" : "FALSE")) ; - printf ("Duration : %s\n", generate_duration_str (&sfinfo)) ; - - /* Do not use sf_signal_max because it doesn work for non-seekable files . */ - signal_max = get_signal_max (file) ; - decibels = calc_decibels (&sfinfo, signal_max) ; - printf ("Signal Max : %g (%4.2f dB)\n\n", signal_max, decibels) ; - } ; - - sf_close (file) ; - -} /* info_dump */ - -/*============================================================================== -** Dumping of SF_INSTRUMENT data. -*/ - -static const char * -str_of_type (int mode) -{ switch (mode) - { case SF_LOOP_NONE : return "none" ; - case SF_LOOP_FORWARD : return "fwd " ; - case SF_LOOP_BACKWARD : return "back" ; - case SF_LOOP_ALTERNATING : return "alt " ; - default : break ; - } ; - - return "????" ; -} /* str_of_mode */ - -static void -instrument_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_INSTRUMENT inst ; - int got_inst, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - got_inst = sf_command (file, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ; - sf_close (file) ; - - if (got_inst == SF_FALSE) - { printf ("Error : File '%s' does not contain instrument data.\n\n", filename) ; - return ; - } ; - - printf ("Instrument : %s\n\n", filename) ; - printf (" Gain : %d\n", inst.gain) ; - printf (" Base note : %d\n", inst.basenote) ; - printf (" Velocity : %d - %d\n", (int) inst.velocity_lo, (int) inst.velocity_hi) ; - printf (" Key : %d - %d\n", (int) inst.key_lo, (int) inst.key_hi) ; - printf (" Loop points : %d\n", inst.loop_count) ; - - for (k = 0 ; k < inst.loop_count ; k++) - printf (" %-2d Mode : %s Start : %6d End : %6d Count : %6d\n", k, str_of_type (inst.loops [k].mode), inst.loops [k].start, inst.loops [k].end, inst.loops [k].count) ; - - putchar ('\n') ; -} /* instrument_dump */ - -static void -broadcast_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_BROADCAST_INFO bext ; - int got_bext ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - memset (&bext, 0, sizeof (SF_BROADCAST_INFO)) ; - - got_bext = sf_command (file, SFC_GET_BROADCAST_INFO, &bext, sizeof (bext)) ; - sf_close (file) ; - - if (got_bext == SF_FALSE) - { printf ("Error : File '%s' does not contain broadcast information.\n\n", filename) ; - return ; - } ; - - printf ("Description : %.*s\n", (int) sizeof (bext.description), bext.description) ; - printf ("Originator : %.*s\n", (int) sizeof (bext.originator), bext.originator) ; - printf ("Origination ref : %.*s\n", (int) sizeof (bext.originator_reference), bext.originator_reference) ; - printf ("Origination date : %.*s\n", (int) sizeof (bext.origination_date), bext.origination_date) ; - printf ("Origination time : %.*s\n", (int) sizeof (bext.origination_time), bext.origination_time) ; - printf ("BWF version : %d\n", bext.version) ; - printf ("UMID : %.*s\n", (int) sizeof (bext.umid), bext.umid) ; - printf ("Coding history : %.*s\n", bext.coding_history_size, bext.coding_history) ; - -} /* broadcast_dump */ - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: f59a05db-a182-41de-aedd-d717ce2bb099 -*/ diff --git a/libs/libsndfile/examples/sndfile-play-beos.cpp b/libs/libsndfile/examples/sndfile-play-beos.cpp deleted file mode 100644 index 56f7415119..0000000000 --- a/libs/libsndfile/examples/sndfile-play-beos.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -** Copyright (C) 2001 Marcus Overhagen -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - -/*------------------------------------------------------------------------------ -** BeOS functions for playing a sound. -*/ - -#if defined (__BEOS__) - -struct shared_data -{ - BSoundPlayer *player; - SNDFILE *sndfile; - SF_INFO sfinfo; - sem_id finished; -}; - -static void -buffer_callback(void *theCookie, void *buf, size_t size, const media_raw_audio_format &format) -{ - shared_data *data = (shared_data *)theCookie; - short *buffer = (short *)buf; - int count = size / sizeof(short); - int m, readcount; - - if (!data->player->HasData()) - return; - - readcount = sf_read_short(data->sndfile, buffer, count); - if (readcount == 0) - { data->player->SetHasData(false); - release_sem(data->finished); - } - if (readcount < count) - { for (m = readcount ; m < count ; m++) - buffer [m] = 0 ; - } - if (data->sfinfo.pcmbitwidth < 16) - { for (m = 0 ; m < count ; m++) - buffer [m] *= 256 ; - } -} - -static void -beos_play (int argc, char *argv []) -{ - shared_data data; - status_t status; - int k; - - /* BSoundPlayer requires a BApplication object */ - BApplication app("application/x-vnd.MarcusOverhagen-sfplay"); - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (data.sndfile = sf_open_read (argv [k], &data.sfinfo))) - { sf_perror (NULL) ; - continue ; - } ; - - if (data.sfinfo.channels < 1 || data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", data.sfinfo.channels) ; - sf_close (data.sndfile) ; - continue ; - } ; - - data.finished = create_sem(0,"finished"); - - media_raw_audio_format format = - { data.sfinfo.samplerate, - data.sfinfo.channels, - media_raw_audio_format::B_AUDIO_SHORT, - B_HOST_IS_LENDIAN ? B_MEDIA_LITTLE_ENDIAN : B_MEDIA_BIG_ENDIAN, - BUFFER_LEN * sizeof(short) - }; - - BSoundPlayer player(&format,"player",buffer_callback,NULL,&data); - data.player = &player; - - if ((status = player.InitCheck()) != B_OK) - { - printf ("Error : BSoundPlayer init failed, %s.\n", strerror(status)) ; - delete_sem(data.finished); - sf_close (data.sndfile) ; - continue ; - } - - player.SetVolume(1.0); - player.Start(); - player.SetHasData(true); - acquire_sem(data.finished); - player.Stop(); - delete_sem(data.finished); - - sf_close (data.sndfile) ; - - } ; - -} /* beos_play */ - -#endif - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { printf ("Usage : %s \n\n", argv [0]) ; - return 1 ; - } ; - - beos_play (argc, argv) ; - - return 0 ; -} /* main */ - - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 5407a79d-88de-41c7-8d8e-9acf2cf13cc1 -*/ - diff --git a/libs/libsndfile/examples/sndfile-play.c b/libs/libsndfile/examples/sndfile-play.c deleted file mode 100644 index 7969693a44..0000000000 --- a/libs/libsndfile/examples/sndfile-play.c +++ /dev/null @@ -1,960 +0,0 @@ -/* -** Copyright (C) 1999-2005 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if HAVE_ALSA_ASOUNDLIB_H - #define ALSA_PCM_NEW_HW_PARAMS_API - #define ALSA_PCM_NEW_SW_PARAMS_API - #include - #include -#endif - -#if defined (__linux__) - #include - #include - #include - -#elif (defined (__MACH__) && defined (__APPLE__)) - #include - #include - -#elif (defined (sun) && defined (unix)) - #include - #include - #include - -#elif (OS_IS_WIN32 == 1) - #include - #include - -#endif - -#include - -#define SIGNED_SIZEOF(x) ((int) sizeof (x)) -#define BUFFER_LEN (2048) - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if HAVE_ALSA_ASOUNDLIB_H - -static snd_pcm_t * alsa_open (int channels, unsigned srate, int realtime) ; -static int alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) ; - -static void -alsa_play (int argc, char *argv []) -{ static float buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - snd_pcm_t * alsa_dev ; - int k, readcount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - if ((alsa_dev = alsa_open (sfinfo.channels, (unsigned) sfinfo.samplerate, SF_FALSE)) == NULL) - continue ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] *= scale ; - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - } - else - { while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - - snd_pcm_drain (alsa_dev) ; - snd_pcm_close (alsa_dev) ; - - sf_close (sndfile) ; - } ; - - return ; -} /* alsa_play */ - -static snd_pcm_t * -alsa_open (int channels, unsigned samplerate, int realtime) -{ const char * device = "plughw:0" ; - snd_pcm_t *alsa_dev = NULL ; - snd_pcm_hw_params_t *hw_params ; - snd_pcm_uframes_t buffer_size, xfer_align, start_threshold ; - snd_pcm_uframes_t alsa_period_size, alsa_buffer_frames ; - snd_pcm_sw_params_t *sw_params ; - - int err ; - - if (realtime) - { alsa_period_size = 256 ; - alsa_buffer_frames = 3 * alsa_period_size ; - } - else - { alsa_period_size = 1024 ; - alsa_buffer_frames = 4 * alsa_period_size ; - } ; - - if ((err = snd_pcm_open (&alsa_dev, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) - { fprintf (stderr, "cannot open audio device \"%s\" (%s)\n", device, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_nonblock (alsa_dev, 0) ; - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) - { fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_any (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_access (alsa_dev, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) - { fprintf (stderr, "cannot set access type (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_format (alsa_dev, hw_params, SND_PCM_FORMAT_FLOAT)) < 0) - { fprintf (stderr, "cannot set sample format (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_rate_near (alsa_dev, hw_params, &samplerate, 0)) < 0) - { fprintf (stderr, "cannot set sample rate (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_channels (alsa_dev, hw_params, channels)) < 0) - { fprintf (stderr, "cannot set channel count (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_buffer_size_near (alsa_dev, hw_params, &alsa_buffer_frames)) < 0) - { fprintf (stderr, "cannot set buffer size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_period_size_near (alsa_dev, hw_params, &alsa_period_size, 0)) < 0) - { fprintf (stderr, "cannot set period size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot set parameters (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - /* extra check: if we have only one period, this code won't work */ - snd_pcm_hw_params_get_period_size (hw_params, &alsa_period_size, 0) ; - snd_pcm_hw_params_get_buffer_size (hw_params, &buffer_size) ; - if (alsa_period_size == buffer_size) - { fprintf (stderr, "Can't use period equal to buffer size (%lu == %lu)", alsa_period_size, buffer_size) ; - goto catch_error ; - } ; - - snd_pcm_hw_params_free (hw_params) ; - - if ((err = snd_pcm_sw_params_malloc (&sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_malloc: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params_current (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_current: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - /* note: set start threshold to delay start until the ring buffer is full */ - snd_pcm_sw_params_current (alsa_dev, sw_params) ; - if ((err = snd_pcm_sw_params_get_xfer_align (sw_params, &xfer_align)) < 0) - { fprintf (stderr, "cannot get xfer align (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - /* round up to closest transfer boundary */ - start_threshold = (buffer_size / xfer_align) * xfer_align ; - if (start_threshold < 1) - start_threshold = 1 ; - if ((err = snd_pcm_sw_params_set_start_threshold (alsa_dev, sw_params, start_threshold)) < 0) - { fprintf (stderr, "cannot set start threshold (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_sw_params_free (sw_params) ; - - snd_pcm_reset (alsa_dev) ; - -catch_error : - - if (err < 0 && alsa_dev != NULL) - { snd_pcm_close (alsa_dev) ; - return NULL ; - } ; - - return alsa_dev ; -} /* alsa_open */ - -static int -alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) -{ static int epipe_count = 0 ; - - snd_pcm_status_t *status ; - int total = 0 ; - int retval ; - - if (epipe_count > 0) - epipe_count -- ; - - while (total < frames) - { retval = snd_pcm_writei (alsa_dev, data + total * channels, frames - total) ; - - if (retval >= 0) - { total += retval ; - if (total == frames) - return total ; - - continue ; - } ; - - switch (retval) - { case -EAGAIN : - puts ("alsa_write_float: EAGAIN") ; - continue ; - break ; - - case -EPIPE : - if (epipe_count > 0) - { printf ("alsa_write_float: EPIPE %d\n", epipe_count) ; - if (epipe_count > 140) - return retval ; - } ; - epipe_count += 100 ; - - if (0) - { snd_pcm_status_alloca (&status) ; - if ((retval = snd_pcm_status (alsa_dev, status)) < 0) - fprintf (stderr, "alsa_out: xrun. can't determine length\n") ; - else if (snd_pcm_status_get_state (status) == SND_PCM_STATE_XRUN) - { struct timeval now, diff, tstamp ; - - gettimeofday (&now, 0) ; - snd_pcm_status_get_trigger_tstamp (status, &tstamp) ; - timersub (&now, &tstamp, &diff) ; - - fprintf (stderr, "alsa_write_float xrun: of at least %.3f msecs. resetting stream\n", - diff.tv_sec * 1000 + diff.tv_usec / 1000.0) ; - } - else - fprintf (stderr, "alsa_write_float: xrun. can't determine length\n") ; - } ; - - snd_pcm_prepare (alsa_dev) ; - break ; - - case -EBADFD : - fprintf (stderr, "alsa_write_float: Bad PCM state.n") ; - return 0 ; - break ; - - case -ESTRPIPE : - fprintf (stderr, "alsa_write_float: Suspend event.n") ; - return 0 ; - break ; - - case -EIO : - puts ("alsa_write_float: EIO") ; - return 0 ; - - default : - fprintf (stderr, "alsa_write_float: retval = %d\n", retval) ; - return 0 ; - break ; - } ; /* switch */ - } ; /* while */ - - return total ; -} /* alsa_write_float */ - -#endif /* HAVE_ALSA_ASOUNDLIB_H */ - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if defined (__linux__) - -static int linux_open_dsp_device (int channels, int srate) ; - -static void -linux_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, audio_device, readcount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - audio_device = linux_open_dsp_device (sfinfo.channels, sfinfo.samplerate) ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { static float float_buffer [BUFFER_LEN] ; - double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, float_buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] = scale * float_buffer [m] ; - write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - } - else - { while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) - write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - - if (ioctl (audio_device, SNDCTL_DSP_POST, 0) == -1) - perror ("ioctl (SNDCTL_DSP_POST) ") ; - - if (ioctl (audio_device, SNDCTL_DSP_SYNC, 0) == -1) - perror ("ioctl (SNDCTL_DSP_SYNC) ") ; - - close (audio_device) ; - - sf_close (sndfile) ; - } ; - - return ; -} /* linux_play */ - -static int -linux_open_dsp_device (int channels, int srate) -{ int fd, stereo, fmt ; - - if ((fd = open ("/dev/dsp", O_WRONLY, 0)) == -1 && - (fd = open ("/dev/sound/dsp", O_WRONLY, 0)) == -1) - { perror ("linux_open_dsp_device : open ") ; - exit (1) ; - } ; - - stereo = 0 ; - if (ioctl (fd, SNDCTL_DSP_STEREO, &stereo) == -1) - { /* Fatal error */ - perror ("linux_open_dsp_device : stereo ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_RESET, 0)) - { perror ("linux_open_dsp_device : reset ") ; - exit (1) ; - } ; - - fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ; - if (ioctl (fd, SOUND_PCM_SETFMT, &fmt) != 0) - { perror ("linux_open_dsp_device : set format ") ; - exit (1) ; - } ; - - if (ioctl (fd, SOUND_PCM_WRITE_CHANNELS, &channels) != 0) - { perror ("linux_open_dsp_device : channels ") ; - exit (1) ; - } ; - - if (ioctl (fd, SOUND_PCM_WRITE_RATE, &srate) != 0) - { perror ("linux_open_dsp_device : sample rate ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_SYNC, 0) != 0) - { perror ("linux_open_dsp_device : sync ") ; - exit (1) ; - } ; - - return fd ; -} /* linux_open_dsp_device */ - -#endif /* __linux__ */ - -/*------------------------------------------------------------------------------ -** Mac OS X functions for playing a sound. -*/ - -#if (defined (__MACH__) && defined (__APPLE__)) /* MacOSX */ - -typedef struct -{ AudioStreamBasicDescription format ; - - UInt32 buf_size ; - AudioDeviceID device ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int fake_stereo ; - int done_playing ; -} MacOSXAudioData ; - -#include - -static OSStatus -macosx_audio_out_callback (AudioDeviceID device, const AudioTimeStamp* current_time, - const AudioBufferList* data_in, const AudioTimeStamp* time_in, - AudioBufferList* data_out, const AudioTimeStamp* time_out, - void* client_data) -{ MacOSXAudioData *audio_data ; - int size, sample_count, read_count, k ; - float *buffer ; - - /* Prevent compiler warnings. */ - device = device ; - current_time = current_time ; - data_in = data_in ; - time_in = time_in ; - time_out = time_out ; - - audio_data = (MacOSXAudioData*) client_data ; - - size = data_out->mBuffers [0].mDataByteSize ; - sample_count = size / sizeof (float) ; - - buffer = (float*) data_out->mBuffers [0].mData ; - - if (audio_data->fake_stereo != 0) - { read_count = sf_read_float (audio_data->sndfile, buffer, sample_count / 2) ; - - for (k = read_count - 1 ; k >= 0 ; k--) - { buffer [2 * k ] = buffer [k] ; - buffer [2 * k + 1] = buffer [k] ; - } ; - read_count *= 2 ; - } - else - read_count = sf_read_float (audio_data->sndfile, buffer, sample_count) ; - - /* Fill the remainder with zeroes. */ - if (read_count < sample_count) - { if (audio_data->fake_stereo == 0) - memset (&(buffer [read_count]), 0, (sample_count - read_count) * sizeof (float)) ; - /* Tell the main application to terminate. */ - audio_data->done_playing = SF_TRUE ; - } ; - - return noErr ; -} /* macosx_audio_out_callback */ - -static void -macosx_play (int argc, char *argv []) -{ MacOSXAudioData audio_data ; - OSStatus err ; - UInt32 count, buffer_size ; - int k ; - - audio_data.fake_stereo = 0 ; - audio_data.device = kAudioDeviceUnknown ; - - /* get the default output device for the HAL */ - count = sizeof (AudioDeviceID) ; - if ((err = AudioHardwareGetProperty (kAudioHardwarePropertyDefaultOutputDevice, - &count, (void *) &(audio_data.device))) != noErr) - { printf ("AudioHardwareGetProperty (kAudioDevicePropertyDefaultOutputDevice) failed.\n") ; - return ; - } ; - - /* get the buffersize that the default device uses for IO */ - count = sizeof (UInt32) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyBufferSize, - &count, &buffer_size)) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyBufferSize) failed.\n") ; - return ; - } ; - - /* get a description of the data format used by the default device */ - count = sizeof (AudioStreamBasicDescription) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyStreamFormat, - &count, &(audio_data.format))) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* Base setup completed. Now play files. */ - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (audio_data.sfinfo.channels < 1 || audio_data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", audio_data.sfinfo.channels) ; - continue ; - } ; - - audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ; - - if (audio_data.sfinfo.channels == 1) - { audio_data.format.mChannelsPerFrame = 2 ; - audio_data.fake_stereo = 1 ; - } - else - audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ; - - if ((err = AudioDeviceSetProperty (audio_data.device, NULL, 0, false, kAudioDevicePropertyStreamFormat, - sizeof (AudioStreamBasicDescription), &(audio_data.format))) != noErr) - { printf ("AudioDeviceSetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* we want linear pcm */ - if (audio_data.format.mFormatID != kAudioFormatLinearPCM) - return ; - - /* Fire off the device. */ - if ((err = AudioDeviceAddIOProc (audio_data.device, macosx_audio_out_callback, - (void *) &audio_data)) != noErr) - { printf ("AudioDeviceAddIOProc failed.\n") ; - return ; - } ; - - err = AudioDeviceStart (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - return ; - - audio_data.done_playing = SF_FALSE ; - - while (audio_data.done_playing == SF_FALSE) - usleep (10 * 1000) ; /* 10 000 milliseconds. */ - - if ((err = AudioDeviceStop (audio_data.device, macosx_audio_out_callback)) != noErr) - { printf ("AudioDeviceStop failed.\n") ; - return ; - } ; - - err = AudioDeviceRemoveIOProc (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - { printf ("AudioDeviceRemoveIOProc failed.\n") ; - return ; - } ; - - sf_close (audio_data.sndfile) ; - } ; - - return ; -} /* macosx_play */ - -#endif /* MacOSX */ - - -/*------------------------------------------------------------------------------ -** Win32 functions for playing a sound. -** -** This API sucks. Its needlessly complicated and is *WAY* too loose with -** passing pointers arounf in integers and and using char* pointers to -** point to data instead of short*. It plain sucks! -*/ - -#if (OS_IS_WIN32 == 1) - -#define WIN32_BUFFER_LEN (1<<15) - -typedef struct -{ HWAVEOUT hwave ; - WAVEHDR whdr [2] ; - - CRITICAL_SECTION mutex ; /* to control access to BuffersInUSe */ - HANDLE Event ; /* signal that a buffer is free */ - - short buffer [WIN32_BUFFER_LEN / sizeof (short)] ; - int current, bufferlen ; - int BuffersInUse ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - sf_count_t remaining ; -} Win32_Audio_Data ; - - -static void -win32_play_data (Win32_Audio_Data *audio_data) -{ int thisread, readcount ; - - /* fill a buffer if there is more data and we can read it sucessfully */ - readcount = (audio_data->remaining > audio_data->bufferlen) ? audio_data->bufferlen : (int) audio_data->remaining ; - - thisread = (int) sf_read_short (audio_data->sndfile, (short *) (audio_data->whdr [audio_data->current].lpData), readcount) ; - - audio_data->remaining -= thisread ; - - if (thisread > 0) - { /* Fix buffer length if this is only a partial block. */ - if (thisread < audio_data->bufferlen) - audio_data->whdr [audio_data->current].dwBufferLength = thisread * sizeof (short) ; - - /* Queue the WAVEHDR */ - waveOutWrite (audio_data->hwave, (LPWAVEHDR) &(audio_data->whdr [audio_data->current]), sizeof (WAVEHDR)) ; - - /* count another buffer in use */ - EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse ++ ; - LeaveCriticalSection (&audio_data->mutex) ; - - /* use the other buffer next time */ - audio_data->current = (audio_data->current + 1) % 2 ; - } ; - - return ; -} /* win32_play_data */ - -static void CALLBACK -win32_audio_out_callback (HWAVEOUT hwave, UINT msg, DWORD data, DWORD param1, DWORD param2) -{ Win32_Audio_Data *audio_data ; - - /* Prevent compiler warnings. */ - hwave = hwave ; - param1 = param2 ; - - if (data == 0) - return ; - - /* - ** I consider this technique of passing a pointer via an integer as - ** fundamentally broken but thats the way microsoft has defined the - ** interface. - */ - audio_data = (Win32_Audio_Data*) data ; - - /* let main loop know a buffer is free */ - if (msg == MM_WOM_DONE) - { EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse -- ; - LeaveCriticalSection (&audio_data->mutex) ; - SetEvent (audio_data->Event) ; - } ; - - return ; -} /* win32_audio_out_callback */ - -/* This is needed for earlier versions of the M$ development tools. */ -#ifndef DWORD_PTR -#define DWORD_PTR DWORD -#endif - -static void -win32_play (int argc, char *argv []) -{ Win32_Audio_Data audio_data ; - - WAVEFORMATEX wf ; - int k, error ; - - audio_data.sndfile = NULL ; - audio_data.hwave = 0 ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - audio_data.remaining = audio_data.sfinfo.frames * audio_data.sfinfo.channels ; - audio_data.current = 0 ; - - InitializeCriticalSection (&audio_data.mutex) ; - audio_data.Event = CreateEvent (0, FALSE, FALSE, 0) ; - - wf.nChannels = audio_data.sfinfo.channels ; - wf.wFormatTag = WAVE_FORMAT_PCM ; - wf.cbSize = 0 ; - wf.wBitsPerSample = 16 ; - - wf.nSamplesPerSec = audio_data.sfinfo.samplerate ; - - wf.nBlockAlign = audio_data.sfinfo.channels * sizeof (short) ; - - wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec ; - - error = waveOutOpen (&(audio_data.hwave), WAVE_MAPPER, &wf, (DWORD_PTR) win32_audio_out_callback, - (DWORD_PTR) &audio_data, CALLBACK_FUNCTION) ; - if (error) - { puts ("waveOutOpen failed.") ; - audio_data.hwave = 0 ; - continue ; - } ; - - audio_data.whdr [0].lpData = (char*) audio_data.buffer ; - audio_data.whdr [1].lpData = ((char*) audio_data.buffer) + sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - audio_data.whdr [1].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwFlags = 0 ; - audio_data.whdr [1].dwFlags = 0 ; - - /* length of each audio buffer in samples */ - audio_data.bufferlen = sizeof (audio_data.buffer) / 2 / sizeof (short) ; - - /* Prepare the WAVEHDRs */ - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [0] failed : %08X\n", error) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [1] failed : %08X\n", error) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - /* Fill up both buffers with audio data */ - audio_data.BuffersInUse = 0 ; - win32_play_data (&audio_data) ; - win32_play_data (&audio_data) ; - - /* loop until both buffers are released */ - while (audio_data.BuffersInUse > 0) - { - /* wait for buffer to be released */ - WaitForSingleObject (audio_data.Event, INFINITE) ; - - /* refill the buffer if there is more data to play */ - win32_play_data (&audio_data) ; - } ; - - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)) ; - - waveOutClose (audio_data.hwave) ; - audio_data.hwave = 0 ; - - DeleteCriticalSection (&audio_data.mutex) ; - - sf_close (audio_data.sndfile) ; - } ; - -} /* win32_play */ - -#endif /* Win32 */ - -/*------------------------------------------------------------------------------ -** Solaris. -*/ - -#if (defined (sun) && defined (unix)) /* ie Solaris */ - -static void -solaris_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - audio_info_t audio_info ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - unsigned long delay_time ; - long k, start_count, output_count, write_count, read_count ; - int audio_fd, error, done ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - /* open the audio device - write only, non-blocking */ - if ((audio_fd = open ("/dev/audio", O_WRONLY | O_NONBLOCK)) < 0) - { perror ("open (/dev/audio) failed") ; - return ; - } ; - - /* Retrive standard values. */ - AUDIO_INITINFO (&audio_info) ; - - audio_info.play.sample_rate = sfinfo.samplerate ; - audio_info.play.channels = sfinfo.channels ; - audio_info.play.precision = 16 ; - audio_info.play.encoding = AUDIO_ENCODING_LINEAR ; - audio_info.play.gain = AUDIO_MAX_GAIN ; - audio_info.play.balance = AUDIO_MID_BALANCE ; - - if ((error = ioctl (audio_fd, AUDIO_SETINFO, &audio_info))) - { perror ("ioctl (AUDIO_SETINFO) failed") ; - return ; - } ; - - /* Delay time equal to 1/4 of a buffer in microseconds. */ - delay_time = (BUFFER_LEN * 1000000) / (audio_info.play.sample_rate * 4) ; - - done = 0 ; - while (! done) - { read_count = sf_read_short (sndfile, buffer, BUFFER_LEN) ; - if (read_count < BUFFER_LEN) - { memset (&(buffer [read_count]), 0, (BUFFER_LEN - read_count) * sizeof (short)) ; - /* Tell the main application to terminate. */ - done = SF_TRUE ; - } ; - - start_count = 0 ; - output_count = BUFFER_LEN * sizeof (short) ; - - while (output_count > 0) - { /* write as much data as possible */ - write_count = write (audio_fd, &(buffer [start_count]), output_count) ; - if (write_count > 0) - { output_count -= write_count ; - start_count += write_count ; - } - else - { /* Give the audio output time to catch up. */ - usleep (delay_time) ; - } ; - } ; /* while (outpur_count > 0) */ - } ; /* while (! done) */ - - close (audio_fd) ; - } ; - - return ; -} /* solaris_play */ - -#endif /* Solaris */ - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { - printf ("\nUsage : %s \n\n", argv [0]) ; -#if (OS_IS_WIN32 == 1) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - - /* This is the officially blessed by microsoft way but I can't get - ** it to link. - ** Sleep (15) ; - ** Instead, use this: - */ - _sleep (5 * 1000) ; -#endif - return 1 ; - } ; - -#if defined (__linux__) - #if HAVE_ALSA_ASOUNDLIB_H - if (access ("/proc/asound/cards", R_OK) == 0) - alsa_play (argc, argv) ; - else - #endif - linux_play (argc, argv) ; -#elif (defined (__MACH__) && defined (__APPLE__)) - macosx_play (argc, argv) ; -#elif (defined (sun) && defined (unix)) - solaris_play (argc, argv) ; -#elif (OS_IS_WIN32 == 1) - win32_play (argc, argv) ; -#elif defined (__BEOS__) - printf ("This program cannot be compiled on BeOS.\n") ; - printf ("Instead, compile the file sfplay_beos.cpp.\n") ; - return 1 ; -#else - puts ("*** Playing sound not yet supported on this platform.") ; - puts ("*** Please feel free to submit a patch.") ; - return 1 ; -#endif - - return 0 ; -} /* main */ -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 8fc4110d-6cec-4e03-91df-0f384cabedac -*/ diff --git a/libs/libsndfile/examples/sndfile-to-text.c b/libs/libsndfile/examples/sndfile-to-text.c deleted file mode 100644 index 466bb860b5..0000000000 --- a/libs/libsndfile/examples/sndfile-to-text.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#define BLOCK_SIZE 512 - -static void -print_usage (char *progname) -{ printf ("\nUsage : %s \n", progname) ; - puts ("\n" - " Where the output file will contain a line for each frame\n" - " and a column for each channel.\n" - ) ; - -} /* print_usage */ - -static void -convert_to_text (SNDFILE * infile, FILE * outfile, int channels) -{ float buf [channels * BLOCK_SIZE] ; - int k, m, readcount ; - - while ((readcount = sf_readf_float (infile, buf, BLOCK_SIZE)) > 0) - { for (k = 0 ; k < readcount ; k++) - { for (m = 0 ; m < channels ; m++) - fprintf (outfile, " % 12.10f", buf [k * channels + m]) ; - fprintf (outfile, "\n") ; - } ; - } ; - - return ; -} /* convert_to_text */ - -int -main (int argc, char * argv []) -{ char *progname, *infilename, *outfilename ; - SNDFILE *infile = NULL ; - FILE *outfile = NULL ; - SF_INFO sfinfo ; - - progname = strrchr (argv [0], '/') ; - progname = progname ? progname + 1 : argv [0] ; - - if (argc != 3) - { print_usage (progname) ; - return 1 ; - } ; - - infilename = argv [1] ; - outfilename = argv [2] ; - - if (strcmp (infilename, outfilename) == 0) - { printf ("Error : Input and output filenames are the same.\n\n") ; - print_usage (progname) ; - return 1 ; - } ; - - if (infilename [0] == '-') - { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ; - print_usage (progname) ; - return 1 ; - } ; - - if (outfilename [0] == '-') - { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ; - print_usage (progname) ; - return 1 ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s.\n", infilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Open the output file. */ - if ((outfile = fopen (outfilename, "w")) == NULL) - { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ; - return 1 ; - } ; - - fprintf (outfile, "# Converted from file %s.\n", infilename) ; - fprintf (outfile, "# Channels %d, Sample rate %d\n", sfinfo.channels, sfinfo.samplerate) ; - - convert_to_text (infile, outfile, sfinfo.channels) ; - - sf_close (infile) ; - fclose (outfile) ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/examples/sndfilehandle.cc b/libs/libsndfile/examples/sndfilehandle.cc deleted file mode 100644 index c9a1931aea..0000000000 --- a/libs/libsndfile/examples/sndfilehandle.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include - -#define BUFFER_LEN 1024 - -static void -create_file (const char * fname, int format) -{ static short buffer [BUFFER_LEN] ; - - SndfileHandle file ; - int channels = 2 ; - int srate = 48000 ; - - printf ("Creating file named '%s'\n", fname) ; - - file = SndfileHandle (fname, SFM_WRITE, format, channels, srate) ; - - memset (buffer, 0, sizeof (buffer)) ; - - file.write (buffer, BUFFER_LEN) ; - - puts ("") ; - /* - ** The SndfileHandle object will automatically close the file and - ** release all allocated memory when the object goes out of scope. - ** This is the Resource Acquisition Is Initailization idom. - ** See : http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization - */ -} /* create_file */ - -static void -read_file (const char * fname) -{ static short buffer [BUFFER_LEN] ; - - SndfileHandle file ; - - file = SndfileHandle (fname) ; - - printf ("Opened file '%s'\n", fname) ; - printf (" Sample rate : %d\n", file.samplerate ()) ; - printf (" Channels : %d\n", file.channels ()) ; - - file.read (buffer, BUFFER_LEN) ; - - puts ("") ; - - /* RAII takes care of destroying SndfileHandle object. */ -} /* read_file */ - -int -main (void) -{ const char * fname = "test.wav" ; - - puts ("\nSimple example showing usage of the C++ SndfileHandle object.\n") ; - - create_file (fname, SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - - read_file (fname) ; - - puts ("Done.\n") ; - return 0 ; -} /* main */ - - diff --git a/libs/libsndfile/libsndfile.spec.in b/libs/libsndfile/libsndfile.spec.in deleted file mode 100644 index d4427289a2..0000000000 --- a/libs/libsndfile/libsndfile.spec.in +++ /dev/null @@ -1,69 +0,0 @@ - -%define name @PACKAGE@ -%define version @VERSION@ -%define release 1 - -Summary: A library to handle various audio file formats. -Name: %{name} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Libraries/Sound -Source: http://www.mega-nerd.com/libsndfile/libsndfile-%{version}.tar.gz -Url: http://www.mega-nerd.com/libsndfile/ -BuildRoot: /var/tmp/%{name}-%{version} - -%description -libsndfile is a C library for reading and writing sound files such as -AIFF, AU and WAV files through one standard interface. It can currently -read/write 8, 16, 24 and 32-bit PCM files as well as 32-bit floating -point WAV files and a number of compressed formats. - -%package devel -Summary: Libraries, includes, etc to develop libsndfile applications -Group: Libraries - -%description devel -Libraries, include files, etc you can use to develop libsndfile applications. - -%prep -%setup - -%build -%configure -make - -%install -if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi -mkdir -p $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install -%clean -if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi - -%files -%defattr(-,root,root) -%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO doc -%{_libdir}/libsndfile.so.* -%{_bindir}/* -%{_mandir}/man1/* -%{_datadir}/octave/site/m/* -%{_defaultdocdir}/libsndfile1-dev/html/* - -%files devel -%defattr(-,root,root) -%{_libdir}/libsndfile.a -%{_libdir}/libsndfile.la -%{_libdir}/libsndfile.so -%{_includedir}/sndfile.h -%{_libdir}/pkgconfig/sndfile.pc - -%changelog -* Sun May 15 2005 Erik de Castro Lopo -- Add html files to the files section. -* Tue Sep 16 2003 Erik de Castro Lopo -- Apply corrections from Andrew Schultz. -* Mon Oct 21 2002 Erik de Castro Lopo -- Force installation of sndfile.pc file. -* Thu Jul 6 2000 Josh Green -- Created libsndfile.spec.in - diff --git a/libs/libsndfile/make_lite.py b/libs/libsndfile/make_lite.py deleted file mode 100644 index eee69fc82d..0000000000 --- a/libs/libsndfile/make_lite.py +++ /dev/null @@ -1,491 +0,0 @@ -#!/usr/bin/python - -import commands, os, re, string, sys, time - -def count_enclosed_functions (source): - func_count = 0 - open_brace = 0 - close_brace = 0 - for ch in source: - if ch == '{': - open_brace += 1 - elif ch == '}': - close_brace += 1 - if open_brace == close_brace: - func_count += 1 - if open_brace < close_brace: - print "count_enclosed_functions : open_brace < close_brace" - return -1 - return func_count - -def find_function_prototype (source, proto_name): - proto_re = "(^[a-zA-Z_ \t]+\s+%s[^a-zA-Z0-9_]\s*\([^\)]+\)\s+;\n)" % (proto_name) - proto_result = re.search (proto_re, source, re.MULTILINE | re.DOTALL) - if not proto_result: - return None - proto_text = proto_result.groups ()[0] - return proto_text - -def find_function_definition (source, func_name): - func_re = "(\n[a-zA-Z_ \t]+\n%s[^a-zA-Z0-9_].* /\* %s \*/\n)" % (func_name, func_name) - func_result = re.search (func_re, source, re.MULTILINE | re.DOTALL) - if not func_result: - sys.exit (1) - return None - func_text = func_result.groups ()[0] - - # Now to check that we only have one enclosing function. - func_count = count_enclosed_functions (func_text) - if func_count != 1: - return None - return func_text - -def find_include (source, inc_name): - inc_re = "(^#include\s+[\<\"]%s[\"\>]\s*)" % inc_name - inc_result = re.search (inc_re, source, re.MULTILINE | re.DOTALL) - if not inc_result: - return None - inc_text = inc_result.groups ()[0] - return inc_text - -def find_assign_statement (source, var_name): - var_re = "(^\s+%s\s*=[^;]+;)" % var_name - var_result = re.search (var_re, source, re.MULTILINE | re.DOTALL) - if not var_result: - return None - assign_text = var_result.groups ()[0] - return assign_text - -#-------------------------------------------------------------------------------- - -def remove_include (source, inc_name): - inc_text = find_include (source, inc_name) - if not inc_text: - print "remove_include : include '%s' not found. Exiting." % inc_name - sys.exit (1) - - source = string.replace (source, inc_text, "") - return source - -def remove_assign (source, assign_name): - assign_text = find_assign (source, inc_name) - if not inc_text: - print "remove_include : include '%s' not found. Exiting." % inc_name - sys.exit (1) - - source = string.replace (source, inc_text, "") - return source - -def remove_prototype (source, proto_name): - proto_text = find_function_prototype (source, proto_name) - if not proto_text: - print "remove_prototype : prototype '%s' not found. Exiting." % proto_name - sys.exit (1) - - source = string.replace (source, proto_text, "") - return source - -def remove_function (source, func_name): - func_text = find_function_definition (source, func_name) - if not func_text: - print "remove_function : function '%s' not found. Exiting." % func_name - sys.exit (1) - - source = string.replace (source, func_text, "/* Function %s() removed here. */\n" % func_name) - return source - -def remove_all_assignments (source, var): - count = 0 - while 1: - assign_text = find_assign_statement (source, var) - if not assign_text: - if count != 0: - break - print "remove_all_assignments : variable '%s' not found. Exiting." % var - sys.exit (1) - - source = string.replace (source, assign_text, "") - count += 1 - return source - - - -#---------------------------------------------------------------- - -def remove_funcs_and_protos_from_file (filename, func_list): - source_code = open (filename, 'r').read () - - for func in func_list: - source_code = remove_prototype (source_code, func) ; - source_code = remove_function (source_code, func) ; - open (filename, 'w').write (source_code) - -def remove_funcs_from_file (filename, func_list): - source_code = open (filename, 'r').read () - - for func in func_list: - source_code = remove_function (source_code, func) ; - open (filename, 'w').write (source_code) - -def remove_protos_from_file (filename, func_list): - source_code = open (filename, 'r').read () - - for func in func_list: - source_code = remove_prototype (source_code, func) ; - open (filename, 'w').write (source_code) - -def remove_includes_from_file (filename, inc_list): - source_code = open (filename, 'r').read () - - for inc in inc_list: - source_code = remove_include (source_code, inc) ; - open (filename, 'w').write (source_code) - -def remove_all_assignments_from_file (filename, var_list): - source_code = open (filename, 'r').read () - - for var in var_list: - source_code = remove_all_assignments (source_code, var) ; - open (filename, 'w').write (source_code) - -def remove_comment_start_end (filename, start_comment, end_comment): - source_code = open (filename, 'r').read () - - while 1: - start_index = string.find (source_code, start_comment) - end_index = string.find (source_code, end_comment) - if start_index < 0 or end_index < start_index: - break - end_index += len (end_comment) - source_code = source_code [:start_index-1] + source_code [end_index:] ; - - open (filename, 'w').write (source_code) - -def remove_strings_from_file (filename, str_list): - file_text = open (filename, 'r').read () - for current_str in str_list: - file_text = string.replace (file_text, current_str, '') - open (filename, 'w').write (file_text) - -def string_replace_in_file (filename, from_str, to_str): - file_text = open (filename, 'r').read () - file_text = string.replace (file_text, from_str, to_str) - open (filename, 'w').write (file_text) - -def remove_regex_from_file (filename, regex_list): - file_text = open (filename, 'r').read () - for regex in regex_list: - file_text = re.sub (regex, '', file_text, re.MULTILINE | re.DOTALL) - open (filename, 'w').write (file_text) - -#========================================================================== - -def find_configure_version (filename): - # AM_INIT_AUTOMAKE(libsndfile,0.0.21pre6) - file = open (filename) - while 1: - line = file.readline () - if re.search ("AC_INIT", line): - x = re.sub ("[^\(]+\(", "", line) - x = re.sub ("\).*\n", "", x) - x = string.split (x, ",") - package = x [0] - version = x [1] - break - file.close () - # version = re.escape (version) - return package, version - -def fix_configure_ac_file (filename): - data = open (filename, 'r').read () - data = string.replace (data, "AM_INIT_AUTOMAKE(libsndfile,", "AM_INIT_AUTOMAKE(libsndfile_lite,", 1) - - file = open (filename, 'w') - file.write (data) - file.close () - - -def make_dist_file (package, version): - print "Making dist file." - tar_gz_file = "%s-%s.tar.gz" % (package, version) - if os.path.exists (tar_gz_file): - return - if os.system ("make dist"): - sys.exit (1) - return - -def delete_files (file_list): - for file_name in file_list: - os.remove (file_name) - -#======================================================================= - -source_dir = os.getcwd () - -conf_package, conf_version = find_configure_version ('configure.ac') - -package_version = "%s-%s" % (conf_package, conf_version) -lite_version = "%s_lite-%s" % (conf_package, conf_version) - -os.system ("rm -rf %s%s.tar.gz" % (source_dir, package_version)) - -os.system ("make dist") - -make_dist_file (conf_package, conf_version) - -os.chdir ("/tmp") - -print "Uncompressing .tar.gz file." -os.system ("rm -rf %s" % package_version) -if os.system ("tar zxf %s/%s.tar.gz" % (source_dir, package_version)): - sys.exit (1) - - -print "Renaming to libsndfile_lite." -os.system ("rm -rf %s" % lite_version) -os.rename (package_version, lite_version) - -print "Changing into libsndfile_lite directory." -os.chdir (lite_version) - -print "Removing un-neeed directories." -delete_dirs = [ 'src/G72x' ] - -for dir_name in delete_dirs: - os.system ("rm -rf %s" % dir_name) - -print "Removing un-needed files." -delete_files ([ 'src/ircam.c', 'src/nist.c', - 'src/ima_adpcm.c', 'src/ms_adpcm.c', 'src/au_g72x.c', - 'src/mat4.c', 'src/mat5.c', 'src/dwvw.c', 'src/paf.c', - 'src/ogg.c', 'src/pvf.c', 'src/xi.c', 'src/htk.c', - 'src/sd2.c', 'src/rx2.c', 'src/txw.c', 'src/wve.c', - 'src/dwd.c', 'src/svx.c', 'src/voc.c', 'src/vox_adpcm.c', - 'src/sds.c' - ]) - - -print "Hacking 'configure.ac' and 'src/Makefile.am'." -remove_strings_from_file ('configure.ac', [ 'src/G72x/Makefile' ]) -remove_strings_from_file ('src/Makefile.am', [ 'G72x/libg72x.la', 'G72x', - 'ircam.c', 'nist.c', 'ima_adpcm.c', 'ms_adpcm.c', 'au_g72x.c', 'mat4.c', - 'mat5.c', 'dwvw.c', 'paf.c', 'ogg.c', 'pvf.c', 'xi.c', 'htk.c', - 'sd2.c', 'rx2.c', 'txw.c', 'wve.c', 'dwd.c', 'svx.c', 'voc.c', - 'vox_adpcm.c', 'sds.c' - ]) - -#---------------------------------------------------------------------------- - -print "Hacking header files." - -remove_protos_from_file ('src/common.h', [ 'xi_open', 'sd2_open', 'ogg_open', - 'dwvw_init', 'paf_open', 'svx_open', 'nist_open', 'rx2_open', 'mat4_open', - 'voc_open', 'txw_open', 'dwd_open', 'htk_open', 'wve_open', 'mat5_open', - 'pvf_open', 'ircam_open', 'sds_open', - 'float32_init', 'double64_init', 'aiff_ima_init', 'vox_adpcm_init', - 'wav_w64_ima_init', 'wav_w64_msadpcm_init' - ]) - -remove_protos_from_file ('src/au.h', - [ 'au_g72x_reader_init', 'au_g72x_writer_init' ]) - -remove_protos_from_file ('src/wav_w64.h', [ 'msadpcm_write_adapt_coeffs' ]) - -#---------------------------------------------------------------------------- - -print "Hacking case statements." - -remove_comment_start_end ('src/sndfile.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/aiff.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/au.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/raw.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/w64.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/wav.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/double64.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/float32.c', '/* Lite remove start */' , '/* Lite remove end */') - - -#---------------------------------------------------------------------------- - -print "Hacking src/pcm.c." -remove_funcs_from_file ('src/pcm.c', [ - 'f2sc_array', 'f2sc_clip_array', 'f2uc_array', 'f2uc_clip_array', - 'f2bes_array', 'f2bes_clip_array', 'f2les_array', 'f2les_clip_array', - 'f2let_array', 'f2let_clip_array', 'f2bet_array', 'f2bet_clip_array', - 'f2bei_array', 'f2bei_clip_array', 'f2lei_array', 'f2lei_clip_array', - 'd2sc_array', 'd2sc_clip_array', 'd2uc_array', 'd2uc_clip_array', - 'd2bes_array', 'd2bes_clip_array', 'd2les_array', 'd2les_clip_array', - 'd2let_array', 'd2let_clip_array', 'd2bet_array', 'd2bet_clip_array', - 'd2bei_array', 'd2bei_clip_array', 'd2lei_array', 'd2lei_clip_array', - ]) - -remove_funcs_and_protos_from_file ('src/pcm.c', [ - 'pcm_read_sc2f', 'pcm_read_uc2f', 'pcm_read_les2f', 'pcm_read_bes2f', - 'pcm_read_let2f', 'pcm_read_bet2f', 'pcm_read_lei2f', 'pcm_read_bei2f', - 'pcm_read_sc2d', 'pcm_read_uc2d', 'pcm_read_les2d', 'pcm_read_bes2d', - 'pcm_read_let2d', 'pcm_read_bet2d', 'pcm_read_lei2d', 'pcm_read_bei2d', - 'pcm_write_f2sc', 'pcm_write_f2uc', 'pcm_write_f2bes', 'pcm_write_f2les', - 'pcm_write_f2bet', 'pcm_write_f2let', 'pcm_write_f2bei', 'pcm_write_f2lei', - 'pcm_write_d2sc', 'pcm_write_d2uc', 'pcm_write_d2bes', 'pcm_write_d2les', - 'pcm_write_d2bet', 'pcm_write_d2let', 'pcm_write_d2bei', 'pcm_write_d2lei', - - 'sc2f_array', 'uc2f_array', 'bes2f_array', 'les2f_array', - 'bet2f_array', 'let2f_array', 'bei2f_array', 'lei2f_array', - 'sc2d_array', 'uc2d_array', 'bes2d_array', 'les2d_array', - 'bet2d_array', 'let2d_array', 'bei2d_array', 'lei2d_array' - ]) - -remove_includes_from_file ('src/pcm.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/pcm.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- -print "Hacking src/ulaw.c." -remove_funcs_and_protos_from_file ('src/ulaw.c', [ - 'ulaw_read_ulaw2f', 'ulaw_read_ulaw2d', - 'ulaw_write_f2ulaw', 'ulaw_write_d2ulaw', - 'ulaw2f_array', 'ulaw2d_array', 'f2ulaw_array', 'd2ulaw_array' - ]) - -remove_includes_from_file ('src/ulaw.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/ulaw.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/alaw.c." -remove_funcs_and_protos_from_file ('src/alaw.c', [ - 'alaw_read_alaw2f', 'alaw_read_alaw2d', - 'alaw_write_f2alaw', 'alaw_write_d2alaw', - 'alaw2f_array', 'alaw2d_array', 'f2alaw_array', 'd2alaw_array' - ]) - -remove_includes_from_file ('src/alaw.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/alaw.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/gsm610.c." -remove_funcs_and_protos_from_file ('src/gsm610.c', [ - 'gsm610_read_f', 'gsm610_read_d', 'gsm610_write_f', 'gsm610_write_d' - ]) - -remove_includes_from_file ('src/gsm610.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/gsm610.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/float32.c." - -# string_replace_in_file ('src/float32.c', '"float_cast.h"', '') -remove_funcs_from_file ('src/float32.c', [ 'float32_init' ]) - -remove_funcs_and_protos_from_file ('src/float32.c', [ - 'host_read_f2s', 'host_read_f2i', 'host_read_f', 'host_read_f2d', - 'host_write_s2f', 'host_write_i2f', 'host_write_f', 'host_write_d2f', - 'f2s_array', 'f2i_array', 'f2d_array', 's2f_array', 'i2f_array', 'd2f_array', - 'float32_peak_update', - 'replace_read_f2s', 'replace_read_f2i', 'replace_read_f', 'replace_read_f2d', - 'replace_write_s2f', 'replace_write_i2f', 'replace_write_f', 'replace_write_d2f', - 'bf2f_array', 'f2bf_array', - 'float32_get_capability', - ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/double64.c." -remove_funcs_from_file ('src/double64.c', [ 'double64_init' ]) - -remove_funcs_and_protos_from_file ('src/double64.c', [ - 'host_read_d2s', 'host_read_d2i', 'host_read_d2f', 'host_read_d', - 'host_write_s2d', 'host_write_i2d', 'host_write_f2d', 'host_write_d', - 'd2s_array', 'd2i_array', 'd2f_array', - 's2d_array', 'i2d_array', 'f2d_array', - 'double64_peak_update', 'double64_get_capability', - 'replace_read_d2s', 'replace_read_d2i', 'replace_read_d2f', 'replace_read_d', - 'replace_write_s2d', 'replace_write_i2d', 'replace_write_f2d', 'replace_write_d', - 'd2bd_read', 'bd2d_write' - ]) - -#---------------------------------------------------------------------------- - -print "Hacking test programs." -delete_files ([ 'tests/dwvw_test.c', 'tests/floating_point_test.c', - 'tests/dft_cmp.c', 'tests/peak_chunk_test.c', - 'tests/scale_clip_test.tpl', 'tests/scale_clip_test.def' - ]) - -remove_comment_start_end ('tests/write_read_test.def', '/* Lite remove start */', '/* Lite remove end */') -remove_comment_start_end ('tests/write_read_test.tpl', '/* Lite remove start */', '/* Lite remove end */') - -remove_comment_start_end ('tests/Makefile.am', '# Lite remove start', '# Lite remove end') - -remove_strings_from_file ('tests/Makefile.am', [ - 'scale_clip_test.tpl', 'scale_clip_test.def', - '\n\t./dwvw_test', - '\n\t./floating_point_test', '\n\t./scale_clip_test', - '\n\t./peak_chunk_test aiff', '\n\t./peak_chunk_test wav', - '\n\t./command_test norm', '\n\t./command_test peak', - '\n\t./lossy_comp_test wav_ima', '\n\t./lossy_comp_test wav_msadpcm', - '\n\t./lossy_comp_test au_g721', '\n\t./lossy_comp_test au_g723', - '\n\t./lossy_comp_test vox_adpcm', - '\n\t./lossy_comp_test w64_ima', '\n\t./lossy_comp_test w64_msadpcm', - 'peak_chunk_test', 'dwvw_test', 'floating_point_test', 'scale_clip_test', - - 'paf-tests', 'svx-tests', 'nist-tests', 'ircam-tests', 'voc-tests', - 'mat4-tests', 'mat5-tests', 'pvf-tests', 'xi-tests', 'htk-tests', - 'sds-tests' - ]) - -remove_comment_start_end ('tests/pcm_test.c', '/* Lite remove start */', '/* Lite remove end */') -remove_funcs_and_protos_from_file ('tests/pcm_test.c', [ - 'pcm_test_float', 'pcm_test_double' - ]) - -remove_comment_start_end ('tests/lossy_comp_test.c', '/* Lite remove start */', '/* Lite remove end */') -remove_funcs_and_protos_from_file ('tests/lossy_comp_test.c', [ - 'lcomp_test_float', 'lcomp_test_double', 'sdlcomp_test_float', 'sdlcomp_test_double', - 'smoothed_diff_float', 'smoothed_diff_double' - ]) - -remove_comment_start_end ('tests/multi_file_test.c', '/* Lite remove start */', '/* Lite remove end */') - -remove_strings_from_file ('tests/stdio_test.c', [ - '"paf",', '"svx",', '"nist",', '"ircam",', '"voc",', '"mat4",', '"mat5",', '"pvf",' - ]) - -remove_comment_start_end ('tests/pipe_test.c', '/* Lite remove start */', '/* Lite remove end */') - -#---------------------------------------------------------------------------- - -print "Fixing configure.ac file." -fix_configure_ac_file ('configure.ac') - -print "Building and testing source." - # Try --disable-shared --disable-gcc-opt -if os.system ("./reconfigure.mk && ./configure --disable-shared --disable-gcc-opt && make check"): - os.system ('PS1="FIX > " bash --norc') - sys.exit (1) - -print "Making distcheck" -if os.system ("make distcheck"): - os.system ('PS1="FIX > " bash --norc') - sys.exit (1) - -print "Copying tarball" -if os.system ("cp %s.tar.gz %s" % (lite_version, source_dir)): - print "??? %s.tar.gz ???" % lite_version - os.system ('PS1="FIX > " bash --norc') - sys.exit (1) - -os.chdir (source_dir) - -os.system ("rm -rf /tmp/%s" % lite_version) - -print "Done." diff --git a/libs/libsndfile/man/Makefile.am b/libs/libsndfile/man/Makefile.am deleted file mode 100644 index 3f5d9efdc4..0000000000 --- a/libs/libsndfile/man/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = sndfile-info.1 sndfile-play.1 sndfile-convert.1 sndfile-cmp.1 \ - sndfile-metadata-get.1 sndfile-metadata-set.1 sndfile-concat.1 \ - sndfile-interleave.1 sndfile-deinterleave.1 - -EXTRA_DIST = sndfile-info.1 sndfile-play.1 sndfile-convert.1 sndfile-cmp.1 \ - sndfile-metadata-get.1 sndfile-concat.1 sndfile-interleave.1 - -# Same manpage for both programs. -sndfile-metadata-set.1 : sndfile-metadata-get.1 - $(LN_S) $(srcdir)/sndfile-metadata-get.1 $@ - -sndfile-deinterleave.1 : sndfile-interleave.1 - $(LN_S) $(srcdir)/sndfile-interleave.1 $@ diff --git a/libs/libsndfile/man/sndfile-cmp.1 b/libs/libsndfile/man/sndfile-cmp.1 deleted file mode 100644 index 30870bdfc3..0000000000 --- a/libs/libsndfile/man/sndfile-cmp.1 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SNDFILE-CMP 1 "October 5, 2009" -.SH NAME -sndfile-cmp \- compares two audio files -.SH SYNOPSIS -.B sndfile-cmp -.RI "file1 file2" -.SH DESCRIPTION -sndfile-cmp compares the audio data of two sound files. In particular most -differences in the audio file header, particularly metadata like string info, -are completely ignored. - -sndfile-cmp does its work using libsndfile -(http://www.mega-nerd.com/libsndfile/). -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-concat.1 b/libs/libsndfile/man/sndfile-concat.1 deleted file mode 100644 index 1d95765f6c..0000000000 --- a/libs/libsndfile/man/sndfile-concat.1 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SNDFILE-CONCAT 1 "December 9, 2009" -.SH NAME -sndfile-concat \- concatenates two or more audio files -.SH SYNOPSIS -.B sndfile-concat -.RI "infile1 infile2 .... outfile" -.SH DESCRIPTION -sndfile-concat generates a new output file by concatenating two or more input -files. The format of the output file is the same as the format of the input -file. - -sndfile-concat does its work using libsndfile -(http://www.mega-nerd.com/libsndfile/). -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-convert.1 b/libs/libsndfile/man/sndfile-convert.1 deleted file mode 100644 index 583c9562c9..0000000000 --- a/libs/libsndfile/man/sndfile-convert.1 +++ /dev/null @@ -1,22 +0,0 @@ -.TH SNDFILE-CONVERT 1 "October 09, 2002" -.SH NAME -sndfile-convert \- convert a sound files from one format to another -.SH SYNOPSIS -.B sndfile-convert -.RI "[encoding] input_file output_file" -.LP -.B sndfile-convert -.RI --help -.SH DESCRIPTION -sndfile-convert converts sound files from one format to another using -libsndfile (http://www.mega-nerd.com/libsndfile/) to read and write -the data. -.LP -The format of the output file is determined by the filename extension -of the output file. -.LP -The optional encoding parameter allows setting of the data encoding for -the output file. Run "sndfile\-convert \-\-help" for more information. -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-info.1 b/libs/libsndfile/man/sndfile-info.1 deleted file mode 100644 index b66875852d..0000000000 --- a/libs/libsndfile/man/sndfile-info.1 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SNDFILE-INFO 1 "July 28, 2002" -.SH NAME -sndfile-info \- display information about a sound file -.SH SYNOPSIS -.B sndfile-info -.RI file -.SH DESCRIPTION -sndfile-info will display basic information about a sound file such as -its format, its sample rate, and the number of channels. This information -is obtained using libsndfile (http://www.mega-nerd.com/libsndfile/). -.SH AUTHOR -This manual page was originally written by Joshua Haberman -, for the Debian GNU/Linux system (but may be used by -others). Further additions have been made by Erik de Castro Lopo -. - diff --git a/libs/libsndfile/man/sndfile-interleave.1 b/libs/libsndfile/man/sndfile-interleave.1 deleted file mode 100644 index 26ca345205..0000000000 --- a/libs/libsndfile/man/sndfile-interleave.1 +++ /dev/null @@ -1,23 +0,0 @@ -.TH SNDFILE-INTERLEAVE 1 "December 14, 2009" -.SH NAME -sndfile-interleave \- convert multiple single channel files into a multi-channel file -.br -sndfile-deinterleave \- split a multi-channel into multiple single channel files -.SH SYNOPSIS -.B sndfile-interleave -.RI " ... -o " -.br -.B sndfile-deinterleave -.RI "filename" - -.SH DESCRIPTION -sndfile-interleave and sndfile-deinterleave use libsndfile -(http://www.mega-nerd.com/libsndfile/) to convert back and forth between multiple -single channel files and a single multi-channel sound file. - -Run "sndfile\-interleave \-\-help" or "sndfile\-deinterleave \-\-help" for -more information - -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-metadata-get.1 b/libs/libsndfile/man/sndfile-metadata-get.1 deleted file mode 100644 index b97560ea39..0000000000 --- a/libs/libsndfile/man/sndfile-metadata-get.1 +++ /dev/null @@ -1,26 +0,0 @@ -.TH SNDFILE-METADATA-GET 1 "October 6, 2009" -.SH NAME -sndfile-metadata-get \- retrieve metadata from a sound file -.br -sndfile-metadata-set \- set metadata in a sound file -.SH SYNOPSIS -.B sndfile-metadata-get -.RI "[options] file" -.br -.B sndfile-metadata-set -.RI "[options] file" -.br -.B sndfile-metadata-set -.RI "[options] input-file output-file" - -.SH DESCRIPTION -sndfile-metadata-get and sndfile-metadata-set use libsndfile -(http://www.mega-nerd.com/libsndfile/) to retrieve metadata from or set metadata -in a sound file. - -Run "sndfile\-metadata\-get \-\-help" or "sndfile\-metadata\-set \-\-help" for -more information - -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-play.1 b/libs/libsndfile/man/sndfile-play.1 deleted file mode 100644 index 0196461c19..0000000000 --- a/libs/libsndfile/man/sndfile-play.1 +++ /dev/null @@ -1,36 +0,0 @@ -.de EX -.ne 5 -.if n .sp 1 -.if t .sp .5 -.nf -.in +.5i -.. -.de EE -.fi -.in -.5i -.if n .sp 1 -.if t .sp .5 -.. -.TH SNDFILE-PLAY 1 "July 28, 2002" -.SH NAME -sndfile-play \- play a sound file -.SH SYNOPSIS -.B sndfile-play -.RI file -.SH DESCRIPTION -sndfile-play plays the specified sound file using : -.EX -ALSA on Linux -/dev/dsp on systems supporting OSS (including Linux) -/dev/audio on Sun Solaris -CoreAudio on Apple MacOSX -waveOut on Microsoft Win32 -.EE -sndfile-play uses libsndfile (http://www.mega-nerd.com/libsndfile/) -to read the file. -.SH AUTHOR -This manual page was originally written by Joshua Haberman -, for the Debian GNU/Linux system (but may be used by -others). Further additions have been made by Erik de Castro Lopo -. - diff --git a/libs/libsndfile/programs/Makefile.am b/libs/libsndfile/programs/Makefile.am deleted file mode 100644 index 81495539b3..0000000000 --- a/libs/libsndfile/programs/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = sndfile-info sndfile-play sndfile-convert sndfile-cmp \ - sndfile-metadata-set sndfile-metadata-get sndfile-interleave \ - sndfile-deinterleave sndfile-concat sndfile-salvage - -OS_SPECIFIC_CFLAGS = @OS_SPECIFIC_CFLAGS@ -OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@ - -AM_CPPFLAGS = -I$(top_srcdir)/src $(OS_SPECIFIC_CFLAGS) - -CLEANFILES = *~ sndfile-*.exe - -# This is the BeOS version of sndfile-play. It needs to be compiled with the C++ -# compiler. -EXTRA_DIST = sndfile-play-beos.cpp test-sndfile-metadata-set.py - -sndfile_info_SOURCES = sndfile-info.c common.c common.h -sndfile_info_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_play_SOURCES = sndfile-play.c common.c common.h -sndfile_play_LDADD = $(top_builddir)/src/libsndfile.la $(OS_SPECIFIC_LINKS) $(ALSA_LIBS) $(SNDIO_LIBS) - -sndfile_convert_SOURCES = sndfile-convert.c common.c common.h -sndfile_convert_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_cmp_SOURCES = sndfile-cmp.c common.c common.h -sndfile_cmp_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_metadata_set_SOURCES = sndfile-metadata-set.c common.c common.h -sndfile_metadata_set_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_metadata_get_SOURCES = sndfile-metadata-get.c common.c common.h -sndfile_metadata_get_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_interleave_SOURCES = sndfile-interleave.c common.c common.h -sndfile_interleave_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_deinterleave_SOURCES = sndfile-deinterleave.c common.c common.h -sndfile_deinterleave_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_concat_SOURCES = sndfile-concat.c common.c common.h -sndfile_concat_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_salvage_SOURCES = sndfile-salvage.c common.c common.h -sndfile_salvage_LDADD = $(top_builddir)/src/libsndfile.la - diff --git a/libs/libsndfile/programs/common.c b/libs/libsndfile/programs/common.c deleted file mode 100644 index 2811536f3f..0000000000 --- a/libs/libsndfile/programs/common.c +++ /dev/null @@ -1,466 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** Copyright (C) 2008 George Blood Audio -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN 4096 - -#define MIN(x, y) ((x) < (y) ? (x) : (y)) - -void -sfe_copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels, int normalize) -{ static double data [BUFFER_LEN], max ; - int frames, readcount, k ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_command (infile, SFC_CALC_SIGNAL_MAX, &max, sizeof (max)) ; - - if (!normalize && max < 1.0) - { while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - sf_writef_double (outfile, data, readcount) ; - } ; - } - else - { sf_command (infile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - for (k = 0 ; k < readcount * channels ; k++) - data [k] /= max ; - sf_writef_double (outfile, data, readcount) ; - } ; - } ; - - return ; -} /* sfe_copy_data_fp */ - -void -sfe_copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) -{ static int data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - while (readcount > 0) - { readcount = sf_readf_int (infile, data, frames) ; - sf_writef_int (outfile, data, readcount) ; - } ; - - return ; -} /* sfe_copy_data_int */ - -/*============================================================================== -*/ - -static int -merge_broadcast_info (SNDFILE * infile, SNDFILE * outfile, int format, const METADATA_INFO * info) -{ SF_BROADCAST_INFO_2K binfo ; - int infileminor ; - - memset (&binfo, 0, sizeof (binfo)) ; - - if ((SF_FORMAT_TYPEMASK & format) != SF_FORMAT_WAV) - { printf ("Error : This is not a WAV file and hence broadcast info cannot be added to it.\n\n") ; - return 1 ; - } ; - - infileminor = SF_FORMAT_SUBMASK & format ; - - switch (infileminor) - { case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - break ; - - default : - printf ( - "Warning : The EBU Technical Recommendation R68-2000 states that the only\n" - " allowed encodings are Linear PCM and MPEG3. This file is not in\n" - " the right format.\n\n" - ) ; - break ; - } ; - - if (sf_command (infile, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == 0) - { if (infile == outfile) - { printf ( - "Error : Attempting in-place broadcast info update, but file does not\n" - " have a 'bext' chunk to modify. The solution is to specify both\n" - " input and output files on the command line.\n\n" - ) ; - return 1 ; - } ; - } ; - -#define REPLACE_IF_NEW(x) \ - if (info->x != NULL) \ - { memset (binfo.x, 0, sizeof (binfo.x)) ; \ - memcpy (binfo.x, info->x, MIN (strlen (info->x), sizeof (binfo.x))) ; \ - } ; - - REPLACE_IF_NEW (description) ; - REPLACE_IF_NEW (originator) ; - REPLACE_IF_NEW (originator_reference) ; - REPLACE_IF_NEW (origination_date) ; - REPLACE_IF_NEW (origination_time) ; - REPLACE_IF_NEW (umid) ; - - /* Special case for Time Ref. */ - if (info->time_ref != NULL) - { uint64_t ts = atoll (info->time_ref) ; - - binfo.time_reference_high = (ts >> 32) ; - binfo.time_reference_low = (ts & 0xffffffff) ; - } ; - - /* Special case for coding_history because we may want to append. */ - if (info->coding_history != NULL) - { if (info->coding_hist_append) - { int slen = strlen (binfo.coding_history) ; - - while (slen > 1 && isspace (binfo.coding_history [slen - 1])) - slen -- ; - - memcpy (binfo.coding_history + slen, info->coding_history, sizeof (binfo.coding_history) - slen) ; - } - else - { size_t slen = MIN (strlen (info->coding_history), sizeof (binfo.coding_history)) ; - - memset (binfo.coding_history, 0, sizeof (binfo.coding_history)) ; - memcpy (binfo.coding_history, info->coding_history, slen) ; - binfo.coding_history_size = slen ; - } ; - } ; - - if (sf_command (outfile, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) == 0) - { printf ("Error : Setting of broadcast info chunks failed.\n\n") ; - return 1 ; - } ; - - return 0 ; -} /* merge_broadcast_info*/ - -static void -update_strings (SNDFILE * outfile, const METADATA_INFO * info) -{ - if (info->title != NULL) - sf_set_string (outfile, SF_STR_TITLE, info->title) ; - - if (info->copyright != NULL) - sf_set_string (outfile, SF_STR_COPYRIGHT, info->copyright) ; - - if (info->artist != NULL) - sf_set_string (outfile, SF_STR_ARTIST, info->artist) ; - - if (info->comment != NULL) - sf_set_string (outfile, SF_STR_COMMENT, info->comment) ; - - if (info->date != NULL) - sf_set_string (outfile, SF_STR_DATE, info->date) ; - - if (info->album != NULL) - sf_set_string (outfile, SF_STR_ALBUM, info->album) ; - - if (info->license != NULL) - sf_set_string (outfile, SF_STR_LICENSE, info->license) ; - -} /* update_strings */ - - - -void -sfe_apply_metadata_changes (const char * filenames [2], const METADATA_INFO * info) -{ SNDFILE *infile = NULL, *outfile = NULL ; - SF_INFO sfinfo ; - METADATA_INFO tmpinfo ; - int error_code = 0 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - memset (&tmpinfo, 0, sizeof (tmpinfo)) ; - - if (filenames [1] == NULL) - infile = outfile = sf_open (filenames [0], SFM_RDWR, &sfinfo) ; - else - { infile = sf_open (filenames [0], SFM_READ, &sfinfo) ; - - /* Output must be WAV. */ - sfinfo.format = SF_FORMAT_WAV | (SF_FORMAT_SUBMASK & sfinfo.format) ; - outfile = sf_open (filenames [1], SFM_WRITE, &sfinfo) ; - } ; - - if (infile == NULL) - { printf ("Error : Not able to open input file '%s' : %s\n", filenames [0], sf_strerror (infile)) ; - error_code = 1 ; - goto cleanup_exit ; - } ; - - if (outfile == NULL) - { printf ("Error : Not able to open output file '%s' : %s\n", filenames [1], sf_strerror (outfile)) ; - error_code = 1 ; - goto cleanup_exit ; - } ; - - if (info->has_bext_fields && merge_broadcast_info (infile, outfile, sfinfo.format, info)) - { error_code = 1 ; - goto cleanup_exit ; - } ; - - if (infile != outfile) - { int infileminor = SF_FORMAT_SUBMASK & sfinfo.format ; - - /* If the input file is not the same as the output file, copy the data. */ - if ((infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT)) - sfe_copy_data_fp (outfile, infile, sfinfo.channels, SF_FALSE) ; - else - sfe_copy_data_int (outfile, infile, sfinfo.channels) ; - } ; - - update_strings (outfile, info) ; - -cleanup_exit : - - if (outfile != NULL && outfile != infile) - sf_close (outfile) ; - - if (infile != NULL) - sf_close (infile) ; - - if (error_code) - exit (error_code) ; - - return ; -} /* sfe_apply_metadata_changes */ - -/*============================================================================== -*/ - -typedef struct -{ const char *ext ; - int len ; - int format ; -} OUTPUT_FORMAT_MAP ; - -static OUTPUT_FORMAT_MAP format_map [] = -{ - { "aif", 3, SF_FORMAT_AIFF }, - { "wav", 0, SF_FORMAT_WAV }, - { "au", 0, SF_FORMAT_AU }, - { "caf", 0, SF_FORMAT_CAF }, - { "flac", 0, SF_FORMAT_FLAC }, - { "snd", 0, SF_FORMAT_AU }, - { "svx", 0, SF_FORMAT_SVX }, - { "paf", 0, SF_ENDIAN_BIG | SF_FORMAT_PAF }, - { "fap", 0, SF_ENDIAN_LITTLE | SF_FORMAT_PAF }, - { "gsm", 0, SF_FORMAT_RAW }, - { "nist", 0, SF_FORMAT_NIST }, - { "htk", 0, SF_FORMAT_HTK }, - { "ircam", 0, SF_FORMAT_IRCAM }, - { "sf", 0, SF_FORMAT_IRCAM }, - { "voc", 0, SF_FORMAT_VOC }, - { "w64", 0, SF_FORMAT_W64 }, - { "raw", 0, SF_FORMAT_RAW }, - { "mat4", 0, SF_FORMAT_MAT4 }, - { "mat5", 0, SF_FORMAT_MAT5 }, - { "mat", 0, SF_FORMAT_MAT4 }, - { "pvf", 0, SF_FORMAT_PVF }, - { "sds", 0, SF_FORMAT_SDS }, - { "sd2", 0, SF_FORMAT_SD2 }, - { "vox", 0, SF_FORMAT_RAW }, - { "xi", 0, SF_FORMAT_XI }, - { "wve", 0, SF_FORMAT_WVE }, - { "oga", 0, SF_FORMAT_OGG }, - { "ogg", 0, SF_FORMAT_OGG }, - { "mpc", 0, SF_FORMAT_MPC2K }, - { "rf64", 0, SF_FORMAT_RF64 }, -} ; /* format_map */ - -int -sfe_file_type_of_ext (const char *str, int format) -{ char buffer [16], *cptr ; - int k ; - - format &= SF_FORMAT_SUBMASK ; - - if ((cptr = strrchr (str, '.')) == NULL) - return 0 ; - - strncpy (buffer, cptr + 1, 15) ; - buffer [15] = 0 ; - - for (k = 0 ; buffer [k] ; k++) - buffer [k] = tolower ((buffer [k])) ; - - if (strcmp (buffer, "gsm") == 0) - return SF_FORMAT_RAW | SF_FORMAT_GSM610 ; - - if (strcmp (buffer, "vox") == 0) - return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; - - for (k = 0 ; k < (int) (sizeof (format_map) / sizeof (format_map [0])) ; k++) - { if (format_map [k].len > 0 && strncmp (buffer, format_map [k].ext, format_map [k].len) == 0) - return format_map [k].format | format ; - else if (strcmp (buffer, format_map [k].ext) == 0) - return format_map [k].format | format ; - } ; - - /* Default if all the above fails. */ - return (SF_FORMAT_WAV | SF_FORMAT_PCM_24) ; -} /* sfe_file_type_of_ext */ - -void -sfe_dump_format_map (void) -{ SF_FORMAT_INFO info ; - int k ; - - for (k = 0 ; k < ARRAY_LEN (format_map) ; k++) - { info.format = format_map [k].format ; - sf_command (NULL, SFC_GET_FORMAT_INFO, &info, sizeof (info)) ; - printf (" %-10s : %s\n", format_map [k].ext, info.name == NULL ? "????" : info.name) ; - } ; - -} /* sfe_dump_format_map */ - -const char * -program_name (const char * argv0) -{ const char * tmp ; - - tmp = strrchr (argv0, '/') ; - argv0 = tmp ? tmp + 1 : argv0 ; - - tmp = strrchr (argv0, '/') ; - argv0 = tmp ? tmp + 1 : argv0 ; - - /* Remove leading libtool name mangling. */ - if (strstr (argv0, "lt-") == argv0) - return argv0 + 3 ; - - return argv0 ; -} /* program_name */ - -const char * -sfe_endian_name (int format) -{ - switch (format & SF_FORMAT_ENDMASK) - { case SF_ENDIAN_FILE : return "file" ; - case SF_ENDIAN_LITTLE : return "little" ; - case SF_ENDIAN_BIG : return "big" ; - case SF_ENDIAN_CPU : return "cpu" ; - default : break ; - } ; - - return "unknown" ; -} /* sfe_endian_name */ - -const char * -sfe_container_name (int format) -{ - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_WAV : return "WAV" ; - case SF_FORMAT_AIFF : return "AIFF" ; - case SF_FORMAT_AU : return "AU" ; - case SF_FORMAT_RAW : return "RAW" ; - case SF_FORMAT_PAF : return "PAF" ; - case SF_FORMAT_SVX : return "SVX" ; - case SF_FORMAT_NIST : return "NIST" ; - case SF_FORMAT_VOC : return "VOC" ; - case SF_FORMAT_IRCAM : return "IRCAM" ; - case SF_FORMAT_W64 : return "W64" ; - case SF_FORMAT_MAT4 : return "MAT4" ; - case SF_FORMAT_MAT5 : return "MAT5" ; - case SF_FORMAT_PVF : return "PVF" ; - case SF_FORMAT_XI : return "XI" ; - case SF_FORMAT_HTK : return "HTK" ; - case SF_FORMAT_SDS : return "SDS" ; - case SF_FORMAT_AVR : return "AVR" ; - case SF_FORMAT_WAVEX : return "WAVEX" ; - case SF_FORMAT_SD2 : return "SD2" ; - case SF_FORMAT_FLAC : return "FLAC" ; - case SF_FORMAT_CAF : return "CAF" ; - case SF_FORMAT_WVE : return "WVE" ; - case SF_FORMAT_OGG : return "OGG" ; - case SF_FORMAT_MPC2K : return "MPC2K" ; - case SF_FORMAT_RF64 : return "RF64" ; - default : break ; - } ; - - return "unknown" ; -} /* sfe_container_name */ - -const char * -sfe_codec_name (int format) -{ - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_S8 : return "signed 8 bit PCM" ; - case SF_FORMAT_PCM_16 : return "16 bit PCM" ; - case SF_FORMAT_PCM_24 : return "24 bit PCM" ; - case SF_FORMAT_PCM_32 : return "32 bit PCM" ; - case SF_FORMAT_PCM_U8 : return "unsigned 8 bit PCM" ; - case SF_FORMAT_FLOAT : return "32 bit float" ; - case SF_FORMAT_DOUBLE : return "64 bit double" ; - case SF_FORMAT_ULAW : return "u-law" ; - case SF_FORMAT_ALAW : return "a-law" ; - case SF_FORMAT_IMA_ADPCM : return "IMA ADPCM" ; - case SF_FORMAT_MS_ADPCM : return "MS ADPCM" ; - case SF_FORMAT_GSM610 : return "gsm610" ; - case SF_FORMAT_VOX_ADPCM : return "Vox ADPCM" ; - case SF_FORMAT_G721_32 : return "g721 32kbps" ; - case SF_FORMAT_G723_24 : return "g723 24kbps" ; - case SF_FORMAT_G723_40 : return "g723 40kbps" ; - case SF_FORMAT_DWVW_12 : return "12 bit DWVW" ; - case SF_FORMAT_DWVW_16 : return "16 bit DWVW" ; - case SF_FORMAT_DWVW_24 : return "14 bit DWVW" ; - case SF_FORMAT_DWVW_N : return "DWVW" ; - case SF_FORMAT_DPCM_8 : return "8 bit DPCM" ; - case SF_FORMAT_DPCM_16 : return "16 bit DPCM" ; - case SF_FORMAT_VORBIS : return "Vorbis" ; - case SF_FORMAT_ALAC_16 : return "16 bit ALAC" ; - case SF_FORMAT_ALAC_20 : return "20 bit ALAC" ; - case SF_FORMAT_ALAC_24 : return "24 bit ALAC" ; - case SF_FORMAT_ALAC_32 : return "32 bit ALAC" ; - default : break ; - } ; - return "unknown" ; -} /* sfe_codec_name */ - diff --git a/libs/libsndfile/programs/common.h b/libs/libsndfile/programs/common.h deleted file mode 100644 index eda2d7d743..0000000000 --- a/libs/libsndfile/programs/common.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof (x [0]))) -#define MAX(a, b) ((a) > (b) ? (a) : (b)) - -typedef struct -{ const char * title ; - const char * copyright ; - const char * artist ; - const char * comment ; - const char * date ; - const char * album ; - const char * license ; - - - /* Stuff to go in the 'bext' chunk of WAV files. */ - int has_bext_fields ; - int coding_hist_append ; - - const char * description ; - const char * originator ; - const char * originator_reference ; - const char * origination_date ; - const char * origination_time ; - const char * umid ; - const char * coding_history ; - const char * time_ref ; -} METADATA_INFO ; - -typedef SF_BROADCAST_INFO_VAR (2048) SF_BROADCAST_INFO_2K ; - -void sfe_apply_metadata_changes (const char * filenames [2], const METADATA_INFO * info) ; - -void sfe_copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels, int normalize) ; - -void sfe_copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) ; - -int sfe_file_type_of_ext (const char *filename, int format) ; - -void sfe_dump_format_map (void) ; - -const char * program_name (const char * argv0) ; - -const char * sfe_endian_name (int format) ; -const char * sfe_container_name (int format) ; -const char * sfe_codec_name (int format) ; - diff --git a/libs/libsndfile/programs/sndfile-cmp.c b/libs/libsndfile/programs/sndfile-cmp.c deleted file mode 100644 index 121d25a629..0000000000 --- a/libs/libsndfile/programs/sndfile-cmp.c +++ /dev/null @@ -1,165 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2008 Conrad Parker -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include "common.h" - -/* Length of comparison data buffers in units of items */ -#define BUFLEN 65536 - -static const char * progname = NULL ; -static char * filename1 = NULL, * filename2 = NULL ; - -static int -comparison_error (const char * what, sf_count_t frame_offset) -{ char buffer [128] = "" ; - - if (frame_offset >= 0) - snprintf (buffer, sizeof (buffer), " (at frame offset %" PRId64 ")", frame_offset) ; - - printf ("%s: %s of files %s and %s differ%s.\n", progname, what, filename1, filename2, buffer) ; - return 1 ; -} /* comparison_error */ - -static int -compare (void) -{ - double buf1 [BUFLEN], buf2 [BUFLEN] ; - SF_INFO sfinfo1, sfinfo2 ; - SNDFILE * sf1 = NULL, * sf2 = NULL ; - sf_count_t items, i, nread1, nread2, offset = 0 ; - int retval = 0 ; - - memset (&sfinfo1, 0, sizeof (SF_INFO)) ; - sf1 = sf_open (filename1, SFM_READ, &sfinfo1) ; - if (sf1 == NULL) - { printf ("Error opening %s.\n", filename1) ; - retval = 1 ; - goto out ; - } ; - - memset (&sfinfo2, 0, sizeof (SF_INFO)) ; - sf2 = sf_open (filename2, SFM_READ, &sfinfo2) ; - if (sf2 == NULL) - { printf ("Error opening %s.\n", filename2) ; - retval = 1 ; - goto out ; - } ; - - if (sfinfo1.samplerate != sfinfo2.samplerate) - { retval = comparison_error ("Samplerates", -1) ; - goto out ; - } ; - - if (sfinfo1.channels != sfinfo2.channels) - { retval = comparison_error ("Number of channels", -1) ; - goto out ; - } ; - - /* Calculate the framecount that will fit in our data buffers */ - items = BUFLEN / sfinfo1.channels ; - - while ((nread1 = sf_readf_double (sf1, buf1, items)) > 0) - { nread2 = sf_readf_double (sf2, buf2, nread1) ; - if (nread2 != nread1) - { retval = comparison_error ("PCM data lengths", -1) ; - goto out ; - } ; - for (i = 0 ; i < nread1 * sfinfo1.channels ; i++) - { if (buf1 [i] != buf2 [i]) - { retval = comparison_error ("PCM data", offset + i / sfinfo1.channels) ; - goto out ; - } ; - } ; - offset += nread1 ; - } ; - - if ((nread2 = sf_readf_double (sf2, buf2, items)) != 0) - { retval = comparison_error ("PCM data lengths", -1) ; - goto out ; - } ; - -out : - sf_close (sf1) ; - sf_close (sf2) ; - - return retval ; -} /* compare */ - -static void -print_version (void) -{ char buffer [256] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - printf ("\nVersion : %s\n\n", buffer) ; -} /* print_version */ - -static void -usage_exit (void) -{ - print_version () ; - - printf ("Usage : %s \n", progname) ; - printf (" Compare the PCM data of two sound files.\n\n") ; - exit (0) ; -} /* usage_exit */ - -int -main (int argc, char *argv []) -{ - progname = program_name (argv [0]) ; - - if (argc != 3) - { usage_exit () ; - return 1 ; - } ; - - filename1 = argv [argc - 2] ; - filename2 = argv [argc - 1] ; - - if (strcmp (filename1, filename2) == 0) - { printf ("Error : Input filenames are the same.\n\n") ; - usage_exit () ; - return 1 ; - } ; - - return compare () ; -} /* main */ diff --git a/libs/libsndfile/programs/sndfile-concat.c b/libs/libsndfile/programs/sndfile-concat.c deleted file mode 100644 index ef5312b693..0000000000 --- a/libs/libsndfile/programs/sndfile-concat.c +++ /dev/null @@ -1,169 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - - -static void concat_data_fp (SNDFILE *wfile, SNDFILE *rofile, int channels) ; -static void concat_data_int (SNDFILE *wfile, SNDFILE *rofile, int channels) ; - -static void -usage_exit (const char *progname) -{ - printf ("\nUsage : %s ... \n\n", progname) ; - puts ( - " Create a new output file containing the concatenated\n" - " audio data from froms ....\n" - "\n" - " The joined file will be encoded in the same format as the data\n" - " in infile1, with all the data in subsequent files automatically\n" - " converted to the correct encoding.\n" - "\n" - " The only restriction is that the two files must have the same\n" - " number of channels.\n" - ) ; - - exit (0) ; -} /* usage_exit */ - -int -main (int argc, char *argv []) -{ const char *progname, *outfilename ; - SNDFILE *outfile, **infiles ; - SF_INFO sfinfo_out, sfinfo_in ; - void (*func) (SNDFILE*, SNDFILE*, int) ; - int k ; - - progname = program_name (argv [0]) ; - - if (argc < 4) - usage_exit (progname) ; - - argv ++ ; - argc -- ; - - argc -- ; - outfilename = argv [argc] ; - - if ((infiles = calloc (argc, sizeof (SNDFILE*))) == NULL) - { printf ("\nError : Malloc failed.\n\n") ; - exit (1) ; - } ; - - memset (&sfinfo_in, 0, sizeof (sfinfo_in)) ; - - if ((infiles [0] = sf_open (argv [0], SFM_READ, &sfinfo_in)) == NULL) - { printf ("\nError : failed to open file '%s'.\n\n", argv [0]) ; - exit (1) ; - } ; - - sfinfo_out = sfinfo_in ; - - for (k = 1 ; k < argc ; k++) - { if ((infiles [k] = sf_open (argv [k], SFM_READ, &sfinfo_in)) == NULL) - { printf ("\nError : failed to open file '%s'.\n\n", argv [k]) ; - exit (1) ; - } ; - - if (sfinfo_in.channels != sfinfo_out.channels) - { printf ("\nError : File '%s' has %d channels (should have %d).\n\n", argv [k], sfinfo_in.channels, sfinfo_out.channels) ; - exit (1) ; - } ; - } ; - - if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo_out)) == NULL) - { printf ("\nError : Not able to open input file %s.\n", outfilename) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if ((sfinfo_out.format & SF_FORMAT_SUBMASK) == SF_FORMAT_DOUBLE || - (sfinfo_out.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT) - func = concat_data_fp ; - else - func = concat_data_int ; - - for (k = 0 ; k < argc ; k++) - { func (outfile, infiles [k], sfinfo_out.channels) ; - sf_close (infiles [k]) ; - } ; - - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -concat_data_fp (SNDFILE *wfile, SNDFILE *rofile, int channels) -{ static double data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_seek (wfile, 0, SEEK_END) ; - - while (readcount > 0) - { readcount = sf_readf_double (rofile, data, frames) ; - sf_writef_double (wfile, data, readcount) ; - } ; - - return ; -} /* concat_data_fp */ - -static void -concat_data_int (SNDFILE *wfile, SNDFILE *rofile, int channels) -{ static int data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_seek (wfile, 0, SEEK_END) ; - - while (readcount > 0) - { readcount = sf_readf_int (rofile, data, frames) ; - sf_writef_int (wfile, data, readcount) ; - } ; - - return ; -} /* concat_data_int */ - diff --git a/libs/libsndfile/programs/sndfile-convert.c b/libs/libsndfile/programs/sndfile-convert.c deleted file mode 100644 index c22cc9b16a..0000000000 --- a/libs/libsndfile/programs/sndfile-convert.c +++ /dev/null @@ -1,377 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#include "common.h" - - -typedef struct -{ char *infilename, *outfilename ; - SF_INFO infileinfo, outfileinfo ; -} OptionData ; - -static void copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels) ; - -static void -usage_exit (const char *progname) -{ - printf ("\nUsage : %s [options] [encoding] \n", progname) ; - puts ("\n" - " where [option] may be:\n\n" - " -override-sample-rate=X : force sample rate of input to X\n" - " -endian=little : force output file to little endian data\n" - " -endian=big : force output file to big endian data\n" - " -endian=cpu : force output file same endian-ness as the CPU\n" - " -normalize : normalize the data in the output file\n" - ) ; - - puts ( - " where [encoding] may be one of the following:\n\n" - " -pcms8 : force the output to signed 8 bit pcm\n" - " -pcmu8 : force the output to unsigned 8 bit pcm\n" - " -pcm16 : force the output to 16 bit pcm\n" - " -pcm24 : force the output to 24 bit pcm\n" - " -pcm32 : force the output to 32 bit pcm\n" - " -float32 : force the output to 32 bit floating point" - ) ; - puts ( - " -ulaw : force the output ULAW\n" - " -alaw : force the output ALAW\n" - " -alac16 : force the output 16 bit ALAC (CAF only)\n" - " -alac20 : force the output 20 bit ALAC (CAF only)\n" - " -alac24 : force the output 24 bit ALAC (CAF only)\n" - " -alac32 : force the output 32 bit ALAC (CAF only)\n" - " -ima-adpcm : force the output to IMA ADPCM (WAV only)\n" - " -ms-adpcm : force the output to MS ADPCM (WAV only)\n" - " -gsm610 : force the GSM6.10 (WAV only)\n" - " -dwvw12 : force the output to 12 bit DWVW (AIFF only)\n" - " -dwvw16 : force the output to 16 bit DWVW (AIFF only)\n" - " -dwvw24 : force the output to 24 bit DWVW (AIFF only)\n" - " -vorbis : force the output to Vorbis (OGG only)\n" - ) ; - - puts ( - " If no encoding is specified, the program will try to use the encoding\n" - " of the input file in the output file. This will not always work as\n" - " most container formats (eg WAV, AIFF etc) only support a small subset\n" - " of codec formats (eg 16 bit PCM, a-law, Vorbis etc).\n" - ) ; - - puts ( - " The format of the output file is determined by the file extension of the\n" - " output file name. The following extensions are currently understood:\n" - ) ; - - sfe_dump_format_map () ; - - puts ("") ; - exit (0) ; -} /* usage_exit */ - -static void -report_format_error_exit (const char * argv0, SF_INFO * sfinfo) -{ int old_format = sfinfo->format ; - int endian = sfinfo->format & SF_FORMAT_ENDMASK ; - - sfinfo->format = old_format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (endian && sf_format_check (sfinfo)) - { printf ("Error : output file format does not support %s endian-ness.\n", sfe_endian_name (endian)) ; - exit (1) ; - } ; - - printf ("\n" - "Error : output file format is invalid.\n" - "The '%s' container does not support '%s' codec data.\n" - "Run '%s --help' for clues.\n\n", - sfe_container_name (sfinfo->format), sfe_codec_name (sfinfo->format), program_name (argv0)) ; - exit (1) ; -} /* report_format_error_exit */ - -int -main (int argc, char * argv []) -{ const char *progname, *infilename, *outfilename ; - SNDFILE *infile = NULL, *outfile = NULL ; - SF_INFO sfinfo ; - int k, outfilemajor, outfileminor = 0, infileminor ; - int override_sample_rate = 0 ; /* assume no sample rate override. */ - int endian = SF_ENDIAN_FILE, normalize = SF_FALSE ; - - progname = program_name (argv [0]) ; - - if (argc < 3 || argc > 5) - { usage_exit (progname) ; - return 1 ; - } ; - - infilename = argv [argc-2] ; - outfilename = argv [argc-1] ; - - if (strcmp (infilename, outfilename) == 0) - { printf ("Error : Input and output filenames are the same.\n\n") ; - usage_exit (progname) ; - return 1 ; - } ; - - if (strlen (infilename) > 1 && infilename [0] == '-') - { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ; - usage_exit (progname) ; - return 1 ; - } ; - - if (outfilename [0] == '-') - { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ; - usage_exit (progname) ; - return 1 ; - } ; - - for (k = 1 ; k < argc - 2 ; k++) - { if (! strcmp (argv [k], "-pcms8")) - { outfileminor = SF_FORMAT_PCM_S8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcmu8")) - { outfileminor = SF_FORMAT_PCM_U8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm16")) - { outfileminor = SF_FORMAT_PCM_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm24")) - { outfileminor = SF_FORMAT_PCM_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm32")) - { outfileminor = SF_FORMAT_PCM_32 ; - continue ; - } ; - if (! strcmp (argv [k], "-float32")) - { outfileminor = SF_FORMAT_FLOAT ; - continue ; - } ; - if (! strcmp (argv [k], "-ulaw")) - { outfileminor = SF_FORMAT_ULAW ; - continue ; - } ; - if (! strcmp (argv [k], "-alaw")) - { outfileminor = SF_FORMAT_ALAW ; - continue ; - } ; - if (! strcmp (argv [k], "-alac16")) - { outfileminor = SF_FORMAT_ALAC_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-alac20")) - { outfileminor = SF_FORMAT_ALAC_20 ; - continue ; - } ; - if (! strcmp (argv [k], "-alac24")) - { outfileminor = SF_FORMAT_ALAC_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-alac32")) - { outfileminor = SF_FORMAT_ALAC_32 ; - continue ; - } ; - if (! strcmp (argv [k], "-ima-adpcm")) - { outfileminor = SF_FORMAT_IMA_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-ms-adpcm")) - { outfileminor = SF_FORMAT_MS_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-gsm610")) - { outfileminor = SF_FORMAT_GSM610 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw12")) - { outfileminor = SF_FORMAT_DWVW_12 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw16")) - { outfileminor = SF_FORMAT_DWVW_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw24")) - { outfileminor = SF_FORMAT_DWVW_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-vorbis")) - { outfileminor = SF_FORMAT_VORBIS ; - continue ; - } ; - - if (strstr (argv [k], "-override-sample-rate=") == argv [k]) - { const char *ptr ; - - ptr = argv [k] + strlen ("-override-sample-rate=") ; - override_sample_rate = atoi (ptr) ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=little")) - { endian = SF_ENDIAN_LITTLE ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=big")) - { endian = SF_ENDIAN_BIG ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=cpu")) - { endian = SF_ENDIAN_CPU ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=file")) - { endian = SF_ENDIAN_FILE ; - continue ; - } ; - - if (! strcmp (argv [k], "-normalize")) - { normalize = SF_TRUE ; - continue ; - } ; - - printf ("Error : Not able to decode argunment '%s'.\n", argv [k]) ; - exit (1) ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s.\n", infilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Update sample rate if forced to something else. */ - if (override_sample_rate) - sfinfo.samplerate = override_sample_rate ; - - infileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if ((sfinfo.format = sfe_file_type_of_ext (outfilename, sfinfo.format)) == 0) - { printf ("Error : Not able to determine output file type for %s.\n", outfilename) ; - return 1 ; - } ; - - outfilemajor = sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_ENDMASK) ; - - if (outfileminor == 0) - outfileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (outfileminor != 0) - sfinfo.format = outfilemajor | outfileminor ; - else - sfinfo.format = outfilemajor | (sfinfo.format & SF_FORMAT_SUBMASK) ; - - sfinfo.format |= endian ; - - if ((sfinfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_XI) - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_16 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_16 ; - break ; - - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_8 ; - break ; - } ; - - if (sf_format_check (&sfinfo) == 0) - report_format_error_exit (argv [0], &sfinfo) ; - - /* Open the output file. */ - if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Copy the metadata */ - copy_metadata (outfile, infile, sfinfo.channels) ; - - if (normalize - || (outfileminor == SF_FORMAT_DOUBLE) || (outfileminor == SF_FORMAT_FLOAT) - || (infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT) - || (infileminor == SF_FORMAT_VORBIS) || (outfileminor == SF_FORMAT_VORBIS)) - sfe_copy_data_fp (outfile, infile, sfinfo.channels, normalize) ; - else - sfe_copy_data_int (outfile, infile, sfinfo.channels) ; - - sf_close (infile) ; - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels) -{ SF_INSTRUMENT inst ; - SF_BROADCAST_INFO_2K binfo ; - const char *str ; - int k, chanmap [256] ; - - for (k = SF_STR_FIRST ; k <= SF_STR_LAST ; k++) - { str = sf_get_string (infile, k) ; - if (str != NULL) - sf_set_string (outfile, k, str) ; - } ; - - memset (&inst, 0, sizeof (inst)) ; - memset (&binfo, 0, sizeof (binfo)) ; - - if (channels < ARRAY_LEN (chanmap)) - { size_t size = channels * sizeof (chanmap [0]) ; - - if (sf_command (infile, SFC_GET_CHANNEL_MAP_INFO, chanmap, size) == SF_TRUE) - sf_command (outfile, SFC_SET_CHANNEL_MAP_INFO, chanmap, size) ; - } ; - - if (sf_command (infile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE) - sf_command (outfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ; - - if (sf_command (infile, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == SF_TRUE) - sf_command (outfile, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) ; - -} /* copy_metadata */ - diff --git a/libs/libsndfile/programs/sndfile-deinterleave.c b/libs/libsndfile/programs/sndfile-deinterleave.c deleted file mode 100644 index df80b04222..0000000000 --- a/libs/libsndfile/programs/sndfile-deinterleave.c +++ /dev/null @@ -1,194 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include "common.h" - -#define BUFFER_LEN 4096 -#define MAX_CHANNELS 16 - - -typedef struct -{ SNDFILE * infile ; - SNDFILE * outfile [MAX_CHANNELS] ; - - union - { double d [MAX_CHANNELS * BUFFER_LEN] ; - int i [MAX_CHANNELS * BUFFER_LEN] ; - } din ; - - union - { double d [BUFFER_LEN] ; - int i [BUFFER_LEN] ; - } dout ; - - int channels ; -} STATE ; - -static void usage_exit (void) ; - -static void deinterleave_int (STATE * state) ; -static void deinterleave_double (STATE * state) ; - -int -main (int argc, char **argv) -{ STATE state ; - SF_INFO sfinfo ; - char pathname [512], ext [32], *cptr ; - int ch, double_split ; - - if (argc != 2) - { if (argc != 1) - puts ("\nError : need a single input file.\n") ; - usage_exit () ; - } ; - - memset (&state, 0, sizeof (state)) ; - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((state.infile = sf_open (argv [1], SFM_READ, &sfinfo)) == NULL) - { printf ("\nError : Not able to open input file '%s'\n%s\n", argv [1], sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (sfinfo.channels < 2) - { printf ("\nError : Input file '%s' only has one channel.\n", argv [1]) ; - exit (1) ; - } ; - - state.channels = sfinfo.channels ; - sfinfo.channels = 1 ; - - snprintf (pathname, sizeof (pathname), "%s", argv [1]) ; - if ((cptr = strrchr (pathname, '.')) == NULL) - ext [0] = 0 ; - else - { snprintf (ext, sizeof (ext), "%s", cptr) ; - cptr [0] = 0 ; - } ; - - printf ("Input file : %s\n", pathname) ; - puts ("Output files :") ; - - for (ch = 0 ; ch < state.channels ; ch++) - { char filename [520] ; - - snprintf (filename, sizeof (filename), "%s_%02d%s", pathname, ch, ext) ; - - if ((state.outfile [ch] = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file '%s'\n%s\n", filename, sf_strerror (NULL)) ; - exit (1) ; - } ; - - printf (" %s\n", filename) ; - } ; - - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - case SF_FORMAT_VORBIS : - double_split = 1 ; - break ; - - default : - double_split = 0 ; - break ; - } ; - - if (double_split) - deinterleave_double (&state) ; - else - deinterleave_int (&state) ; - - sf_close (state.infile) ; - for (ch = 0 ; ch < MAX_CHANNELS ; ch++) - if (state.outfile [ch] != NULL) - sf_close (state.outfile [ch]) ; - - return 0 ; -} /* main */ - -/*------------------------------------------------------------------------------ -*/ - -static void -usage_exit (void) -{ puts ("\nUsage : sndfile-deinterleave \n") ; - puts ( - "Split a mutli-channel file into a set of mono files.\n" - "\n" - "If the input file is named 'a.wav', the output files will be named\n" - "a_00.wav, a_01.wav and so on.\n" - ) ; - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (0) ; -} /* usage_exit */ - -static void -deinterleave_int (STATE * state) -{ int read_len ; - int ch, k ; - - do - { read_len = sf_readf_int (state->infile, state->din.i, BUFFER_LEN) ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { for (k = 0 ; k < read_len ; k++) - state->dout.i [k] = state->din.i [k * state->channels + ch] ; - sf_write_int (state->outfile [ch], state->dout.i, read_len) ; - } ; - } - while (read_len > 0) ; - -} /* deinterleave_int */ - -static void -deinterleave_double (STATE * state) -{ int read_len ; - int ch, k ; - - do - { read_len = sf_readf_double (state->infile, state->din.d, BUFFER_LEN) ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { for (k = 0 ; k < read_len ; k++) - state->dout.d [k] = state->din.d [k * state->channels + ch] ; - sf_write_double (state->outfile [ch], state->dout.d, read_len) ; - } ; - } - while (read_len > 0) ; - -} /* deinterleave_double */ diff --git a/libs/libsndfile/programs/sndfile-info.c b/libs/libsndfile/programs/sndfile-info.c deleted file mode 100644 index 06982fd2c2..0000000000 --- a/libs/libsndfile/programs/sndfile-info.c +++ /dev/null @@ -1,529 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - -#if (defined (WIN32) || defined (_WIN32)) -#include -#endif - -static void print_version (void) ; -static void usage_exit (const char *progname) ; - -static void info_dump (const char *filename) ; -static int instrument_dump (const char *filename) ; -static int broadcast_dump (const char *filename) ; -static int chanmap_dump (const char *filename) ; -static int cart_dump (const char *filename) ; -static void total_dump (void) ; - -static double total_seconds = 0.0 ; - -int -main (int argc, char *argv []) -{ int k ; - - print_version () ; - - if (argc < 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - { usage_exit (program_name (argv [0])) ; - return 1 ; - } ; - - if (strcmp (argv [1], "--instrument") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += instrument_dump (argv [k]) ; - return error ; - } ; - - if (strcmp (argv [1], "--broadcast") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += broadcast_dump (argv [k]) ; - return error ; - } ; - - if (strcmp (argv [1], "--channel-map") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += chanmap_dump (argv [k]) ; - return error ; - } ; - - if (strcmp (argv [1], "--cart") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += cart_dump (argv [k]) ; - return error ; - } ; - - for (k = 1 ; k < argc ; k++) - info_dump (argv [k]) ; - - if (argc > 2) - total_dump () ; - - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static double data [BUFFER_LEN] ; - -static void -print_version (void) -{ char buffer [256] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - printf ("\nVersion : %s\n\n", buffer) ; -} /* print_version */ - - -static void -usage_exit (const char *progname) -{ printf ("Usage :\n %s ...\n", progname) ; - printf (" Prints out information about one or more sound files.\n\n") ; - printf (" %s --instrument \n", progname) ; - printf (" Prints out the instrument data for the given file.\n\n") ; - printf (" %s --broadcast \n", progname) ; - printf (" Prints out the broadcast WAV info for the given file.\n\n") ; - printf (" %s --channel-map \n", progname) ; - printf (" Prints out the channel map for the given file.\n\n") ; - printf (" %s --cart \n", progname) ; - printf (" Prints out the cart chunk WAV info for the given file.\n\n") ; -#if (defined (_WIN32) || defined (WIN32)) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - fflush (stdout) ; - - /* This is the officially blessed by microsoft way but I can't get - ** it to link. - ** Sleep (15) ; - ** Instead, use this: - */ - Sleep (5 * 1000) ; -#endif - exit (0) ; -} /* usage_exit */ - -/*============================================================================== -** Dumping of sndfile info. -*/ - -static double data [BUFFER_LEN] ; - -static double -calc_decibels (SF_INFO * sfinfo, double max) -{ double decibels ; - - switch (sfinfo->format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - decibels = max / 0x80 ; - break ; - - case SF_FORMAT_PCM_16 : - decibels = max / 0x8000 ; - break ; - - case SF_FORMAT_PCM_24 : - decibels = max / 0x800000 ; - break ; - - case SF_FORMAT_PCM_32 : - decibels = max / 0x80000000 ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - decibels = max / 1.0 ; - break ; - - default : - decibels = max / 0x8000 ; - break ; - } ; - - return 20.0 * log10 (decibels) ; -} /* calc_decibels */ - -static const char * -format_duration_str (double seconds) -{ static char str [128] ; - int hrs, min ; - double sec ; - - memset (str, 0, sizeof (str)) ; - - hrs = (int) (seconds / 3600.0) ; - min = (int) ((seconds - (hrs * 3600.0)) / 60.0) ; - sec = seconds - (hrs * 3600.0) - (min * 60.0) ; - - snprintf (str, sizeof (str) - 1, "%02d:%02d:%06.3f", hrs, min, sec) ; - - return str ; -} /* format_duration_str */ - -static const char * -generate_duration_str (SF_INFO *sfinfo) -{ - double seconds ; - - if (sfinfo->samplerate < 1) - return NULL ; - - if (sfinfo->frames / sfinfo->samplerate > 0x7FFFFFFF) - return "unknown" ; - - seconds = (1.0 * sfinfo->frames) / sfinfo->samplerate ; - - /* Accumulate the total of all known file durations */ - total_seconds += seconds ; - - return format_duration_str (seconds) ; -} /* generate_duration_str */ - -static void -info_dump (const char *filename) -{ static char strbuffer [BUFFER_LEN] ; - SNDFILE *file ; - SF_INFO sfinfo ; - double signal_max, decibels ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - printf ("========================================\n") ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - printf ("----------------------------------------\n") ; - - printf ("Sample Rate : %d\n", sfinfo.samplerate) ; - - if (sfinfo.frames == SF_COUNT_MAX) - printf ("Frames : unknown\n") ; - else - printf ("Frames : %" PRId64 "\n", sfinfo.frames) ; - - printf ("Channels : %d\n", sfinfo.channels) ; - printf ("Format : 0x%08X\n", sfinfo.format) ; - printf ("Sections : %d\n", sfinfo.sections) ; - printf ("Seekable : %s\n", (sfinfo.seekable ? "TRUE" : "FALSE")) ; - printf ("Duration : %s\n", generate_duration_str (&sfinfo)) ; - - if (sfinfo.frames < 100 * 1024 * 1024) - { /* Do not use sf_signal_max because it doesn't work for non-seekable files . */ - sf_command (file, SFC_CALC_SIGNAL_MAX, &signal_max, sizeof (signal_max)) ; - decibels = calc_decibels (&sfinfo, signal_max) ; - printf ("Signal Max : %g (%4.2f dB)\n", signal_max, decibels) ; - } ; - putchar ('\n') ; - - sf_close (file) ; - -} /* info_dump */ - -/*============================================================================== -** Dumping of SF_INSTRUMENT data. -*/ - -static const char * -str_of_type (int mode) -{ switch (mode) - { case SF_LOOP_NONE : return "none" ; - case SF_LOOP_FORWARD : return "fwd " ; - case SF_LOOP_BACKWARD : return "back" ; - case SF_LOOP_ALTERNATING : return "alt " ; - default : break ; - } ; - - return "????" ; -} /* str_of_mode */ - -static int -instrument_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_INSTRUMENT inst ; - int got_inst, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - got_inst = sf_command (file, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ; - sf_close (file) ; - - if (got_inst == SF_FALSE) - { printf ("Error : File '%s' does not contain instrument data.\n\n", filename) ; - return 1 ; - } ; - - printf ("Instrument : %s\n\n", filename) ; - printf (" Gain : %d\n", inst.gain) ; - printf (" Base note : %d\n", inst.basenote) ; - printf (" Velocity : %d - %d\n", (int) inst.velocity_lo, (int) inst.velocity_hi) ; - printf (" Key : %d - %d\n", (int) inst.key_lo, (int) inst.key_hi) ; - printf (" Loop points : %d\n", inst.loop_count) ; - - for (k = 0 ; k < inst.loop_count ; k++) - printf (" %-2d Mode : %s Start : %6d End : %6d Count : %6d\n", k, str_of_type (inst.loops [k].mode), inst.loops [k].start, inst.loops [k].end, inst.loops [k].count) ; - - putchar ('\n') ; - return 0 ; -} /* instrument_dump */ - -static int -broadcast_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_BROADCAST_INFO_2K bext ; - double time_ref_sec ; - int got_bext ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - memset (&bext, 0, sizeof (SF_BROADCAST_INFO_2K)) ; - - got_bext = sf_command (file, SFC_GET_BROADCAST_INFO, &bext, sizeof (bext)) ; - sf_close (file) ; - - if (got_bext == SF_FALSE) - { printf ("Error : File '%s' does not contain broadcast information.\n\n", filename) ; - return 1 ; - } ; - - /* - ** From : http://www.ebu.ch/en/technical/publications/userguides/bwf_user_guide.php - ** - ** Time Reference: - ** This field is a count from midnight in samples to the first sample - ** of the audio sequence. - */ - - time_ref_sec = ((pow (2.0, 32) * bext.time_reference_high) + (1.0 * bext.time_reference_low)) / sfinfo.samplerate ; - - printf ("Description : %.*s\n", (int) sizeof (bext.description), bext.description) ; - printf ("Originator : %.*s\n", (int) sizeof (bext.originator), bext.originator) ; - printf ("Origination ref : %.*s\n", (int) sizeof (bext.originator_reference), bext.originator_reference) ; - printf ("Origination date : %.*s\n", (int) sizeof (bext.origination_date), bext.origination_date) ; - printf ("Origination time : %.*s\n", (int) sizeof (bext.origination_time), bext.origination_time) ; - - if (bext.time_reference_high == 0 && bext.time_reference_low == 0) - printf ("Time ref : 0\n") ; - else - printf ("Time ref : 0x%x%08x (%.6f seconds)\n", bext.time_reference_high, bext.time_reference_low, time_ref_sec) ; - - printf ("BWF version : %d\n", bext.version) ; - printf ("UMID : %.*s\n", (int) sizeof (bext.umid), bext.umid) ; - printf ("Coding history : %.*s\n", bext.coding_history_size, bext.coding_history) ; - - return 0 ; -} /* broadcast_dump */ - -static int -chanmap_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int * channel_map ; - int got_chanmap, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - if ((channel_map = calloc (sfinfo.channels, sizeof (int))) == NULL) - { printf ("Error : malloc failed.\n\n") ; - return 1 ; - } ; - - got_chanmap = sf_command (file, SFC_GET_CHANNEL_MAP_INFO, channel_map, sfinfo.channels * sizeof (int)) ; - sf_close (file) ; - - if (got_chanmap == SF_FALSE) - { printf ("Error : File '%s' does not contain channel map information.\n\n", filename) ; - free (channel_map) ; - return 1 ; - } ; - - printf ("File : %s\n\n", filename) ; - - puts (" Chan Position") ; - for (k = 0 ; k < sfinfo.channels ; k ++) - { const char * name ; - -#define CASE_NAME(x) case x : name = #x ; break ; - switch (channel_map [k]) - { CASE_NAME (SF_CHANNEL_MAP_INVALID) ; - CASE_NAME (SF_CHANNEL_MAP_MONO) ; - CASE_NAME (SF_CHANNEL_MAP_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_REAR_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_REAR_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_REAR_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_LFE) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_SIDE_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_SIDE_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_MAX) ; - default : name = "default" ; - break ; - } ; - - printf (" %3d %s\n", k, name) ; - } ; - - putchar ('\n') ; - free (channel_map) ; - - return 0 ; -} /* chanmap_dump */ - -static int -cart_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_CART_INFO_VAR (1024) cart ; - int got_cart, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - memset (&cart, 0, sizeof (cart)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - got_cart = sf_command (file, SFC_GET_CART_INFO, &cart, sizeof (cart)) ; - sf_close (file) ; - - if (got_cart == SF_FALSE) - { printf ("Error : File '%s' does not contain cart information.\n\n", filename) ; - return 1 ; - } ; - - printf ("Version : %.*s\n", (int) sizeof (cart.version), cart.version) ; - printf ("Title : %.*s\n", (int) sizeof (cart.title), cart.title) ; - printf ("Artist : %.*s\n", (int) sizeof (cart.artist), cart.artist) ; - printf ("Cut id : %.*s\n", (int) sizeof (cart.cut_id), cart.cut_id) ; - printf ("Category : %.*s\n", (int) sizeof (cart.category), cart.category) ; - printf ("Classification : %.*s\n", (int) sizeof (cart.classification), cart.classification) ; - printf ("Out cue : %.*s\n", (int) sizeof (cart.out_cue), cart.out_cue) ; - printf ("Start date : %.*s\n", (int) sizeof (cart.start_date), cart.start_date) ; - printf ("Start time : %.*s\n", (int) sizeof (cart.start_time), cart.start_time) ; - printf ("End date : %.*s\n", (int) sizeof (cart.end_date), cart.end_date) ; - printf ("End time : %.*s\n", (int) sizeof (cart.end_time), cart.end_time) ; - printf ("App id : %.*s\n", (int) sizeof (cart.producer_app_id), cart.producer_app_id) ; - printf ("App version : %.*s\n", (int) sizeof (cart.producer_app_version), cart.producer_app_version) ; - printf ("User defined : %.*s\n", (int) sizeof (cart.user_def), cart.user_def) ; - printf ("Level ref. : %d\n", cart.level_reference) ; - printf ("Post timers :\n") ; - - for (k = 0 ; k < ARRAY_LEN (cart.post_timers) ; k++) - if (cart.post_timers [k].usage [0]) - printf (" %d %.*s %d\n", k, (int) sizeof (cart.post_timers [k].usage), cart.post_timers [k].usage, cart.post_timers [k].value) ; - - printf ("Reserved : %.*s\n", (int) sizeof (cart.reserved), cart.reserved) ; - printf ("Url : %.*s\n", (int) sizeof (cart.url), cart.url) ; - printf ("Tag text : %.*s\n", cart.tag_text_size, cart.tag_text) ; - - return 0 ; -} /* cart_dump */ - -static void -total_dump (void) -{ printf ("========================================\n") ; - printf ("Total Duration : %s\n", format_duration_str (total_seconds)) ; -} /* total_dump */ diff --git a/libs/libsndfile/programs/sndfile-interleave.c b/libs/libsndfile/programs/sndfile-interleave.c deleted file mode 100644 index 24d6b9d874..0000000000 --- a/libs/libsndfile/programs/sndfile-interleave.c +++ /dev/null @@ -1,202 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include "common.h" - -#define BUFFER_LEN 4096 -#define MAX_INPUTS 16 - - -typedef struct -{ SNDFILE * infile [MAX_INPUTS] ; - SNDFILE * outfile ; - - union - { double d [BUFFER_LEN] ; - int i [BUFFER_LEN] ; - } din ; - - union - - { double d [MAX_INPUTS * BUFFER_LEN] ; - int i [MAX_INPUTS * BUFFER_LEN] ; - } dout ; - - int channels ; -} STATE ; - - -static void usage_exit (void) ; -static void interleave_int (STATE * state) ; -static void interleave_double (STATE * state) ; - - -int -main (int argc, char **argv) -{ STATE state ; - SF_INFO sfinfo ; - int k, double_merge = 0 ; - - if (argc < 5) - { if (argc > 1) - puts ("\nError : need at least 2 input files.") ; - usage_exit () ; - } ; - - if (strcmp (argv [argc - 2], "-o") != 0) - { puts ("\nError : second last command line parameter should be '-o'.\n") ; - usage_exit () ; - } ; - - if (argc - 3 > MAX_INPUTS) - { printf ("\nError : Cannot handle more than %d input channels.\n\n", MAX_INPUTS) ; - exit (1) ; - } ; - - memset (&state, 0, sizeof (state)) ; - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - for (k = 1 ; k < argc - 2 ; k++) - { - if ((state.infile [k - 1] = sf_open (argv [k], SFM_READ, &sfinfo)) == NULL) - { printf ("\nError : Not able to open input file '%s'\n%s\n", argv [k], sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\bError : Input file '%s' should be mono (has %d channels).\n", argv [k], sfinfo.channels) ; - exit (1) ; - } ; - - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - case SF_FORMAT_VORBIS : - double_merge = 1 ; - break ; - - default : - break ; - } ; - - state.channels ++ ; - } ; - - sfinfo.channels = state.channels ; - sfinfo.format = sfe_file_type_of_ext (argv [argc - 1], sfinfo.format) ; - - if ((state.outfile = sf_open (argv [argc - 1], SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file '%s'\n%s\n", argv [argc - 1], sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (double_merge) - interleave_double (&state) ; - else - interleave_int (&state) ; - - for (k = 0 ; k < MAX_INPUTS ; k++) - if (state.infile [k] != NULL) - sf_close (state.infile [k]) ; - sf_close (state.outfile) ; - - return 0 ; -} /* main */ - -/*------------------------------------------------------------------------------ -*/ - - -static void -usage_exit (void) -{ puts ("\nUsage : sndfile-interleave ... -o \n") ; - puts ("Merge two or more mono files into a single multi-channel file.\n") ; - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (0) ; -} /* usage_exit */ - - -static void -interleave_int (STATE * state) -{ int max_read_len, read_len ; - int ch, k ; - - do - { max_read_len = 0 ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { read_len = sf_read_int (state->infile [ch], state->din.i, BUFFER_LEN) ; - if (read_len < BUFFER_LEN) - memset (state->din.i + read_len, 0, sizeof (state->din.i [0]) * (BUFFER_LEN - read_len)) ; - - for (k = 0 ; k < read_len ; k++) - state->dout.i [k * state->channels + ch] = state->din.i [k] ; - - max_read_len = MAX (max_read_len, read_len) ; - } ; - - sf_writef_int (state->outfile, state->dout.i, max_read_len) ; - } - while (max_read_len > 0) ; - -} /* interleave_int */ - - -static void -interleave_double (STATE * state) -{ int max_read_len, read_len ; - int ch, k ; - - do - { max_read_len = 0 ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { read_len = sf_read_double (state->infile [ch], state->din.d, BUFFER_LEN) ; - if (read_len < BUFFER_LEN) - memset (state->din.d + read_len, 0, sizeof (state->din.d [0]) * (BUFFER_LEN - read_len)) ; - - for (k = 0 ; k < read_len ; k++) - state->dout.d [k * state->channels + ch] = state->din.d [k] ; - - max_read_len = MAX (max_read_len, read_len) ; - } ; - - sf_writef_double (state->outfile, state->dout.d, max_read_len) ; - } - while (max_read_len > 0) ; - -} /* interleave_double */ diff --git a/libs/libsndfile/programs/sndfile-jackplay.c b/libs/libsndfile/programs/sndfile-jackplay.c deleted file mode 100644 index 87b722de2f..0000000000 --- a/libs/libsndfile/programs/sndfile-jackplay.c +++ /dev/null @@ -1,277 +0,0 @@ -/* -** Copyright (c) 2007-2009 Erik de Castro Lopo -** Copyright (C) 2007 Jonatan Liljedahl -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation ; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY ; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_JACK - -#include -#include - -#include -#include - -#include - -#define RB_SIZE (1 << 16) - -typedef struct _thread_info -{ pthread_t thread_id ; - SNDFILE *sndfile ; - jack_nframes_t pos ; - jack_client_t *client ; - unsigned int channels ; - volatile int can_process ; - volatile int read_done ; - volatile int play_done ; -} thread_info_t ; - -pthread_mutex_t disk_thread_lock = PTHREAD_MUTEX_INITIALIZER ; -pthread_cond_t data_ready = PTHREAD_COND_INITIALIZER ; - -static jack_ringbuffer_t *ringbuf ; -static jack_port_t **output_port ; -static jack_default_audio_sample_t ** outs ; -const size_t sample_size = sizeof (jack_default_audio_sample_t) ; - -static int -process (jack_nframes_t nframes, void * arg) -{ - thread_info_t *info = (thread_info_t *) arg ; - jack_default_audio_sample_t buf [info->channels] ; - unsigned i, n ; - - if (! info->can_process) - return 0 ; - - for (n = 0 ; n < info->channels ; n++) - outs [n] = jack_port_get_buffer (output_port [n], nframes) ; - - for (i = 0 ; i < nframes ; i++) - { size_t read_cnt ; - - /* Read one frame of audio. */ - read_cnt = jack_ringbuffer_read (ringbuf, (void*) buf, sample_size*info->channels) ; - if (read_cnt == 0 && info->read_done) - { /* File is done, so stop the main loop. */ - info->play_done = 1 ; - return 0 ; - } ; - - /* Update play-position counter. */ - info->pos += read_cnt / (sample_size*info->channels) ; - - /* Output each channel of the frame. */ - for (n = 0 ; n < info->channels ; n++) - outs [n][i] = buf [n] ; - } ; - - /* Wake up the disk thread to read more data. */ - if (pthread_mutex_trylock (&disk_thread_lock) == 0) - { pthread_cond_signal (&data_ready) ; - pthread_mutex_unlock (&disk_thread_lock) ; - } ; - - return 0 ; -} /* process */ - -static void * -disk_thread (void *arg) -{ thread_info_t *info = (thread_info_t *) arg ; - sf_count_t buf_avail, read_frames ; - jack_ringbuffer_data_t vec [2] ; - size_t bytes_per_frame = sample_size*info->channels ; - - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL) ; - pthread_mutex_lock (&disk_thread_lock) ; - - while (1) - { jack_ringbuffer_get_write_vector (ringbuf, vec) ; - - read_frames = 0 ; - - if (vec [0].len) - { /* Fill the first part of the ringbuffer. */ - buf_avail = vec [0].len / bytes_per_frame ; - read_frames = sf_readf_float (info->sndfile, (float *) vec [0].buf, buf_avail) ; - if (vec [1].len) - { /* Fill the second part of the ringbuffer? */ - buf_avail = vec [1].len / bytes_per_frame ; - read_frames += sf_readf_float (info->sndfile, (float *) vec [1].buf, buf_avail) ; - } ; - } ; - - if (read_frames == 0) - break ; /* end of file? */ - - jack_ringbuffer_write_advance (ringbuf, read_frames * bytes_per_frame) ; - - /* Tell process that we've filled the ringbuffer. */ - info->can_process = 1 ; - - /* Wait for the process thread to wake us up. */ - pthread_cond_wait (&data_ready, &disk_thread_lock) ; - } ; - - /* Tell that we're done reading the file. */ - info->read_done = 1 ; - pthread_mutex_unlock (&disk_thread_lock) ; - - return 0 ; -} /* disk_thread */ - -static void -jack_shutdown (void *arg) -{ (void) arg ; - exit (1) ; -} /* jack_shutdown */ - -static void -print_time (jack_nframes_t pos, int jack_sr) -{ float sec = pos / (1.0 * jack_sr) ; - int min = sec / 60.0 ; - fprintf (stderr, "%02d:%05.2f", min, fmod (sec, 60.0)) ; -} /* print_time */ - -int -main (int narg, char * args []) -{ - SNDFILE *sndfile ; - SF_INFO sndfileinfo ; - jack_client_t *client ; - thread_info_t info ; - int i, jack_sr ; - - if (narg < 2) - { fprintf (stderr, "no soundfile given\n") ; - return 1 ; - } ; - - // create jack client - if ((client = jack_client_new ("jackplay")) == 0) - { - fprintf (stderr, "Jack server not running?\n") ; - return 1 ; - } ; - - jack_sr = jack_get_sample_rate (client) ; - - /* Open the soundfile. */ - sndfileinfo.format = 0 ; - sndfile = sf_open (args [1], SFM_READ, &sndfileinfo) ; - if (sndfile == NULL) - { fprintf (stderr, "Could not open soundfile '%s'\n", args [1]) ; - return 1 ; - } ; - - fprintf (stderr, "Channels : %d\nSample rate : %d Hz\nDuration : ", sndfileinfo.channels, sndfileinfo.samplerate) ; - - print_time (sndfileinfo.frames, sndfileinfo.samplerate) ; - fprintf (stderr, "\n") ; - - if (sndfileinfo.samplerate != jack_sr) - fprintf (stderr, "Warning: samplerate of soundfile (%d Hz) does not match jack server (%d Hz).\n", sndfileinfo.samplerate, jack_sr) ; - - /* Init the thread info struct. */ - memset (&info, 0, sizeof (info)) ; - info.can_process = 0 ; - info.read_done = 0 ; - info.play_done = 0 ; - info.sndfile = sndfile ; - info.channels = sndfileinfo.channels ; - info.client = client ; - info.pos = 0 ; - - /* Set up callbacks. */ - jack_set_process_callback (client, process, &info) ; - jack_on_shutdown (client, jack_shutdown, 0) ; - - /* Allocate output ports. */ - output_port = calloc (sndfileinfo.channels, sizeof (jack_port_t *)) ; - outs = calloc (sndfileinfo.channels, sizeof (jack_default_audio_sample_t *)) ; - for (i = 0 ; i < sndfileinfo.channels ; i++) - { char name [16] ; - - snprintf (name, sizeof (name), "out_%d", i + 1) ; - output_port [i] = jack_port_register (client, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0) ; - } ; - - /* Allocate and clear ringbuffer. */ - ringbuf = jack_ringbuffer_create (sizeof (jack_default_audio_sample_t) * RB_SIZE) ; - memset (ringbuf->buf, 0, ringbuf->size) ; - - /* Activate client. */ - if (jack_activate (client)) - { fprintf (stderr, "Cannot activate client.\n") ; - return 1 ; - } ; - - /* Auto connect all channels. */ - for (i = 0 ; i < sndfileinfo.channels ; i++) - { char name [64] ; - - snprintf (name, sizeof (name), "alsa_pcm:playback_%d", i + 1) ; - - if (jack_connect (client, jack_port_name (output_port [i]), name)) - fprintf (stderr, "Cannot connect output port %d (%s).\n", i, name) ; - } ; - - /* Start the disk thread. */ - pthread_create (&info.thread_id, NULL, disk_thread, &info) ; - - /* Sit in a loop, displaying the current play position. */ - while (! info.play_done) - { fprintf (stderr, "\r-> ") ; - print_time (info.pos, jack_sr) ; - fflush (stdout) ; - usleep (50000) ; - } ; - - /* Clean up. */ - jack_client_close (client) ; - jack_ringbuffer_free (ringbuf) ; - sf_close (sndfile) ; - free (outs) ; - free (output_port) ; - - puts ("") ; - - return 0 ; -} /* main */ - -#else - -int -main (void) -{ - puts ( - "Sorry this program was compiled without libjack (which probably\n" - "only exists on Linux and Mac OSX) and hence doesn't work." - ) ; - - return 0 ; -} /* main */ - -#endif diff --git a/libs/libsndfile/programs/sndfile-metadata-get.c b/libs/libsndfile/programs/sndfile-metadata-get.c deleted file mode 100644 index b4aa9b60f0..0000000000 --- a/libs/libsndfile/programs/sndfile-metadata-get.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2008-2010 George Blood Audio -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - -static void usage_exit (const char *progname, int exit_code) ; -static void process_args (SNDFILE * file, const SF_BROADCAST_INFO_2K * binfo, int argc, char * argv []) ; - -int -main (int argc, char *argv []) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_BROADCAST_INFO_2K binfo ; - const char *progname ; - const char * filename = NULL ; - int start ; - - /* Store the program name. */ - progname = program_name (argv [0]) ; - - /* Check if we've been asked for help. */ - if (argc <= 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - usage_exit (progname, 0) ; - - if (argv [argc - 1][0] != '-') - { filename = argv [argc - 1] ; - start = 1 ; - } - else if (argv [1][0] != '-') - { filename = argv [1] ; - start = 2 ; - } - else - { printf ("Error : Either the first or the last command line parameter should be a filename.\n\n") ; - exit (1) ; - } ; - - /* Get the time in case we need it later. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Open of file '%s' failed : %s\n\n", filename, sf_strerror (file)) ; - exit (1) ; - } ; - - memset (&binfo, 0, sizeof (binfo)) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == 0) - memset (&binfo, 0, sizeof (binfo)) ; - - process_args (file, &binfo, argc - 2, argv + start) ; - - sf_close (file) ; - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static void -usage_exit (const char *progname, int exit_code) -{ printf ("\nUsage :\n %s [options] \n\nOptions:\n", progname) ; - - puts ( - " --bext-description Print the 'bext' description.\n" - " --bext-originator Print the 'bext; originator info.\n" - " --bext-orig-ref Print the 'bext' origination reference.\n" - " --bext-umid Print the 'bext' UMID.\n" - " --bext-orig-date Print the 'bext' origination date.\n" - " --bext-orig-time Print the 'bext' origination time.\n" - " --bext-coding-hist Print the 'bext' coding history.\n" - ) ; - - puts ( - " --str-title Print the title metadata.\n" - " --str-copyright Print the copyright metadata.\n" - " --str-artist Print the artist metadata.\n" - " --str-comment Print the comment metadata.\n" - " --str-date Print the creation date metadata.\n" - " --str-album Print the album metadata.\n" - " --str-license Print the license metadata.\n" - ) ; - - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (exit_code) ; -} /* usage_exit */ - -static void -process_args (SNDFILE * file, const SF_BROADCAST_INFO_2K * binfo, int argc, char * argv []) -{ const char * str ; - int k, do_all = 0 ; - -#define HANDLE_BEXT_ARG(cmd, name, field) \ - if (do_all || strcmp (argv [k], cmd) == 0) \ - { printf ("%-20s : %.*s\n", name, (int) sizeof (binfo->field), binfo->field) ; \ - if (! do_all) \ - continue ; \ - } ; - -#define HANDLE_STR_ARG(cmd, name, id) \ - if (do_all || strcmp (argv [k], cmd) == 0) \ - { str = sf_get_string (file, id) ; \ - printf ("%-20s : %s\n", name, str ? str : "") ; \ - if (! do_all) continue ; \ - } ; - - for (k = 0 ; k < argc ; k++) - { if (do_all || strcmp (argv [k], "--all") == 0) - do_all = 1 ; - - HANDLE_BEXT_ARG ("--bext-description", "Description", description) ; - HANDLE_BEXT_ARG ("--bext-originator", "Originator", originator) ; - HANDLE_BEXT_ARG ("--bext-orig-ref", "Origination ref", originator_reference) ; - HANDLE_BEXT_ARG ("--bext-umid", "UMID", umid) ; - HANDLE_BEXT_ARG ("--bext-orig-date", "Origination date", origination_date) ; - HANDLE_BEXT_ARG ("--bext-orig-time", "Origination time", origination_time) ; - HANDLE_BEXT_ARG ("--bext-coding-hist", "Coding history", coding_history) ; - - HANDLE_STR_ARG ("--str-title", "Name", SF_STR_TITLE) ; - HANDLE_STR_ARG ("--str-copyright", "Copyright", SF_STR_COPYRIGHT) ; - HANDLE_STR_ARG ("--str-artist", "Artist", SF_STR_ARTIST) ; - HANDLE_STR_ARG ("--str-comment", "Comment", SF_STR_COMMENT) ; - HANDLE_STR_ARG ("--str-date", "Create date", SF_STR_DATE) ; - HANDLE_STR_ARG ("--str-album", "Album", SF_STR_ALBUM) ; - HANDLE_STR_ARG ("--str-license", "License", SF_STR_LICENSE) ; - - if (! do_all) - { printf ("Error : Don't know what to do with command line arg '%s'.\n\n", argv [k]) ; - exit (1) ; - } ; - break ; - } ; - - return ; -} /* process_args */ diff --git a/libs/libsndfile/programs/sndfile-metadata-set.c b/libs/libsndfile/programs/sndfile-metadata-set.c deleted file mode 100644 index b1d021a888..0000000000 --- a/libs/libsndfile/programs/sndfile-metadata-set.c +++ /dev/null @@ -1,284 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2008-2010 George Blood Audio -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - - -static void usage_exit (const char *progname, int exit_code) ; -static void missing_param (const char * option) ; -static void read_localtime (struct tm * timedata) ; -static int has_bext_fields_set (const METADATA_INFO * info) ; - -int -main (int argc, char *argv []) -{ METADATA_INFO info ; - struct tm timedata ; - const char *progname ; - const char * filenames [2] = { NULL, NULL } ; - int k ; - - /* Store the program name. */ - progname = program_name (argv [0]) ; - - /* Check if we've been asked for help. */ - if (argc < 3 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - usage_exit (progname, 0) ; - - /* Clear set all fields of the struct to zero bytes. */ - memset (&info, 0, sizeof (info)) ; - - /* Get the time in case we need it later. */ - read_localtime (&timedata) ; - - for (k = 1 ; k < argc ; k++) - { char tmp [20] ; - - if (argv [k][0] != '-') - { if (filenames [0] == NULL) - filenames [0] = argv [k] ; - else if (filenames [1] == NULL) - filenames [1] = argv [k] ; - else - { printf ("Error : Already have two file names on the command line and then found '%s'.\n\n", argv [k]) ; - usage_exit (progname, 1) ; - } ; - continue ; - } ; - -#define HANDLE_BEXT_ARG(cmd, field) \ - if (strcmp (argv [k], cmd) == 0) \ - { k ++ ; \ - if (k == argc) missing_param (argv [k - 1]) ; \ - info.field = argv [k] ; \ - continue ; \ - } ; - - HANDLE_BEXT_ARG ("--bext-description", description) ; - HANDLE_BEXT_ARG ("--bext-originator", originator) ; - HANDLE_BEXT_ARG ("--bext-orig-ref", originator_reference) ; - HANDLE_BEXT_ARG ("--bext-umid", umid) ; - HANDLE_BEXT_ARG ("--bext-orig-date", origination_date) ; - HANDLE_BEXT_ARG ("--bext-orig-time", origination_time) ; - HANDLE_BEXT_ARG ("--bext-coding-hist", coding_history) ; - HANDLE_BEXT_ARG ("--bext-time-ref", time_ref) ; - -#define HANDLE_STR_ARG(cmd, field) \ - if (strcmp (argv [k], cmd) == 0) \ - { k ++ ; \ - if (k == argc) missing_param (argv [k - 1]) ; \ - info.field = argv [k] ; \ - continue ; \ - } ; - - HANDLE_STR_ARG ("--str-comment", comment) ; - HANDLE_STR_ARG ("--str-title", title) ; - HANDLE_STR_ARG ("--str-copyright", copyright) ; - HANDLE_STR_ARG ("--str-artist", artist) ; - HANDLE_STR_ARG ("--str-date", date) ; - HANDLE_STR_ARG ("--str-album", album) ; - HANDLE_STR_ARG ("--str-license", license) ; - - /* Following options do not take an argument. */ - if (strcmp (argv [k], "--bext-auto-time-date") == 0) - { snprintf (tmp, sizeof (tmp), "%02d:%02d:%02d", timedata.tm_hour, timedata.tm_min, timedata.tm_sec) ; - info.origination_time = strdup (tmp) ; - - snprintf (tmp, sizeof (tmp), "%04d-%02d-%02d", timedata.tm_year + 1900, timedata.tm_mon + 1, timedata.tm_mday) ; - info.origination_date = strdup (tmp) ; - continue ; - } ; - - if (strcmp (argv [k], "--bext-auto-time") == 0) - { snprintf (tmp, sizeof (tmp), "%02d:%02d:%02d", timedata.tm_hour, timedata.tm_min, timedata.tm_sec) ; - info.origination_time = strdup (tmp) ; - continue ; - } ; - - if (strcmp (argv [k], "--bext-auto-date") == 0) - { snprintf (tmp, sizeof (tmp), "%04d-%02d-%02d", timedata.tm_year + 1900, timedata.tm_mon + 1, timedata.tm_mday) ; - info.origination_date = strdup (tmp) ; - continue ; - } ; - - if (strcmp (argv [k], "--str-auto-date") == 0) - { snprintf (tmp, sizeof (tmp), "%04d-%02d-%02d", timedata.tm_year + 1900, timedata.tm_mon + 1, timedata.tm_mday) ; - - info.date = strdup (tmp) ; - continue ; - } ; - - printf ("Error : Don't know what to do with command line arg '%s'.\n\n", argv [k]) ; - usage_exit (progname, 1) ; - } ; - - /* Find out if any of the 'bext' fields are set. */ - info.has_bext_fields = has_bext_fields_set (&info) ; - - if (filenames [0] == NULL) - { printf ("Error : No input file specificed.\n\n") ; - exit (1) ; - } ; - - if (filenames [1] != NULL && strcmp (filenames [0], filenames [1]) == 0) - { printf ("Error : Input and output files are the same.\n\n") ; - exit (1) ; - } ; - - if (info.coding_history != NULL && filenames [1] == NULL) - { printf ("\n" - "Error : Trying to update coding history of an existing file which unfortunately\n" - " is not supported. Instead, create a new file using :\n" - "\n" - " %s --bext-coding-hist \"Coding history\" old_file.wav new_file.wav\n" - "\n", - progname) ; - exit (1) ; - } ; - - sfe_apply_metadata_changes (filenames, &info) ; - - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static void -usage_exit (const char *progname, int exit_code) -{ printf ("\nUsage :\n\n" - " %s [options] \n" - " %s [options] \n" - "\n", - progname, progname) ; - - puts ( - "Where an option is made up of a pair of a field to set (one of\n" - "the 'bext' or metadata fields below) and a string. Fields are\n" - "as follows :\n" - ) ; - - puts ( - " --bext-description Set the 'bext' description.\n" - " --bext-originator Set the 'bext' originator.\n" - " --bext-orig-ref Set the 'bext' originator reference.\n" - " --bext-umid Set the 'bext' UMID.\n" - " --bext-orig-date Set the 'bext' origination date.\n" - " --bext-orig-time Set the 'bext' origination time.\n" - " --bext-coding-hist Set the 'bext' coding history.\n" - " --bext-time-raf Set the 'bext' Time ref.\n" - "\n" - " --str-comment Set the metadata comment.\n" - " --str-title Set the metadata title.\n" - " --str-copyright Set the metadata copyright.\n" - " --str-artist Set the metadata artist.\n" - " --str-date Set the metadata date.\n" - " --str-album Set the metadata album.\n" - " --str-license Set the metadata license.\n" - ) ; - - puts ( - "There are also the following arguments which do not take a\n" - "parameter :\n\n" - " --bext-auto-time-date Set the 'bext' time and date to current time/date.\n" - " --bext-auto-time Set the 'bext' time to current time.\n" - " --bext-auto-date Set the 'bext' date to current date.\n" - " --str-auto-date Set the metadata date to current date.\n" - ) ; - - puts ( - "Most of the above operations can be done in-place on an existing\n" - "file. If any operation cannot be performed, the application will\n" - "exit with an appropriate error message.\n" - ) ; - - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (exit_code) ; -} /* usage_exit */ - -static void -missing_param (const char * option) -{ - printf ("Error : Option '%s' needs a parameter but doesn't seem to have one.\n\n", option) ; - exit (1) ; -} /* missing_param */ - -/*============================================================================== -*/ - -static int -has_bext_fields_set (const METADATA_INFO * info) -{ - if (info->description || info->originator || info->originator_reference) - return 1 ; - - if (info->origination_date || info->origination_time || info->umid || info->coding_history || info->time_ref) - return 1 ; - - return 0 ; -} /* has_bext_fields_set */ - -static void -read_localtime (struct tm * timedata) -{ time_t current ; - - time (¤t) ; - memset (timedata, 0, sizeof (struct tm)) ; - -#if defined (HAVE_LOCALTIME_R) - /* If the re-entrant version is available, use it. */ - localtime_r (¤t, timedata) ; -#elif defined (HAVE_LOCALTIME) - { - struct tm *tmptr ; - /* Otherwise use the standard one and copy the data to local storage. */ - if ((tmptr = localtime (¤t)) != NULL) - memcpy (timedata, tmptr, sizeof (struct tm)) ; - } -#endif - - return ; -} /* read_localtime */ - diff --git a/libs/libsndfile/programs/sndfile-play-beos.cpp b/libs/libsndfile/programs/sndfile-play-beos.cpp deleted file mode 100644 index fb3fde4cdc..0000000000 --- a/libs/libsndfile/programs/sndfile-play-beos.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -** Copyright (C) 2001 Marcus Overhagen -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - -/*------------------------------------------------------------------------------ -** BeOS functions for playing a sound. -*/ - -#if defined (__BEOS__) - -struct shared_data -{ - BSoundPlayer *player; - SNDFILE *sndfile; - SF_INFO sfinfo; - sem_id finished; -}; - -static void -buffer_callback(void *theCookie, void *buf, size_t size, const media_raw_audio_format &format) -{ - shared_data *data = (shared_data *)theCookie; - short *buffer = (short *)buf; - int count = size / sizeof(short); - int m, readcount; - - if (!data->player->HasData()) - return; - - readcount = sf_read_short(data->sndfile, buffer, count); - if (readcount == 0) - { data->player->SetHasData(false); - release_sem(data->finished); - } - if (readcount < count) - { for (m = readcount ; m < count ; m++) - buffer [m] = 0 ; - } - if (data->sfinfo.pcmbitwidth < 16) - { for (m = 0 ; m < count ; m++) - buffer [m] *= 256 ; - } -} - -static void -beos_play (int argc, char *argv []) -{ - shared_data data; - status_t status; - int k; - - /* BSoundPlayer requires a BApplication object */ - BApplication app("application/x-vnd.MarcusOverhagen-sfplay"); - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (data.sndfile = sf_open_read (argv [k], &data.sfinfo))) - { sf_perror (NULL) ; - continue ; - } ; - - if (data.sfinfo.channels < 1 || data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", data.sfinfo.channels) ; - sf_close (data.sndfile) ; - continue ; - } ; - - data.finished = create_sem(0,"finished"); - - media_raw_audio_format format = - { data.sfinfo.samplerate, - data.sfinfo.channels, - media_raw_audio_format::B_AUDIO_SHORT, - B_HOST_IS_LENDIAN ? B_MEDIA_LITTLE_ENDIAN : B_MEDIA_BIG_ENDIAN, - BUFFER_LEN * sizeof(short) - }; - - BSoundPlayer player(&format,"player",buffer_callback,NULL,&data); - data.player = &player; - - if ((status = player.InitCheck()) != B_OK) - { - printf ("Error : BSoundPlayer init failed, %s.\n", strerror(status)) ; - delete_sem(data.finished); - sf_close (data.sndfile) ; - continue ; - } - - player.SetVolume(1.0); - player.Start(); - player.SetHasData(true); - acquire_sem(data.finished); - player.Stop(); - delete_sem(data.finished); - - sf_close (data.sndfile) ; - - } ; - -} /* beos_play */ - -#endif - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { printf ("Usage : %s \n\n", argv [0]) ; - return 1 ; - } ; - - beos_play (argc, argv) ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/programs/sndfile-play.c b/libs/libsndfile/programs/sndfile-play.c deleted file mode 100644 index f779f11a86..0000000000 --- a/libs/libsndfile/programs/sndfile-play.c +++ /dev/null @@ -1,1211 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "common.h" - -#if HAVE_ALSA_ASOUNDLIB_H - #define ALSA_PCM_NEW_HW_PARAMS_API - #define ALSA_PCM_NEW_SW_PARAMS_API - #include - #include -#endif - -#if defined (__ANDROID__) - -#elif defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__) - #include - #include - #include - -#elif (defined (__MACH__) && defined (__APPLE__)) - #include - #include - - #if (OSX_DARWIN_VERSION > 11) - /* Includes go here. */ - #elif (OSX_DARWIN_VERSION == 11) - #include - #elif (OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10) - #include - #include - #endif - -#elif defined (HAVE_SNDIO_H) - #include - -#elif (defined (sun) && defined (unix)) - #include - #include - #include - -#elif (OS_IS_WIN32 == 1) - #include - #include - -#endif - -#define SIGNED_SIZEOF(x) ((int) sizeof (x)) -#define BUFFER_LEN (2048) - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if HAVE_ALSA_ASOUNDLIB_H - -static snd_pcm_t * alsa_open (int channels, unsigned srate, int realtime) ; -static int alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) ; - -static void -alsa_play (int argc, char *argv []) -{ static float buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - snd_pcm_t * alsa_dev ; - int k, readcount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - if ((alsa_dev = alsa_open (sfinfo.channels, (unsigned) sfinfo.samplerate, SF_FALSE)) == NULL) - continue ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] *= scale ; - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - } - else - { while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - - snd_pcm_drain (alsa_dev) ; - snd_pcm_close (alsa_dev) ; - - sf_close (sndfile) ; - } ; - - return ; -} /* alsa_play */ - -static snd_pcm_t * -alsa_open (int channels, unsigned samplerate, int realtime) -{ const char * device = "default" ; - snd_pcm_t *alsa_dev = NULL ; - snd_pcm_hw_params_t *hw_params ; - snd_pcm_uframes_t buffer_size ; - snd_pcm_uframes_t alsa_period_size, alsa_buffer_frames ; - snd_pcm_sw_params_t *sw_params ; - - int err ; - - if (realtime) - { alsa_period_size = 256 ; - alsa_buffer_frames = 3 * alsa_period_size ; - } - else - { alsa_period_size = 1024 ; - alsa_buffer_frames = 4 * alsa_period_size ; - } ; - - if ((err = snd_pcm_open (&alsa_dev, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) - { fprintf (stderr, "cannot open audio device \"%s\" (%s)\n", device, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_nonblock (alsa_dev, 0) ; - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) - { fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_any (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_access (alsa_dev, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) - { fprintf (stderr, "cannot set access type (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_format (alsa_dev, hw_params, SND_PCM_FORMAT_FLOAT)) < 0) - { fprintf (stderr, "cannot set sample format (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_rate_near (alsa_dev, hw_params, &samplerate, 0)) < 0) - { fprintf (stderr, "cannot set sample rate (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_channels (alsa_dev, hw_params, channels)) < 0) - { fprintf (stderr, "cannot set channel count (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_buffer_size_near (alsa_dev, hw_params, &alsa_buffer_frames)) < 0) - { fprintf (stderr, "cannot set buffer size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_period_size_near (alsa_dev, hw_params, &alsa_period_size, 0)) < 0) - { fprintf (stderr, "cannot set period size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot set parameters (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - /* extra check: if we have only one period, this code won't work */ - snd_pcm_hw_params_get_period_size (hw_params, &alsa_period_size, 0) ; - snd_pcm_hw_params_get_buffer_size (hw_params, &buffer_size) ; - if (alsa_period_size == buffer_size) - { fprintf (stderr, "Can't use period equal to buffer size (%lu == %lu)", alsa_period_size, buffer_size) ; - goto catch_error ; - } ; - - snd_pcm_hw_params_free (hw_params) ; - - if ((err = snd_pcm_sw_params_malloc (&sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_malloc: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params_current (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_current: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - /* note: set start threshold to delay start until the ring buffer is full */ - snd_pcm_sw_params_current (alsa_dev, sw_params) ; - - if ((err = snd_pcm_sw_params_set_start_threshold (alsa_dev, sw_params, buffer_size)) < 0) - { fprintf (stderr, "cannot set start threshold (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_sw_params_free (sw_params) ; - - snd_pcm_reset (alsa_dev) ; - -catch_error : - - if (err < 0 && alsa_dev != NULL) - { snd_pcm_close (alsa_dev) ; - return NULL ; - } ; - - return alsa_dev ; -} /* alsa_open */ - -static int -alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) -{ static int epipe_count = 0 ; - - int total = 0 ; - int retval ; - - if (epipe_count > 0) - epipe_count -- ; - - while (total < frames) - { retval = snd_pcm_writei (alsa_dev, data + total * channels, frames - total) ; - - if (retval >= 0) - { total += retval ; - if (total == frames) - return total ; - - continue ; - } ; - - switch (retval) - { case -EAGAIN : - puts ("alsa_write_float: EAGAIN") ; - continue ; - break ; - - case -EPIPE : - if (epipe_count > 0) - { printf ("alsa_write_float: EPIPE %d\n", epipe_count) ; - if (epipe_count > 140) - return retval ; - } ; - epipe_count += 100 ; - -#if 0 - if (0) - { snd_pcm_status_t *status ; - - snd_pcm_status_alloca (&status) ; - if ((retval = snd_pcm_status (alsa_dev, status)) < 0) - fprintf (stderr, "alsa_out: xrun. can't determine length\n") ; - else if (snd_pcm_status_get_state (status) == SND_PCM_STATE_XRUN) - { struct timeval now, diff, tstamp ; - - gettimeofday (&now, 0) ; - snd_pcm_status_get_trigger_tstamp (status, &tstamp) ; - timersub (&now, &tstamp, &diff) ; - - fprintf (stderr, "alsa_write_float xrun: of at least %.3f msecs. resetting stream\n", - diff.tv_sec * 1000 + diff.tv_usec / 1000.0) ; - } - else - fprintf (stderr, "alsa_write_float: xrun. can't determine length\n") ; - } ; -#endif - - snd_pcm_prepare (alsa_dev) ; - break ; - - case -EBADFD : - fprintf (stderr, "alsa_write_float: Bad PCM state.n") ; - return 0 ; - break ; - - case -ESTRPIPE : - fprintf (stderr, "alsa_write_float: Suspend event.n") ; - return 0 ; - break ; - - case -EIO : - puts ("alsa_write_float: EIO") ; - return 0 ; - - default : - fprintf (stderr, "alsa_write_float: retval = %d\n", retval) ; - return 0 ; - break ; - } ; /* switch */ - } ; /* while */ - - return total ; -} /* alsa_write_float */ - -#endif /* HAVE_ALSA_ASOUNDLIB_H */ - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if !defined (__ANDROID__) && (defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__)) - -static int opensoundsys_open_device (int channels, int srate) ; - -static int -opensoundsys_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, audio_device, readcount, writecount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - audio_device = opensoundsys_open_device (sfinfo.channels, sfinfo.samplerate) ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { static float float_buffer [BUFFER_LEN] ; - double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, float_buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] = scale * float_buffer [m] ; - writecount = write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - } - else - { while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) - writecount = write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - - if (ioctl (audio_device, SNDCTL_DSP_POST, 0) == -1) - perror ("ioctl (SNDCTL_DSP_POST) ") ; - - if (ioctl (audio_device, SNDCTL_DSP_SYNC, 0) == -1) - perror ("ioctl (SNDCTL_DSP_SYNC) ") ; - - close (audio_device) ; - - sf_close (sndfile) ; - } ; - - return writecount ; -} /* opensoundsys_play */ - -static int -opensoundsys_open_device (int channels, int srate) -{ int fd, stereo, fmt ; - - if ((fd = open ("/dev/dsp", O_WRONLY, 0)) == -1 && - (fd = open ("/dev/sound/dsp", O_WRONLY, 0)) == -1) - { perror ("opensoundsys_open_device : open ") ; - exit (1) ; - } ; - - stereo = 0 ; - if (ioctl (fd, SNDCTL_DSP_STEREO, &stereo) == -1) - { /* Fatal error */ - perror ("opensoundsys_open_device : stereo ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_RESET, 0)) - { perror ("opensoundsys_open_device : reset ") ; - exit (1) ; - } ; - - fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ; - if (ioctl (fd, SNDCTL_DSP_SETFMT, &fmt) != 0) - { perror ("opensoundsys_open_device : set format ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_CHANNELS, &channels) != 0) - { perror ("opensoundsys_open_device : channels ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_SPEED, &srate) != 0) - { perror ("opensoundsys_open_device : sample rate ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_SYNC, 0) != 0) - { perror ("opensoundsys_open_device : sync ") ; - exit (1) ; - } ; - - return fd ; -} /* opensoundsys_open_device */ - -#endif /* __linux__ */ - -/*------------------------------------------------------------------------------ -** Mac OS X functions for playing a sound. -*/ - -#if (OSX_DARWIN_VERSION > 11) -/* MacOSX 10.8 use a new Audio API. Someone needs to write some code for it. */ -#endif /* OSX_DARWIN_VERSION > 11 */ - -#if (OSX_DARWIN_VERSION == 11) -/* MacOSX 10.7 use AudioQueue API */ - -#define kBytesPerAudioBuffer (1024 * 8) -#define kNumberOfAudioBuffers 4 - -typedef struct -{ AudioStreamBasicDescription format ; - - AudioQueueRef queue ; - AudioQueueBufferRef queueBuffer [kNumberOfAudioBuffers] ; - - UInt32 buf_size ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int done_playing ; -} MacOSXAudioData ; - - -static void -macosx_fill_buffer (MacOSXAudioData *audio_data, AudioQueueBufferRef audio_buffer) -{ int size, sample_count, read_count ; - short *buffer ; - - size = audio_buffer->mAudioDataBytesCapacity ; - sample_count = size / sizeof (short) ; - - buffer = (short*) audio_buffer->mAudioData ; - - read_count = sf_read_short (audio_data->sndfile, buffer, sample_count) ; - - if (read_count > 0) - { audio_buffer->mAudioDataByteSize = read_count * sizeof (short) ; - AudioQueueEnqueueBuffer (audio_data->queue, audio_buffer, 0, NULL) ; - } - else - AudioQueueStop (audio_data->queue, false) ; - -} /* macosx_fill_buffer */ - - -static void -macosx_audio_out_callback (void *user_data, AudioQueueRef audio_queue, AudioQueueBufferRef audio_buffer) -{ MacOSXAudioData *audio_data = (MacOSXAudioData *) user_data ; - - if (audio_data->queue == audio_queue) - macosx_fill_buffer (audio_data, audio_buffer) ; - -} /* macosx_audio_out_callback */ - - -static void -macosx_audio_out_property_callback (void *user_data, AudioQueueRef audio_queue, AudioQueuePropertyID prop) -{ MacOSXAudioData *audio_data = (MacOSXAudioData *) user_data ; - - if (prop == kAudioQueueProperty_IsRunning) - { UInt32 is_running = 0 ; - UInt32 is_running_size = sizeof (is_running) ; - - AudioQueueGetProperty (audio_queue, kAudioQueueProperty_IsRunning, &is_running, &is_running_size) ; - - if (!is_running) - { audio_data->done_playing = SF_TRUE ; - CFRunLoopStop (CFRunLoopGetCurrent ()) ; - } ; - } ; -} /* macosx_audio_out_property_callback */ - - - -static void -macosx_play (int argc, char *argv []) -{ MacOSXAudioData audio_data ; - OSStatus err ; - int i ; - int k ; - - memset (&audio_data, 0x55, sizeof (audio_data)) ; - - for (k = 1 ; k < argc ; k++) - { memset (&(audio_data.sfinfo), 0, sizeof (audio_data.sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (audio_data.sfinfo.channels < 1 || audio_data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", audio_data.sfinfo.channels) ; - continue ; - } ; - - /* fill ASBD */ - audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ; - audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ; - audio_data.format.mFormatID = kAudioFormatLinearPCM ; - audio_data.format.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked ; - audio_data.format.mBytesPerPacket = audio_data.format.mChannelsPerFrame * 2 ; - audio_data.format.mFramesPerPacket = 1 ; - audio_data.format.mBytesPerFrame = audio_data.format.mBytesPerPacket ; - audio_data.format.mBitsPerChannel = 16 ; - audio_data.format.mReserved = 0 ; - - /* create the queue */ - if ((err = AudioQueueNewOutput (&(audio_data.format), macosx_audio_out_callback, &audio_data, - CFRunLoopGetCurrent (), kCFRunLoopCommonModes, 0, &(audio_data.queue))) != noErr) - { printf ("AudioQueueNewOutput failed\n") ; - return ; - } ; - - /* add property listener */ - if ((err = AudioQueueAddPropertyListener (audio_data.queue, kAudioQueueProperty_IsRunning, macosx_audio_out_property_callback, &audio_data)) != noErr) - { printf ("AudioQueueAddPropertyListener failed\n") ; - return ; - } ; - - /* create the buffers */ - for (i = 0 ; i < kNumberOfAudioBuffers ; i++) - { if ((err = AudioQueueAllocateBuffer (audio_data.queue, kBytesPerAudioBuffer, &audio_data.queueBuffer [i])) != noErr) - { printf ("AudioQueueAllocateBuffer failed\n") ; - return ; - } ; - - macosx_fill_buffer (&audio_data, audio_data.queueBuffer [i]) ; - } ; - - audio_data.done_playing = SF_FALSE ; - - /* start queue */ - if ((err = AudioQueueStart (audio_data.queue, NULL)) != noErr) - { printf ("AudioQueueStart failed\n") ; - return ; - } ; - - while (audio_data.done_playing == SF_FALSE) - CFRunLoopRun () ; - - /* free the buffers */ - for (i = 0 ; i < kNumberOfAudioBuffers ; i++) - { if ((err = AudioQueueFreeBuffer (audio_data.queue, audio_data.queueBuffer [i])) != noErr) - { printf ("AudioQueueFreeBuffer failed\n") ; - return ; - } ; - } ; - - /* free the queue */ - if ((err = AudioQueueDispose (audio_data.queue, true)) != noErr) - { printf ("AudioQueueDispose failed\n") ; - return ; - } ; - - sf_close (audio_data.sndfile) ; - } ; - - return ; -} /* macosx_play, AudioQueue implementation */ - -#endif /* OSX_DARWIN_VERSION == 11 */ - -#if (OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10) -/* MacOSX 10.6 or earlier, use Carbon and AudioHardware API */ - -typedef struct -{ AudioStreamBasicDescription format ; - - UInt32 buf_size ; - AudioDeviceID device ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int fake_stereo ; - int done_playing ; -} MacOSXAudioData ; - -#include - -static OSStatus -macosx_audio_out_callback (AudioDeviceID device, const AudioTimeStamp* current_time, - const AudioBufferList* data_in, const AudioTimeStamp* time_in, - AudioBufferList* data_out, const AudioTimeStamp* time_out, - void* client_data) -{ MacOSXAudioData *audio_data ; - int size, sample_count, read_count, k ; - float *buffer ; - - /* Prevent compiler warnings. */ - device = device ; - current_time = current_time ; - data_in = data_in ; - time_in = time_in ; - time_out = time_out ; - - audio_data = (MacOSXAudioData*) client_data ; - - size = data_out->mBuffers [0].mDataByteSize ; - sample_count = size / sizeof (float) ; - - buffer = (float*) data_out->mBuffers [0].mData ; - - if (audio_data->fake_stereo != 0) - { read_count = sf_read_float (audio_data->sndfile, buffer, sample_count / 2) ; - - for (k = read_count - 1 ; k >= 0 ; k--) - { buffer [2 * k ] = buffer [k] ; - buffer [2 * k + 1] = buffer [k] ; - } ; - read_count *= 2 ; - } - else - read_count = sf_read_float (audio_data->sndfile, buffer, sample_count) ; - - /* Fill the remainder with zeroes. */ - if (read_count < sample_count) - { if (audio_data->fake_stereo == 0) - memset (&(buffer [read_count]), 0, (sample_count - read_count) * sizeof (float)) ; - /* Tell the main application to terminate. */ - audio_data->done_playing = SF_TRUE ; - } ; - - return noErr ; -} /* macosx_audio_out_callback */ - -static void -macosx_play (int argc, char *argv []) -{ MacOSXAudioData audio_data ; - OSStatus err ; - UInt32 count, buffer_size ; - int k ; - - audio_data.fake_stereo = 0 ; - audio_data.device = kAudioDeviceUnknown ; - - /* get the default output device for the HAL */ - count = sizeof (AudioDeviceID) ; - if ((err = AudioHardwareGetProperty (kAudioHardwarePropertyDefaultOutputDevice, - &count, (void *) &(audio_data.device))) != noErr) - { printf ("AudioHardwareGetProperty (kAudioDevicePropertyDefaultOutputDevice) failed.\n") ; - return ; - } ; - - /* get the buffersize that the default device uses for IO */ - count = sizeof (UInt32) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyBufferSize, - &count, &buffer_size)) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyBufferSize) failed.\n") ; - return ; - } ; - - /* get a description of the data format used by the default device */ - count = sizeof (AudioStreamBasicDescription) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyStreamFormat, - &count, &(audio_data.format))) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* Base setup completed. Now play files. */ - for (k = 1 ; k < argc ; k++) - { memset (&(audio_data.sfinfo), 0, sizeof (audio_data.sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (audio_data.sfinfo.channels < 1 || audio_data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", audio_data.sfinfo.channels) ; - continue ; - } ; - - audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ; - - if (audio_data.sfinfo.channels == 1) - { audio_data.format.mChannelsPerFrame = 2 ; - audio_data.fake_stereo = 1 ; - } - else - audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ; - - if ((err = AudioDeviceSetProperty (audio_data.device, NULL, 0, false, kAudioDevicePropertyStreamFormat, - sizeof (AudioStreamBasicDescription), &(audio_data.format))) != noErr) - { printf ("AudioDeviceSetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* we want linear pcm */ - if (audio_data.format.mFormatID != kAudioFormatLinearPCM) - return ; - - /* Fire off the device. */ - if ((err = AudioDeviceAddIOProc (audio_data.device, macosx_audio_out_callback, - (void *) &audio_data)) != noErr) - { printf ("AudioDeviceAddIOProc failed.\n") ; - return ; - } ; - - err = AudioDeviceStart (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - return ; - - audio_data.done_playing = SF_FALSE ; - - while (audio_data.done_playing == SF_FALSE) - usleep (10 * 1000) ; /* 10 000 milliseconds. */ - - if ((err = AudioDeviceStop (audio_data.device, macosx_audio_out_callback)) != noErr) - { printf ("AudioDeviceStop failed.\n") ; - return ; - } ; - - err = AudioDeviceRemoveIOProc (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - { printf ("AudioDeviceRemoveIOProc failed.\n") ; - return ; - } ; - - sf_close (audio_data.sndfile) ; - } ; - - return ; -} /* macosx_play, AudioHardware implementation */ - -#endif /* OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10 */ - -/*------------------------------------------------------------------------------ -** Win32 functions for playing a sound. -** -** This API sucks. Its needlessly complicated and is *WAY* too loose with -** passing pointers arounf in integers and and using char* pointers to -** point to data instead of short*. It plain sucks! -*/ - -#if (OS_IS_WIN32 == 1) - -#define WIN32_BUFFER_LEN (1 << 15) - -typedef struct -{ HWAVEOUT hwave ; - WAVEHDR whdr [2] ; - - CRITICAL_SECTION mutex ; /* to control access to BuffersInUSe */ - HANDLE Event ; /* signal that a buffer is free */ - - short buffer [WIN32_BUFFER_LEN / sizeof (short)] ; - int current, bufferlen ; - int BuffersInUse ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - sf_count_t remaining ; -} Win32_Audio_Data ; - - -static void -win32_play_data (Win32_Audio_Data *audio_data) -{ int thisread, readcount ; - - /* fill a buffer if there is more data and we can read it sucessfully */ - readcount = (audio_data->remaining > audio_data->bufferlen) ? audio_data->bufferlen : (int) audio_data->remaining ; - - thisread = (int) sf_read_short (audio_data->sndfile, (short *) (audio_data->whdr [audio_data->current].lpData), readcount) ; - - audio_data->remaining -= thisread ; - - if (thisread > 0) - { /* Fix buffer length if this is only a partial block. */ - if (thisread < audio_data->bufferlen) - audio_data->whdr [audio_data->current].dwBufferLength = thisread * sizeof (short) ; - - /* Queue the WAVEHDR */ - waveOutWrite (audio_data->hwave, (LPWAVEHDR) &(audio_data->whdr [audio_data->current]), sizeof (WAVEHDR)) ; - - /* count another buffer in use */ - EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse ++ ; - LeaveCriticalSection (&audio_data->mutex) ; - - /* use the other buffer next time */ - audio_data->current = (audio_data->current + 1) % 2 ; - } ; - - return ; -} /* win32_play_data */ - -static void CALLBACK -win32_audio_out_callback (HWAVEOUT hwave, UINT msg, DWORD_PTR data, DWORD param1, DWORD param2) -{ Win32_Audio_Data *audio_data ; - - /* Prevent compiler warnings. */ - (void) hwave ; - (void) param1 ; - (void) param2 ; - - if (data == 0) - return ; - - /* - ** I consider this technique of passing a pointer via an integer as - ** fundamentally broken but thats the way microsoft has defined the - ** interface. - */ - audio_data = (Win32_Audio_Data*) data ; - - /* let main loop know a buffer is free */ - if (msg == MM_WOM_DONE) - { EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse -- ; - LeaveCriticalSection (&audio_data->mutex) ; - SetEvent (audio_data->Event) ; - } ; - - return ; -} /* win32_audio_out_callback */ - -static void -win32_play (int argc, char *argv []) -{ Win32_Audio_Data audio_data ; - - WAVEFORMATEX wf ; - int k, error ; - - audio_data.sndfile = NULL ; - audio_data.hwave = 0 ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - audio_data.remaining = audio_data.sfinfo.frames * audio_data.sfinfo.channels ; - audio_data.current = 0 ; - - InitializeCriticalSection (&audio_data.mutex) ; - audio_data.Event = CreateEvent (0, FALSE, FALSE, 0) ; - - wf.nChannels = audio_data.sfinfo.channels ; - wf.wFormatTag = WAVE_FORMAT_PCM ; - wf.cbSize = 0 ; - wf.wBitsPerSample = 16 ; - - wf.nSamplesPerSec = audio_data.sfinfo.samplerate ; - - wf.nBlockAlign = audio_data.sfinfo.channels * sizeof (short) ; - - wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec ; - - error = waveOutOpen (&(audio_data.hwave), WAVE_MAPPER, &wf, (DWORD_PTR) win32_audio_out_callback, - (DWORD_PTR) &audio_data, CALLBACK_FUNCTION) ; - if (error) - { puts ("waveOutOpen failed.") ; - audio_data.hwave = 0 ; - continue ; - } ; - - audio_data.whdr [0].lpData = (char*) audio_data.buffer ; - audio_data.whdr [1].lpData = ((char*) audio_data.buffer) + sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - audio_data.whdr [1].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwFlags = 0 ; - audio_data.whdr [1].dwFlags = 0 ; - - /* length of each audio buffer in samples */ - audio_data.bufferlen = sizeof (audio_data.buffer) / 2 / sizeof (short) ; - - /* Prepare the WAVEHDRs */ - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [0] failed : %08X\n", error) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [1] failed : %08X\n", error) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - /* Fill up both buffers with audio data */ - audio_data.BuffersInUse = 0 ; - win32_play_data (&audio_data) ; - win32_play_data (&audio_data) ; - - /* loop until both buffers are released */ - while (audio_data.BuffersInUse > 0) - { - /* wait for buffer to be released */ - WaitForSingleObject (audio_data.Event, INFINITE) ; - - /* refill the buffer if there is more data to play */ - win32_play_data (&audio_data) ; - } ; - - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)) ; - - waveOutClose (audio_data.hwave) ; - audio_data.hwave = 0 ; - - DeleteCriticalSection (&audio_data.mutex) ; - - sf_close (audio_data.sndfile) ; - } ; - -} /* win32_play */ - -#endif /* Win32 */ - -/*------------------------------------------------------------------------------ -** OpenBDS's sndio. -*/ - -#if defined (HAVE_SNDIO_H) - -static void -sndio_play (int argc, char *argv []) -{ struct sio_hdl *hdl ; - struct sio_par par ; - short buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, readcount ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - if ((hdl = sio_open (NULL, SIO_PLAY, 0)) == NULL) - { fprintf (stderr, "open sndio device failed") ; - return ; - } ; - - sio_initpar (&par) ; - par.rate = sfinfo.samplerate ; - par.pchan = sfinfo.channels ; - par.bits = 16 ; - par.sig = 1 ; - par.le = SIO_LE_NATIVE ; - - if (! sio_setpar (hdl, &par) || ! sio_getpar (hdl, &par)) - { fprintf (stderr, "set sndio params failed") ; - return ; - } ; - - if (! sio_start (hdl)) - { fprintf (stderr, "sndio start failed") ; - return ; - } ; - - while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) - sio_write (hdl, buffer, readcount * sizeof (short)) ; - - sio_close (hdl) ; - } ; - - return ; -} /* sndio_play */ - -#endif /* sndio */ - -/*------------------------------------------------------------------------------ -** Solaris. -*/ - -#if (defined (sun) && defined (unix)) /* ie Solaris */ - -static void -solaris_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - audio_info_t audio_info ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - unsigned long delay_time ; - long k, start_count, output_count, write_count, read_count ; - int audio_fd, error, done ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - /* open the audio device - write only, non-blocking */ - if ((audio_fd = open ("/dev/audio", O_WRONLY | O_NONBLOCK)) < 0) - { perror ("open (/dev/audio) failed") ; - return ; - } ; - - /* Retrive standard values. */ - AUDIO_INITINFO (&audio_info) ; - - audio_info.play.sample_rate = sfinfo.samplerate ; - audio_info.play.channels = sfinfo.channels ; - audio_info.play.precision = 16 ; - audio_info.play.encoding = AUDIO_ENCODING_LINEAR ; - audio_info.play.gain = AUDIO_MAX_GAIN ; - audio_info.play.balance = AUDIO_MID_BALANCE ; - - if ((error = ioctl (audio_fd, AUDIO_SETINFO, &audio_info))) - { perror ("ioctl (AUDIO_SETINFO) failed") ; - return ; - } ; - - /* Delay time equal to 1/4 of a buffer in microseconds. */ - delay_time = (BUFFER_LEN * 1000000) / (audio_info.play.sample_rate * 4) ; - - done = 0 ; - while (! done) - { read_count = sf_read_short (sndfile, buffer, BUFFER_LEN) ; - if (read_count < BUFFER_LEN) - { memset (&(buffer [read_count]), 0, (BUFFER_LEN - read_count) * sizeof (short)) ; - /* Tell the main application to terminate. */ - done = SF_TRUE ; - } ; - - start_count = 0 ; - output_count = BUFFER_LEN * sizeof (short) ; - - while (output_count > 0) - { /* write as much data as possible */ - write_count = write (audio_fd, &(buffer [start_count]), output_count) ; - if (write_count > 0) - { output_count -= write_count ; - start_count += write_count ; - } - else - { /* Give the audio output time to catch up. */ - usleep (delay_time) ; - } ; - } ; /* while (outpur_count > 0) */ - } ; /* while (! done) */ - - close (audio_fd) ; - } ; - - return ; -} /* solaris_play */ - -#endif /* Solaris */ - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { - printf ("\nUsage : %s \n\n", program_name (argv [0])) ; - printf (" Using %s.\n\n", sf_version_string ()) ; -#if (OS_IS_WIN32 == 1) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - - Sleep (5 * 1000) ; -#endif - return 1 ; - } ; - -#if defined (__ANDROID__) - puts ("*** Playing sound not yet supported on Android.") ; - puts ("*** Please feel free to submit a patch.") ; - return 1 ; -#elif defined (__linux__) - #if HAVE_ALSA_ASOUNDLIB_H - if (access ("/proc/asound/cards", R_OK) == 0) - alsa_play (argc, argv) ; - else - #endif - opensoundsys_play (argc, argv) ; -#elif defined (__FreeBSD_kernel__) || defined (__FreeBSD__) - opensoundsys_play (argc, argv) ; -#elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION <= 11) - macosx_play (argc, argv) ; -#elif defined HAVE_SNDIO_H - sndio_play (argc, argv) ; -#elif (defined (sun) && defined (unix)) - solaris_play (argc, argv) ; -#elif (OS_IS_WIN32 == 1) - win32_play (argc, argv) ; -#elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION > 11) - printf ("OS X 10.8 and later have a new Audio API.\n") ; - printf ("Someone needs to write code to use that API.\n") ; - return 1 ; -#elif defined (__BEOS__) - printf ("This program cannot be compiled on BeOS.\n") ; - printf ("Instead, compile the file sfplay_beos.cpp.\n") ; - return 1 ; -#else - puts ("*** Playing sound not yet supported on this platform.") ; - puts ("*** Please feel free to submit a patch.") ; - return 1 ; -#endif - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/programs/sndfile-salvage.c b/libs/libsndfile/programs/sndfile-salvage.c deleted file mode 100644 index db55e60edd..0000000000 --- a/libs/libsndfile/programs/sndfile-salvage.c +++ /dev/null @@ -1,277 +0,0 @@ -/* -** Copyright (C) 2010-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - -#define NOT(x) (! (x)) - - -static void usage_exit (const char *progname) ; -static void salvage_file (const char * broken_wav, const char * fixed_w64) ; - -int -main (int argc, char *argv []) -{ - if (argc != 3) - usage_exit (program_name (argv [0])) ; - - salvage_file (argv [1], argv [2]) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void lseek_or_die (int fd, off_t offset, int whence) ; -static sf_count_t get_file_length (int fd, const char * name) ; -static sf_count_t find_data_offset (int fd, int format) ; -static void copy_data (int fd, SNDFILE * sndfile, int readsize) ; - - -static void -usage_exit (const char *progname) -{ printf ("Usage :\n\n %s \n\n", progname) ; - puts ("Salvages the audio data from WAV files which are more than 4G in length.\n") ; - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (0) ; -} /* usage_exit */ - -static void -salvage_file (const char * broken_wav, const char * fixed_w64) -{ SNDFILE * sndfile ; - SF_INFO sfinfo ; - sf_count_t broken_len, data_offset ; - int fd, read_size ; - - if (strcmp (broken_wav, fixed_w64) == 0) - { printf ("Error : Input and output files must be different.\n\n") ; - exit (1) ; - } ; - - if ((fd = open (broken_wav, O_RDONLY)) < 0) - { printf ("Error : Not able to open file '%s' : %s\n", broken_wav, strerror (errno)) ; - exit (1) ; - } ; - - broken_len = get_file_length (fd, broken_wav) ; - if (broken_len <= 0xffffffff) - printf ("File is not greater than 4Gig but salvaging anyway.\n") ; - - /* Grab the format info from the broken file. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - if ((sndfile = sf_open (broken_wav, SFM_READ, &sfinfo)) == NULL) - { printf ("sf_open ('%s') failed : %s\n", broken_wav, sf_strerror (NULL)) ; - exit (1) ; - } ; - sf_close (sndfile) ; - - data_offset = find_data_offset (fd, sfinfo.format & SF_FORMAT_TYPEMASK) ; - - printf ("Offset to audio data : %" PRId64 "\n", data_offset) ; - - switch (sfinfo.format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - sfinfo.format = SF_FORMAT_W64 | (sfinfo.format & SF_FORMAT_SUBMASK) ; - break ; - - default : - printf ("Don't currently support this file type.\n") ; - exit (1) ; - } ; - - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - read_size = 1 ; - break ; - - case SF_FORMAT_PCM_16 : - read_size = 2 ; - break ; - - case SF_FORMAT_PCM_24 : - read_size = 3 ; - break ; - - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - read_size = 4 ; - break ; - - case SF_FORMAT_DOUBLE : - read_size = 8 ; - break ; - - default : - printf ("Sorry, don't currently support this file encoding type.\n") ; - exit (1) ; - } ; - - read_size *= sfinfo.channels ; - - if ((sndfile = sf_open (fixed_w64, SFM_WRITE, &sfinfo)) == NULL) - { printf ("sf_open ('%s') failed : %s\n", broken_wav, sf_strerror (NULL)) ; - exit (1) ; - } ; - - lseek_or_die (fd, data_offset, SEEK_SET) ; - - copy_data (fd, sndfile, read_size) ; - - sf_close (sndfile) ; - - puts ("Done!") ; -} /* salvage_file */ - -/*------------------------------------------------------------------------------ -*/ - -static void -lseek_or_die (int fd, off_t offset, int whence) -{ - if (lseek (fd, offset, whence) < 0) - { printf ("lseek failed : %s\n", strerror (errno)) ; - exit (1) ; - } ; - - return ; -} /* lseek_or_die */ - - -static sf_count_t -get_file_length (int fd, const char * name) -{ struct stat sbuf ; - - if (sizeof (sbuf.st_size) != 8) - { puts ("Error : sizeof (sbuf.st_size) != 8. Was program compiled with\n" - " 64 bit file offsets?\n") ; - exit (1) ; - } ; - - if (fstat (fd, &sbuf) != 0) - { printf ("Error : fstat ('%s') failed : %s\n", name, strerror (errno)) ; - exit (1) ; - } ; - - return sbuf.st_size ; -} /* get_file_length */ - -static sf_count_t -find_data_offset (int fd, int format) -{ char buffer [8192], *cptr ; - const char * target = "XXXX" ; - sf_count_t offset = -1, extra ; - int rlen, slen ; - - switch (format) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - target = "data" ; - extra = 8 ; - break ; - - case SF_FORMAT_AIFF : - target = "SSND" ; - extra = 16 ; - break ; - - default : - puts ("Error : Sorry, don't handle this input file format.\n") ; - exit (1) ; - } ; - - slen = strlen (target) ; - - lseek_or_die (fd, 0, SEEK_SET) ; - - printf ("Searching for '%s' maker.\n", target) ; - - if ((rlen = read (fd, buffer, sizeof (buffer))) < 0) - { printf ("Error : failed read : %s\n", strerror (errno)) ; - exit (1) ; - } ; - - cptr = memchr (buffer, target [0], rlen - slen) ; - if (cptr && memcmp (cptr, target, slen) == 0) - offset = cptr - buffer ; - else - { printf ("Error : Could not find data offset.\n") ; - exit (1) ; - } ; - - return offset + extra ; -} /* find_data_offset */ - -static void -copy_data (int fd, SNDFILE * sndfile, int readsize) -{ static char * buffer ; - sf_count_t readlen, count ; - int bufferlen, done = 0 ; - - bufferlen = readsize * 1024 ; - buffer = malloc (bufferlen) ; - - while (NOT (done) && (readlen = read (fd, buffer, bufferlen)) >= 0) - { if (readlen < bufferlen) - { readlen -= readlen % readsize ; - done = 1 ; - } ; - - if ((count = sf_write_raw (sndfile, buffer, readlen)) != readlen) - { printf ("Error : sf_write_raw returned %" PRId64 " : %s\n", count, sf_strerror (sndfile)) ; - return ; - } ; - } ; - - free (buffer) ; - - return ; -} /* copy_data */ - diff --git a/libs/libsndfile/programs/test-sndfile-metadata-set.py b/libs/libsndfile/programs/test-sndfile-metadata-set.py deleted file mode 100644 index a21a36b3d1..0000000000 --- a/libs/libsndfile/programs/test-sndfile-metadata-set.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2008-2011 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Simple test script for the sndfile-metadata-set program. - -import commands, os, sys -import time, datetime - -def print_test_name (name): - print " %-30s :" % name, - -def assert_info (filename, arg, value): - cmd = "./sndfile-metadata-get %s %s" % (arg, filename) - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - if output.find (value) < 0: - print "\n\nError : not able to find '%s'." % value - print output - sys.exit (1) - return - - -def check_executable (name): - if not (os.path.isfile (name)): - print "\n\nError : Can't find executable '%s'. Have you run make?" % name - sys.exit (1) - -def test_empty_fail (): - print_test_name ("Empty fail test") - cmd = "./sndfile-metadata-set --bext-description Alpha sine.wav" - status, output = commands.getstatusoutput (cmd) - if not status: - print "\n\nError : command '%s' should have failed." % cmd - sys.exit (1) - print "ok" - -def test_copy (): - print_test_name ("Copy test") - cmd = "./sndfile-metadata-set --bext-description \"First Try\" sine.wav output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - assert_info ("output.wav", "--bext-description", "First Try") - print "ok" - -def test_update (tests): - print_test_name ("Update test") - for arg, value in tests: - cmd = "./sndfile-metadata-set %s \"%s\" output.wav" % (arg, value) - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - assert_info ("output.wav", arg, value) - print "ok" - -def test_post_mod (tests): - print_test_name ("Post mod test") - for arg, value in tests: - assert_info ("output.wav", arg, value) - print "ok" - -def test_auto_date (): - print_test_name ("Auto date test") - cmd = "./sndfile-metadata-set --bext-auto-time-date sine.wav date-time.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - target = datetime.date.today ().__str__ () - assert_info ("date-time.wav", "--bext-orig-date", target) - print "ok" - - -#------------------------------------------------------------------------------- - -def test_coding_history (): - print_test_name ("Coding history test") - cmd = "./sndfile-metadata-set --bext-coding-hist \"alpha beta\" output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - cmd = "./sndfile-metadata-get --bext-coding-hist output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - print "ok" - -#------------------------------------------------------------------------------- - -def test_rewrite (): - print_test_name ("Rewrite test") - cmd = "./sndfile-metadata-set --bext-originator \"Really, really long string\" output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - cmd = "./sndfile-metadata-set --bext-originator \"Short\" output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - cmd = "./sndfile-metadata-get --bext-originator output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - if output.find ("really long") > 0: - print "\n\nError : output '%s' should not contain 'really long'." % output - sys.exit (1) - print "ok" - -#=============================================================================== - -test_dir = "programs" - -if os.path.isdir (test_dir): - os.chdir (test_dir) - -for f in [ "sndfile-metadata-set", "sndfile-metadata-get", "../examples/make_sine" ]: - check_executable (f) - -os.system ("../examples/make_sine") -if not os.path.isfile ("sine.wav"): - print "\n\nError : Can't file file 'sine.wav'." - sys.exit (1) - -print "" - -test_empty_fail () -test_copy () - -tests = [ - ("--bext-description", "Alpha"), ("--bext-originator", "Beta"), ("--bext-orig-ref", "Charlie"), - ("--bext-umid", "Delta"), ("--bext-orig-date", "2001-10-01"), ("--bext-orig-time", "01:02:03"), - ("--str-title", "Echo"), ("--str-artist", "Fox trot") - ] - -test_auto_date () -test_update (tests) -test_post_mod (tests) - -test_update ([ ("--str-artist", "Fox") ]) - -# This never worked. -# test_coding_history () - -test_rewrite () - - -print "" - -sys.exit (0) - diff --git a/libs/libsndfile/reconfigure.mk b/libs/libsndfile/reconfigure.mk deleted file mode 100644 index 5ec5943ea8..0000000000 --- a/libs/libsndfile/reconfigure.mk +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/make -f - -# The auto tools MUST be run in the following order: -# -# 1. aclocal -# 2. libtoolize (if you use libtool) -# 3. autoconf -# 4. autoheader (if you use autoheader) -# 5. automake (if you use automake) -# -# The following makefile runs these in the correct order according to their -# dependancies. It also makes up for Mac OSX's fucked-upped-ness. - -ACLOCAL = aclocal - -ifneq ($(shell uname -s), Darwin) - LIBTOOLIZE = libtoolize -else - # Fuck Apple! Why the hell did they rename libtoolize???? - LIBTOOLIZE = glibtoolize - # Fink sucks as well, but this seems necessary. - ACLOCAL_INC = -I /sw/share/aclocal -endif - -genfiles : config.status - (cd src && make genfiles) - (cd tests && make genfiles) - -config.status: configure src/config.h.in Makefile.in src/Makefile.in tests/Makefile.in - ./configure --enable-gcc-werror - -configure: ltmain.sh - autoconf - -Makefile.in: Makefile.am - automake --copy --add-missing - -src/Makefile.in: src/Makefile.am - automake --copy --add-missing - -tests/Makefile.in: tests/Makefile.am - automake --copy --add-missing - -src/config.h.in: configure - autoheader - -libtool ltmain.sh: aclocal.m4 - $(LIBTOOLIZE) --copy --force - -# Need to re-run aclocal whenever acinclude.m4 is modified. -aclocal.m4: acinclude.m4 - $(ACLOCAL) $(ACLOCAL_INC) - -clean: - rm -f libtool ltmain.sh aclocal.m4 Makefile.in src/config.h.in config.cache config.status - find . -name .deps -type d -exec rm -rf {} \; - - -# Do not edit or modify anything in this comment block. -# The arch-tag line is a file identity tag for the GNU Arch -# revision control system. -# -# arch-tag: 2b02bfd0-d5ed-489b-a554-2bf36903cca9 diff --git a/libs/libsndfile/regtest/Makefile.am b/libs/libsndfile/regtest/Makefile.am deleted file mode 100644 index a87d0c4f83..0000000000 --- a/libs/libsndfile/regtest/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = sndfile-regtest - -noinst_HEADERS = regtest.h - -AM_CPPFLAGS = -I$(top_srcdir)/src $(SQLITE3_CFLAGS) $(OS_SPECIFIC_CFLAGS) - -sndfile_regtest_SOURCES = sndfile-regtest.c database.c checksum.c -sndfile_regtest_LDADD = $(top_builddir)/src/libsndfile.la $(SQLITE3_LIBS) - -CLEANFILES = *~ *.exe diff --git a/libs/libsndfile/regtest/Readme.txt b/libs/libsndfile/regtest/Readme.txt deleted file mode 100644 index bc038d6429..0000000000 --- a/libs/libsndfile/regtest/Readme.txt +++ /dev/null @@ -1,108 +0,0 @@ -sndfile-regtest -=============== - -The 'sndfile-regtest' program is a regression test-suite for libsndile. - -This program is intended to allow anyone who has an interest in the -reliability and correctness of libsndfile to do their own regression -testing. From the point of view of the libsndfile developers, this -program now allows for distributed regression testing of libsndfile -which will make libsndfile better. - - -How Does it Work ----------------- -Anyone who wishes to take part in the distributed regression testing of -libsndfile can download the regression test program and install it. - -Once installed the user can start collecting files and adding them to -their own personal database. Then, as new versions of libsndfile come -out, the user should test the new library version against their database -of files (instructions below). - -Any files which were successfully added to the database in the past but -now fail the check with the new library version represent a regression. -The user should then contact the libsndfile developers so that a copy -of the test file can be made available to the developers. - - -Requirements ------------- -The regression test program uses sqlite3 as the database engine. On -Debian, the required packages are : - - sqlite3 - libsqlite3-0 - libsqlite3-dev - -but similar packages should be available on any other Linux style -system. - -The regression test currently only compiles under Unix-like systems. -At some time in the future the regression test will distributed along -with the libsndfile source code distribution. - - -Organization of Files ---------------------- -The regession test program keeps its database file in the directory it -is run from. In addition, the database only contains information about -the files, not the files themselves. - -This means that database file should probably be kept in the same -directory (or a directory above) the test files. - - -Setting it Up for the First Time --------------------------------- -The sndfile-regtest program should be on your PATH. You can then cd into -the directory where you intend to keep you test files and -run the command: - - sndfile-regtest --create-db - -which creates a file named '.sndfile-regtest.db' in the current directory. - -Files can then be added to the database using the command: - - sndfile-regtest --add-file file1.wav - -The --add-file option allows more than one file to be added at a time -using: - - sndfile-regtest --add-file file1.wav file2.aif ..... - - -Checking Files --------------- -One or more files that have already been added to the database can be -checked using: - - sndfile-regtest --check-file file1.wav file2.aif ..... - -It is also possible to check all files in the database using: - - sndfile-regtest --check-all - - -Running a Regression Test -------------------------- -Once you have a collection of files and a database it is possible to test -new versions of libsndfile before you install them. If for instance you -have just compiled a new version of libsndfile in the directory -/usr/src/libsndfile-X.Y.Z, then you can use an existing sndfile-regtest -binary with the new libsndfile using something like: - - LD_PRELOAD=/usr/src/libsndfile-X.Y.Z/src/.libs/libsndfile.so.X.Y.Z \ - sndfile-regtest --check-all - - -Reporting Regressions ---------------------- -Any user who finds a file which was added to the regression database with -an earlier version of libsndfile and then fails the check with a later -version of the library should contact the author (erikd at mega dash nerd -dot com). If possible place the file on a web server and email the author -a link to it. - - diff --git a/libs/libsndfile/regtest/checksum.c b/libs/libsndfile/regtest/checksum.c deleted file mode 100644 index 7f433a41c8..0000000000 --- a/libs/libsndfile/regtest/checksum.c +++ /dev/null @@ -1,117 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* -** A simple checksum for short, int and float data. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include "regtest.h" - -#define BIG_PRIME 999983 - -#define ARRAY_LEN(x) ((int) (sizeof (x)) / (sizeof ((x) [0]))) - -static int short_checksum (SNDFILE * file, int start) ; -static int int_checksum (SNDFILE * file, int start) ; -static int float_checksum (SNDFILE * file, int start) ; - -int -calc_checksum (SNDFILE * file, const SF_INFO * info) -{ int start ; - - /* Seed the checksum with data from the SF_INFO struct. */ - start = info->samplerate ; - start = start * BIG_PRIME + info->channels ; - start = start * BIG_PRIME + info->format ; - - switch (info->format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - return float_checksum (file, start) ; - - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - return int_checksum (file, start) ; - - default : - return short_checksum (file, start) ; - } ; - - return 0 ; -} /* calc_checksum */ - -/*------------------------------------------------------------------------------ -*/ - -static union -{ short s [1 << 16] ; - int i [1 << 15] ; - float f [1 << 15] ; -} data ; - -static int -short_checksum (SNDFILE * file, int start) -{ int k, count ; - - do - { count = (int) sf_read_short (file, data.s, ARRAY_LEN (data.s)) ; - for (k = 0 ; k < count ; k++) - start = start * BIG_PRIME + data.s [k] ; - } - while (count > 0) ; - - return start ; -} /* short_checksum */ - -static int -int_checksum (SNDFILE * file, int start) -{ int k, count ; - - do - { count = (int) sf_read_int (file, data.i, ARRAY_LEN (data.i)) ; - for (k = 0 ; k < count ; k++) - start = start * BIG_PRIME + data.i [k] ; - } - while (count > 0) ; - - return start ; -} /* int_checksum */ - -static int -float_checksum (SNDFILE * file, int start) -{ int k, count ; - - do - { count = (int) sf_read_float (file, data.f, ARRAY_LEN (data.f)) ; - for (k = 0 ; k < count ; k++) - start = start * BIG_PRIME + lrintf (0x7FFFFFFF * data.f [k]) ; - } - while (count > 0) ; - - return start ; -} /* float_checksum */ - diff --git a/libs/libsndfile/regtest/database.c b/libs/libsndfile/regtest/database.c deleted file mode 100644 index f800a2c873..0000000000 --- a/libs/libsndfile/regtest/database.c +++ /dev/null @@ -1,495 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "regtest.h" - -#if HAVE_SQLITE3 - -#include - -typedef struct -{ sqlite3 *sql ; - - int count ; - int ekey_max ; - - /* Filename and pathname for file. */ - char filename [256] ; - char pathname [512] ; - - /* Storage for createding SQL commands. Must be larger than logbuf below. */ - char cmdbuf [1 << 15] ; - - /* Storage for log buffer retrieved from SNDFILE* .*/ - char logbuf [1 << 14] ; - -} REGTEST_DB ; - -/* In checksum.c */ -int calc_checksum (SNDFILE * file, const SF_INFO * info) ; - -static void get_filename_pathname (REGTEST_DB * db, const char *filepath) ; -static void single_quote_replace (char * buf) ; - -static int get_ekey_from_filename (REGTEST_DB * db, const char *filepath) ; -static int get_filename_pathname_by_ekey (REGTEST_DB * db, int ekey) ; -static int check_file_by_ekey (REGTEST_DB * db, int ekey) ; - -static int count_callback (REGTEST_DB * db, int argc, char **argv, char **colname) ; -static int ekey_max_callback (REGTEST_DB * db, int argc, char **argv, char **colname) ; -static int callback (void *unused, int argc, char **argv, char **colname) ; - -REG_DB * -db_open (