diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c99cf2e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,88 @@ +name: windows + +on: push + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + + # Configuration type to build. + # You can convert this to a build matrix if you need coverage of multiple configuration types. + # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + BUILD_CONFIGURATION: Release + +jobs: + build: + + runs-on: windows-2019 + if: github.repository == 'LAGonauta/MetaAudio' + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Init dependencies + working-directory: ${{env.GITHUB_WORKSPACE}} + run: build-initdeps.bat + shell: cmd + + - name: Build MetaAudio.dll + working-directory: ${{env.GITHUB_WORKSPACE}} + run: build-MetaAudio.bat + shell: cmd + + - name: Create Output directory + working-directory: ${{env.GITHUB_WORKSPACE}} + run: mkdir Output + shell: cmd + + - name: Copy Build to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + mkdir "Output\${{env.BUILD_CONFIGURATION}}" + xcopy "Build\${{env.BUILD_CONFIGURATION}}\MetaAudio.dll" "Output\${{env.BUILD_CONFIGURATION}}" /y /e + shell: cmd + + - name: Copy SteamAppsLocation to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + mkdir "Output\SteamAppsLocation" + copy "SteamAppsLocation\SteamAppsLocation.exe" "Output\SteamAppsLocation" /y + copy "SteamAppsLocation\steam_appid.txt" "Output\SteamAppsLocation" /y + copy "SteamAppsLocation\steam_api.dll" "Output\SteamAppsLocation" /y + shell: cmd + + - name: Copy sndfile to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + xcopy "externals\libsndfile\lib\sndfile.dll" "Output\externals\libsndfile\lib\" /y /e + shell: cmd + + - name: Copy install bat to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + copy "install-to-OpposingForce.bat" "Output" /y + copy "install-to-HalfLife.bat" "Output" /y + copy "install-to-DayOfDefeat.bat" "Output" /y + copy "install-to-CSCZDeletedScenes.bat" "Output" /y + copy "install-to-CounterStrike.bat" "Output" /y + copy "install-to-ConditionZero.bat" "Output" /y + copy "install-to-BlueShift.bat" "Output" /y + shell: cmd + + - name: Download MetaHook + run: | + Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231119b/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip + if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("BEC1D222274B43B2A2F1E2BFA619BE59A3361F8C0AB1FEA08A375ECC6FBB4ED4")) { + Exit -1 + } + Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/ + New-Item -Type dir -Force ./Output/${{env.BUILD_CONFIGURATION}} + Copy-Item ./MetaHook/Build/svencoop.exe ./Output/${{env.BUILD_CONFIGURATION}}/metahook.exe + shell: pwsh + + - uses: actions/upload-artifact@v3 + with: + name: MetaAudio + path: Output/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4c5e221 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,108 @@ +name: windows + +on: + push: + tags: + - "v*" + pull_request: + tags: + - "v*" + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + + # Configuration type to build. + # You can convert this to a build matrix if you need coverage of multiple configuration types. + # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + BUILD_CONFIGURATION: Release + +jobs: + build: + + runs-on: windows-2019 + if: github.repository == 'LAGonauta/MetaAudio' + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Init dependencies + working-directory: ${{env.GITHUB_WORKSPACE}} + run: build-initdeps.bat + shell: cmd + + - name: Build MetaAudio.dll + working-directory: ${{env.GITHUB_WORKSPACE}} + run: build-MetaAudio.bat + shell: cmd + + - name: Create Output directory + working-directory: ${{env.GITHUB_WORKSPACE}} + run: mkdir Output + shell: cmd + + - name: Copy Build to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + mkdir "Output\${{env.BUILD_CONFIGURATION}}" + xcopy "Build\${{env.BUILD_CONFIGURATION}}\MetaAudio.dll" "Output\${{env.BUILD_CONFIGURATION}}" /y /e + shell: cmd + + - name: Copy SteamAppsLocation to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + mkdir "Output\SteamAppsLocation" + copy "SteamAppsLocation\SteamAppsLocation.exe" "Output\SteamAppsLocation" /y + copy "SteamAppsLocation\steam_appid.txt" "Output\SteamAppsLocation" /y + copy "SteamAppsLocation\steam_api.dll" "Output\SteamAppsLocation" /y + shell: cmd + + - name: Copy sndfile to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + xcopy "externals\libsndfile\lib\sndfile.dll" "Output\externals\libsndfile\lib\" /y /e + shell: cmd + + - name: Copy install bat to Output + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + copy "install-to-OpposingForce.bat" "Output" /y + copy "install-to-HalfLife.bat" "Output" /y + copy "install-to-DayOfDefeat.bat" "Output" /y + copy "install-to-CSCZDeletedScenes.bat" "Output" /y + copy "install-to-CounterStrike.bat" "Output" /y + copy "install-to-ConditionZero.bat" "Output" /y + copy "install-to-BlueShift.bat" "Output" /y + shell: cmd + + - name: Download MetaHook + run: | + Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231119b/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip + if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("BEC1D222274B43B2A2F1E2BFA619BE59A3361F8C0AB1FEA08A375ECC6FBB4ED4")) { + Exit -1 + } + Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/ + New-Item -Type dir -Force ./Output/${{env.BUILD_CONFIGURATION}} + Copy-Item ./MetaHook/Build/svencoop.exe ./Output/${{env.BUILD_CONFIGURATION}}/metahook.exe + shell: pwsh + + - name: Zipping All + uses: vimtor/action-zip@v1.1 + with: + files: Output/ + dest: MetaAudio-windows-x86.zip + + - uses: actions/upload-artifact@v3 + with: + name: MetaAudio + path: MetaAudio-windows-x86.zip + + - name: Create Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + name: MetaAudio-${{ github.ref }} + files: | + MetaAudio-windows-x86.zip \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index b0f47c7..88d740e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,15 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.27) project(MetaAudio) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +set(OPENAL_LIBRARY ${PROJECT_SOURCE_DIR}/externals/OpenAL-SDK/libs/Win32/OpenAL32.lib) +set(OPENAL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/externals/OpenAL-SDK/include) + +set(SNDFILE_LIBRARY ${PROJECT_SOURCE_DIR}/externals/libsndfile/lib/sndfile.lib) +set(SNDFILE_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/externals/libsndfile/include) + # Configure Alure2 the way we need it option(METAAUDIO_STATIC_ALURE "Link Alure2 statically" ON) if(METAAUDIO_STATIC_ALURE) @@ -65,7 +71,6 @@ target_include_directories(MetaAudio ${PROJECT_SOURCE_DIR}/externals/picojson ${PROJECT_SOURCE_DIR}/externals/steamaudio/include ${PROJECT_SOURCE_DIR}/externals/alure/include/AL - ${PROJECT_SOURCE_DIR}/externals/openal-soft/include/AL ${PROJECT_SOURCE_DIR}/externals/MetaHookSv ${PROJECT_SOURCE_DIR}/externals/MetaHookSv/Interface ${PROJECT_SOURCE_DIR}/externals/MetaHookSv/HLSDK/common diff --git a/SteamAppsLocation/steam_appid.txt b/SteamAppsLocation/steam_appid.txt index 5493f8e..2bbd69c 100644 --- a/SteamAppsLocation/steam_appid.txt +++ b/SteamAppsLocation/steam_appid.txt @@ -1 +1 @@ -225840 +70 diff --git a/build-MetaAudio.bat b/build-MetaAudio.bat index c3d9a94..f2461ea 100644 --- a/build-MetaAudio.bat +++ b/build-MetaAudio.bat @@ -1,8 +1,4 @@ -mkdir "%temp%\OpenAL-SDK" - -xcopy "%~dp0OpenAL-SDK\" "%temp%\OpenAL-SDK\" /y /e - -call cmake -B "build" -A Win32 -D "OPENAL_INCLUDE_DIR=%temp%\OpenAL-SDK\include" -D "OPENAL_LIBRARY=%temp%\OpenAL-SDK\libs\Win32\OpenAL32.lib" -D "SNDFILE_LIBRARY=%~dp0externals/libsndfile/lib/sndfile.lib" -D "SNDFILE_INCLUDE_DIR=%~dp0externals/libsndfile/include" +call cmake -B "build" -A Win32 call powershell -Command "(gc build\MetaAudio.vcxproj) -replace 'Label=\"PropertySheets\">', 'Label=\"PropertySheets\" >' | Out-File build\MetaAudio.vcxproj" @@ -15,7 +11,4 @@ if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( "%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x86 MSBuild.exe "build\MetaAudio.sln" /t:MetaAudio /p:Configuration=Release /p:Platform="Win32" - MSBuild.exe "build\MetaAudio.sln" /t:metahook /p:Configuration=Release /p:Platform="Win32" -) - -rmdir /s /q "%temp%\OpenAL-SDK" \ No newline at end of file +) \ No newline at end of file diff --git a/OpenAL-SDK/include/EFX-Util.h b/externals/OpenAL-SDK/include/EFX-Util.h similarity index 100% rename from OpenAL-SDK/include/EFX-Util.h rename to externals/OpenAL-SDK/include/EFX-Util.h diff --git a/OpenAL-SDK/include/al.h b/externals/OpenAL-SDK/include/al.h similarity index 100% rename from OpenAL-SDK/include/al.h rename to externals/OpenAL-SDK/include/al.h diff --git a/OpenAL-SDK/include/alc.h b/externals/OpenAL-SDK/include/alc.h similarity index 100% rename from OpenAL-SDK/include/alc.h rename to externals/OpenAL-SDK/include/alc.h diff --git a/OpenAL-SDK/include/efx-creative.h b/externals/OpenAL-SDK/include/efx-creative.h similarity index 100% rename from OpenAL-SDK/include/efx-creative.h rename to externals/OpenAL-SDK/include/efx-creative.h diff --git a/OpenAL-SDK/include/efx.h b/externals/OpenAL-SDK/include/efx.h similarity index 100% rename from OpenAL-SDK/include/efx.h rename to externals/OpenAL-SDK/include/efx.h diff --git a/OpenAL-SDK/include/xram.h b/externals/OpenAL-SDK/include/xram.h similarity index 100% rename from OpenAL-SDK/include/xram.h rename to externals/OpenAL-SDK/include/xram.h diff --git a/OpenAL-SDK/libs/Win32/OpenAL32.lib b/externals/OpenAL-SDK/libs/Win32/OpenAL32.lib similarity index 100% rename from OpenAL-SDK/libs/Win32/OpenAL32.lib rename to externals/OpenAL-SDK/libs/Win32/OpenAL32.lib diff --git a/externals/libsndfile/cmake/SndFileConfig.cmake b/externals/libsndfile/cmake/SndFileConfig.cmake index 5127331..76816f7 100644 --- a/externals/libsndfile/cmake/SndFileConfig.cmake +++ b/externals/libsndfile/cmake/SndFileConfig.cmake @@ -1,7 +1,7 @@ -set(SndFile_VERSION 1.2.0) +set(SndFile_VERSION 1.2.2) set(SndFile_VERSION_MAJOR 1) set(SndFile_VERSION_MINOR 2) -set(SndFile_VERSION_PATCH 0) +set(SndFile_VERSION_PATCH 2) set (SndFile_WITH_EXTERNAL_LIBS 1) set (SndFile_WITH_MPEG 1) @@ -34,6 +34,10 @@ endmacro() include (CMakeFindDependencyMacro) +if (NOT TRUE) + list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +endif () + if (SndFile_WITH_EXTERNAL_LIBS AND NOT TRUE) find_dependency (Ogg 1.3) find_dependency (Vorbis) @@ -43,7 +47,11 @@ endif () if (SndFile_WITH_MPEG AND NOT TRUE) find_dependency (mp3lame) - find_dependency (MPG123) + find_dependency (mpg123) +endif () + +if (NOT TRUE) + list (REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) endif () include (${CMAKE_CURRENT_LIST_DIR}/SndFileTargets.cmake) diff --git a/externals/libsndfile/cmake/SndFileConfigVersion.cmake b/externals/libsndfile/cmake/SndFileConfigVersion.cmake index 745de97..1b8bf6b 100644 --- a/externals/libsndfile/cmake/SndFileConfigVersion.cmake +++ b/externals/libsndfile/cmake/SndFileConfigVersion.cmake @@ -9,19 +9,19 @@ # The variable CVF_VERSION must be set before calling configure_file(). -set(PACKAGE_VERSION "1.2.0") +set(PACKAGE_VERSION "1.2.2") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - if("1.2.0" MATCHES "^([0-9]+)\\.") + if("1.2.2" MATCHES "^([0-9]+)\\.") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") endif() else() - set(CVF_VERSION_MAJOR "1.2.0") + set(CVF_VERSION_MAJOR "1.2.2") endif() if(PACKAGE_FIND_VERSION_RANGE) @@ -52,11 +52,6 @@ else() endif() -# if the installed project requested no architecture check, don't perform the check -if("FALSE") - return() -endif() - # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "") return() diff --git a/externals/libsndfile/cmake/SndFileTargets.cmake b/externals/libsndfile/cmake/SndFileTargets.cmake index 531722d..aa87e3f 100644 --- a/externals/libsndfile/cmake/SndFileTargets.cmake +++ b/externals/libsndfile/cmake/SndFileTargets.cmake @@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.3") message(FATAL_ERROR "CMake >= 2.8.3 required") endif() cmake_policy(PUSH) -cmake_policy(VERSION 2.8.3...3.22) +cmake_policy(VERSION 2.8.3...3.24) #---------------------------------------------------------------- # Generated CMake target import file. #---------------------------------------------------------------- diff --git a/externals/libsndfile/include/sndfile.hh b/externals/libsndfile/include/sndfile.hh index a8db0de..f8beb71 100644 --- a/externals/libsndfile/include/sndfile.hh +++ b/externals/libsndfile/include/sndfile.hh @@ -100,6 +100,11 @@ class SndfileHandle SndfileHandle (const SndfileHandle &orig) ; SndfileHandle & operator = (const SndfileHandle &rhs) ; +#if (__cplusplus >= 201100L) + SndfileHandle (SndfileHandle &&orig) noexcept ; + SndfileHandle & operator = (SndfileHandle &&rhs) noexcept ; +#endif + /* Mainly for debugging/testing. */ int refCount (void) const { return (p == SF_NULL) ? 0 : p->ref ; } @@ -288,7 +293,32 @@ SndfileHandle::operator = (const SndfileHandle &rhs) ++ p->ref ; return *this ; -} /* SndfileHandle assignment operator */ +} /* SndfileHandle copy assignment */ + +#if (__cplusplus >= 201100L) + +inline +SndfileHandle::SndfileHandle (SndfileHandle &&orig) noexcept +: p (orig.p) +{ + orig.p = SF_NULL ; +} /* SndfileHandle move constructor */ + +inline SndfileHandle & +SndfileHandle::operator = (SndfileHandle &&rhs) noexcept +{ + if (&rhs == this) + return *this ; + if (p != SF_NULL && -- p->ref == 0) + delete p ; + + p = rhs.p ; + rhs.p = SF_NULL ; + + return *this ; +} /* SndfileHandle move assignment */ + +#endif inline int SndfileHandle::error (void) const diff --git a/externals/libsndfile/lib/sndfile.dll b/externals/libsndfile/lib/sndfile.dll new file mode 100644 index 0000000..f1a73bd Binary files /dev/null and b/externals/libsndfile/lib/sndfile.dll differ diff --git a/externals/libsndfile/lib/sndfile.lib b/externals/libsndfile/lib/sndfile.lib index 546c0c1..2f98347 100644 Binary files a/externals/libsndfile/lib/sndfile.lib and b/externals/libsndfile/lib/sndfile.lib differ diff --git a/externals/libsndfile/share/doc/libsndfile/FAQ.md b/externals/libsndfile/share/doc/libsndfile/FAQ.md deleted file mode 100644 index e7c98e2..0000000 --- a/externals/libsndfile/share/doc/libsndfile/FAQ.md +++ /dev/null @@ -1,482 +0,0 @@ ---- -layout: default -title: libsndfile : Frequently Asked Questions. ---- - -# libsndfile : Frequently Asked Questions - -1. [Do you plan to support XYZ codec in libsndfile?](#Q001) -2. [In version 0 the SF\_INFO struct had a pcmbitwidth field but version 1 does not. Why?](#Q002) -3. [Compiling is really slow on MacOS X. Why?](#Q003) -4. [When trying to compile libsndfile on Solaris I get a "bad substitution" error during linking. What can I do to fix this?](#Q004) -5. [Why doesn't libsndfile do interleaving/de-interleaving?](#Q005) -6. [What's the best format for storing temporary files?](#Q006) -7. [On Linux/Unix/MacOS X, what's the best way of detecting the presence of libsndfile?](#Q007) -8. [I have libsndfile installed and now I want to use it. I just want a simple Makefile\! What do I do?](#Q008) -9. [How about adding the ability to write/read sound files to/from memory buffers?](#Q009) -10. [Reading a 16 bit PCM file as normalised floats and then writing them back changes some sample values. Why?](#Q010) -11. [I'm having problems with u-law encoded WAV files generated by libsndfile in Winamp. Why?](#Q011) -12. [I'm looking at sf\_read\*. What are items? What are frames?](#Q012) -13. [Why can't libsndfile open this Sound Designer II (SD2) file?](#Q013) -14. [I'd like to statically link libsndfile to my closed source application. Can I buy a license so that this is possible?](#Q014) -15. [My program is crashing during a call to a function in libsndfile. Is this a bug in libsndfile?](#Q015) -16. [Will you accept a fix for compiling libsndfile with compiler X?](#Q016) -17. [Can libsndfile read/write files from/to UNIX pipes?](#Q017) -18. [Is it possible to build a Universal Binary on Mac OS X?](#Q018) -19. [I have project files for Visual Studio / XCode / Whatever. Why don't you distribute them with libsndfile?](#Q019) -20. [Why doesn't libsndfile support MP3?](#Q020) -21. [How do I use libsndfile in a closed source or commercial program and comply with the license?](#Q021) -22. [What versions of windows does libsndfile work on?](#Q022) -23. [I'm cross compiling libsndfile for another platform. How can I run the test suite?](#Q023) - ------ - -## Q1 : Do you plan to support XYZ codec in libsndfile? {#Q001} - -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? {#Q002} - -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](api.md#note-1) 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? {#Q003} - -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 it 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? {#Q004} - -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 it is called as /bin/sh. - -## Q5 : Why doesn't libsndfile do interleaving/de-interleaving? {#Q005} - -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? {#Q006} - -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? {#Q007} - -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? {#Q008} - -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? {#Q009} - -This has been [added](api.md#open_virtual) for version 1.0.12. - -## Q10 : Reading a 16 bit PCM file as normalised floats and then writing them back changes some sample values. Why? {#Q010} - -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](command.html#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? {#Q011} - -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? {#Q012} - -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: - -```c -#define CHANNELS 2 -short data [CHANNELS * 100] ; -sf_count items_read = sf_read_short (file, data, 200) ; -assert (items_read == 200) ; -``` - -and now reading the exact same amount of data using frames: - -```c -#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? {#Q013} - -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](http://www.macdisk.com/binhexen.php3) 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? {#Q014} - -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? {#Q015} - -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](http://valgrind.kde.org/) on x86 Linux - is excellent. [Purify](http://www.ibm.com/software/awdtools/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? {#Q016} - -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? {#Q017} - -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](#Q006). - -## Q18 : Is it possible to build a Universal Binary on Mac OS X? {#Q018} - -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 that the CPU endian-ness is detected at configure time. -Yes, I know the Apple compiler defines one of the macros \_\_LITTLE\_ENDIAN\_\_ -and \_\_BIG\_ENDIAN\_\_, but those macros are not part of the 1999 ISO C -Standard and they are not portable. - -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? {#Q019} - -Use CMake project. - -## Q20 : Why doesn't libsndfile support MP3? {#Q020} - -~~In the past, MP3 was not supported because the technology behind MP3 was -patented. Those patents have now expired and there is an -[open ticket](https://github.com/libsndfile/libsndfile/issues/258) to implement -MP3 support.~~ - -**Update :** Starting from version 1.1.0 libsndfile supports MP3 format. - -## Q21 : How do I use libsndfile in a closed source or commercial program and comply with the license? {#Q021} - -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](http://www.gnu.org/licenses/lgpl-2.1.txt) or optionally - [version 3](http://www.gnu.org/licenses/lgpl.txt). -- 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? {#Q022} - -New versions of libsndfile binary releases require Wiindows Vista. If you need -Windows XP support, you can build DLL from sources, we don't use specific WinXP -features. - -## Q23 : I'm cross compiling libsndfile for another platform. How can I run the test suite? {#Q023} - -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. diff --git a/externals/libsndfile/share/doc/libsndfile/api.md b/externals/libsndfile/share/doc/libsndfile/api.md deleted file mode 100644 index 047fb4a..0000000 --- a/externals/libsndfile/share/doc/libsndfile/api.md +++ /dev/null @@ -1,744 +0,0 @@ ---- -layout: page -title: 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](#note-1) and [Note 2](#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 the -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](command.md).** - -## Synopsis - -```c -#include ; -#include ; -``` - -| Name | Description | -|:------------------------------------------------------------------------------------------------------------|:--------------------------------------- | -| [sf_open, sf_wchar_open](#open) | File open functions. | -| [sf_open_fd](#open_fd) | Open sound file using file descriptor. | -| [sf_open_virtual](#open_virtual) | Open sound file using virtual API. | -| [sf_format_check](#check) | Validate sound file info. | -| [sf_seek](#seek) | Seek position in sound file. | -| [sf_command](command.md) | Command interface. | -| [sf_error, sf_strerror, sf_error_number, sf_perror, sf_error_str](#error) | Error functions. | -| [sf_close](#close) | File close function. | -| [sf_write_sync](#write_sync) | Write sync function. | -| [sf_read_short, sf_read_int, sf_read_float, sf_read_double](#read) | File items read functions. | -| [sf_readf_short, sf_readf_int, sf_readf_float, sf_readf_double](#readf) | File frames read functions. | -| [sf_write_short, sf_write_int, sf_write_float, sf_write_double](#write) | File items write functions. | -| [sf_writef_short, sf_writef_int, sf_writef_float, sf_writef_double](#writef) | File frames write functions. | -| [sf_read_raw, sf_write_raw](#raw) | Raw read/write functions. | -| [sf_get_string, sf_set_string](#string) | Functions for reading and writing string data. | -| [sf_version_string](#version_string) | Retrive library version string. | -| [sf_current_byterate](#current_byterate) | Retrieve current byterate. | -| [sf_set_chunk, sf_get_chunk_iterator, sf_next_chunk_iterator, sf_get_chunk_size, sf_get_chunk_data](#chunk) | RIFF chunks API. | - -SNDFILE* is an anonymous pointer to data which is private to the library. - -## File Open Function {#open} - -```c -SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ; -``` - -The sf_open() function opens the sound file at the specified path. The filename is byte encoded, but may be utf-8 on -Linux, while on Mac OS X it will use the filesystem character set. On Windows, there is also a Windows specific -sf_wchar_open() that takes a UTF16_BE encoded filename. - -```c -SNDFILE* sf_wchar_open (LPCWSTR wpath, 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: - -```c -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. - -**Note:** The libsndfile library will reject values ​​for field **channels** that -are greater than `1024`. These value ​​represent the maximum theoretical limit -and may be less for specific formats. - -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. - -| Name | Value | Description | -|:-------------------------|:-----------|:-------------------------------------------| -| **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 | -| SF_FORMAT_MPEG | 0x230000 | MPEG-1/2 audio stream | -| **Subtypes.** | -| 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_NMS_ADPCM_16 | 0x0022 | 16kbs NMS G721-variant encoding. | -| SF_FORMAT_NMS_ADPCM_24 | 0x0023 | 24kbs NMS G721-variant encoding. | -| SF_FORMAT_NMS_ADPCM_32 | 0x0024 | 32kbs NMS G721-variant 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. | -| SF_FORMAT_OPUS | 0x0064 | Xiph/Skype Opus encoding. | -| SF_FORMAT_ALAC_16 | 0x0070 | Apple Lossless Audio Codec (16 bit). | -| SF_FORMAT_ALAC_20 | 0x0071 | Apple Lossless Audio Codec (20 bit). | -| SF_FORMAT_ALAC_24 | 0x0072 | Apple Lossless Audio Codec (24 bit). | -| SF_FORMAT_ALAC_32 | 0x0073 | Apple Lossless Audio Codec (32 bit). | -| SF_FORMAT_MPEG_LAYER_I | 0x0080 | MPEG-1 Audio Layer I. | -| SF_FORMAT_MPEG_LAYER_II | 0x0081 | MPEG-1 Audio Layer II. | -| SF_FORMAT_MPEG_LAYER_III | 0x0082 | MPEG-2 Audio Layer III. | -| **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**()](#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**()](#error). - -### File Descriptor Open {#open_fd} - -```c -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](embedded_files.md). - -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_fd(). - -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 {#open_virtual} - -```c -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 write/read from memory -with a stream or buffer based system. Apart from the sfvirtual and the user_data -parameters this function behaves like [sf_open()](#open). - -```c - 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. - -```c -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 - -```c -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 - -```c -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 - -```c -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 - -```c -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 - -```c -typedef sf_count_t (*sf_vio_tell) (void *user_data) ; -``` - -Return the current position of the virtual file context. - -## Format Check Function {#chek} - -```c -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](#open) (SFM_WRITE). - -sf_format_check() returns TRUE if the parameters are valid and FALSE otherwise. - -## File Seek Functions - -```c -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 {#error} - -```c -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: - -| Name | Value | -|:----------------------------|:------| -| 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 -\; 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. - -```c -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. - -```c -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 {#close} - -```c -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 {#write_sync} - -```c -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 {#read} - -```c -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) ; -``` - -{: #readf} -```c -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 functions fill the array pointed to by ptr with the requested -number of items or frames. - -For the frames-count functions, the frames parameter specifies the number of -frames. A frame is just a block of samples, one for each channel. - -**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).** - -For the items-count functions, the items parameter must be an integer product -of the number of channels or an error will occur. Here, an item is just a -sample. - -Note: The only difference between the "items" and "frames" versions of each read -function is the units in which the object count is specified - calling -sf_readf_short() with a count argument of N, on a SNDFILE with C channels, is -the same as calling sf_read_short with a count argument of N\*C. The buffer -pointed to by "ptr" should be the same number of bytes in each case. - -Note: The data type used by the calling program and the data format of the file -do not need to be the same. For instance, it is possible to open a 16 bit PCM -encoded WAV file and read the data using sf_read_float(). The library seamlessly -converts between the two formats on-the-fly. See [Note 1](#note-1). - -The sf_read_XXXX and sf_readf_XXXX functions return the number of items or -frames read, respectively. Unless the end of the file was reached during the -read, the return value should equal the number of objects requested. Attempts to -read beyond the end of the file will not result in an error but will cause the -read functions to return less than the number of objects requested or 0 if -already at the end of the file. When the buffer is not is not completely filled, -unused buffer space is filled by zeroes. - -## File Write Functions {#write} - -```c -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) ; -``` - -{: #writef} -```c -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 functions write the data in the array pointed to by ptr to the -file. - -For items-count functions, the items parameter specifies the size of the array -and must be an integer product of the number of channels or an error will occur. - -For the frames-count functions, the array is expected to be large enough to hold -a number of items equal to the product of frames and the number of channels. - -As with the read functions [above](#read), the only difference in the items and -frames version of each write function is the units in which the buffer size is -specified. Again, the data type used by the calling program and the data format -of the file do not need to be the same ([Note 1](#note-1)). - -The sf_write_XXXX and sf_writef_XXXX functions respectively return the number of -items or frames written (which should be the same as the items or frames -parameter). - -## Raw File Read and Write Functions {#raw} - -```c -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](command.md#sfc_raw_needs_endswap). - -## Functions for Reading and Writing String Data {#string} - -```c -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: - -| Name | Value | Description | -|:-------------------|:------|:--------------| -| SF_STR_TITLE | 0x01 | Title. | -| SF_STR_COPYRIGHT | 0x02 | Copyright. | -| SF_STR_SOFTWARE | 0x03 | Software. | -| SF_STR_ARTIST | 0x04 | Artist. | -| SF_STR_COMMENT | 0x05 | Comment. | -| SF_STR_DATE | 0x06 | Date. | -| SF_STR_ALBUM | 0x07 | Album. | -| SF_STR_LICENSE | 0x08 | License. | -| SF_STR_TRACKNUMBER | 0x09 | Track number. | -| SF_STR_GENRE | 0x10 | 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(). - -Strings passed to and retrieved from these two functions are assumed to be -utf-8. However, while formats like Ogg/Vorbis and FLAC fully support utf-8, -others like WAV and AIFF officially only support ASCII. Writing utf-8 strings to -WAV and AIF files with libsndfile will work when read back with libsndfile, but -may not work with other programs. - -The suggested method of dealing with tags retrived using sf_get_string() is to -assume they are utf-8. Similarly if you have a string in some exotic format like -utf-16, it should be encoded to utf-8 before being written using libsndfile. - -## Function for retrieving library version {#version_string} - -```c -const char *sf_version_string (void) ; -``` - -Return the library version string. - -## Function for retrieving current byterate {#current_byterate} - -```c -int sf_current_byterate (SNDFILE *sndfile) ; -``` - -Return the current byterate at this point in the file. The byte rate in this -case is the number of bytes per second of audio data. For instance, for a -stereo, 18 bit PCM encoded file with an 16kHz sample rate, the byte rate -would be 2 (stereo) \* 2 (two bytes per sample) * 16000 => 64000 bytes/sec. - -For some file formats the returned value will be accurate and exact, for some -it will be a close approximation, for some it will be the average bitrate for -the whole file and for some it will be a time varying value that was accurate -when the file was most recently read or written. - -To get the bitrate, multiple this value by 8. - -`sf_current_byterate` returns byte per second or -1 if byterate is -unknown. - -## Functions to get and set chunks from within a sound file - -These functions allow the getting and setting of chunks within a sound file (for -those formats which allow it). - -These functions fail safely. Specifically, they will not allow you to overwrite -existing chunks or add extra versions of format specific reserved chunks but -should allow you to retrieve any and all chunks (may not be implemented for all -chunks or all file formats). - -### sf_set_chunk - -```c -int sf_set_chunk (SNDFILE *sndfile, const SF_CHUNK_INFO *chunk_info) ; -``` - -Set the specified chunk info (must be done before any audio data is written to -the file). This will fail for format specific reserved chunks. The -`chunk_info->data` pointer must be valid until the file is closed. - -The `SF_CHUNK_INFO` struct is documented as follows: - -```c -struct SF_CHUNK_INFO -{ char id [64] ; /* The chunk identifier. */ - unsigned id_size ; /* The size of the chunk identifier. */ - unsigned datalen ; /* The size of that data. */ - void *data ; /* Pointer to the data. */ -} ; - typedef struct SF_CHUNK_INFO SF_CHUNK_INFO ; -``` - -`sf_set_chunk` returns `SF_ERR_NO_ERROR` on success or non-zero on failure. - -### sf_get_chunk_iterator - -```c -SF_CHUNK_ITERATOR * -sf_get_chunk_iterator (SNDFILE *sndfile, const SF_CHUNK_INFO *chunk_info) ; -``` - -Get an iterator for all chunks matching `chunk_info`. - -`SF_CHUNK_ITERATOR` is an opaque structure to an iterator over the all chunks of -a given id and defined as follows: - -```c -typedef struct SF_CHUNK_ITERATOR SF_CHUNK_ITERATOR ; -``` - -The iterator will point to the first chunk matching `chunk_info`. Chunks are -matching, if (`chunk_info->id`) matches the first (`chunk_info->id_size`) bytes -of a chunk found in the `SNDFILE*` handle. If `chunk_info` is `NULL`, an -iterator to all chunks in the `SNDFILE*` handle is returned. The values of -`chunk_info->datalen` and `chunk_info->data` are ignored. If no matching chunks -are found in the sndfile, `NULL` is returned. - -The returned iterator will stay valid until one of the following occurs: - -* The sndfile is closed. -* A new chunk is added using [`sf_set_chunk()`](#sf_set_chunk). -* Another chunk iterator function is called on the same `SNDFILE*` - handle that causes the iterator to be modified. - -The memory for the iterator belongs to the SNDFILE* handle and is freed when -[sf_close](#close) is called. - -### sf_next_chunk_iterator - -```c -sf_next_chunk_iterator (SF_CHUNK_ITERATOR * iterator) ; -``` - -Iterate through chunks by incrementing the iterator. - -Increments the iterator and returns a handle to the new one. After this call, -iterator will no longer be valid, and you must use the newly returned handle -from now on. The returned handle can be used to access the next chunk matching -the criteria as defined in [sf_get_chunk_iterator](#sf_get_chunk_iterator). -If iterator points to the last chunk, this will free all resources associated -with iterator and return `NULL`. The returned iterator will stay valid until -`sf_get_next_chunk_iterator` is called again, the sndfile is closed or a new -chunk us added. - -### sf_get_chunk_size - -```c -int -sf_get_chunk_size (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ; -``` - -Get the size of the specified chunk. - -If the specified chunk exists, the size will be returned in the `datalen` field -of the `SF_CHUNK_INFO` struct. Additionally, the id of the chunk will be copied -to the `id` field of the `SF_CHUNK_INFO` struct and it's `id_size` field will be -updated accordingly. - -If the chunk doesn't exist `chunk_info->datalen` will be zero, and the `id` and -`id_size` fields will be undefined. - -The function will return `SF_ERR_NO_ERROR` on success or non-zero on failure. - -### sf_get_chunk_data - -```c -int -sf_get_chunk_data (const SF_CHUNK_ITERATOR *it, SF_CHUNK_INFO *chunk_info) ; -``` - -Get the specified chunk data. - -If the specified chunk exists, up to `chunk_info->datalen` bytes of the chunk -data will be copied into the `chunk_info->data` buffer (allocated by the caller) -and the `chunk_info->datalen` field updated to reflect the size of the data. The -`id` and `id_size` field will be updated according to the retrieved chunk. If -the chunk doesn't exist `chunk_info->datalen` will be zero, and the `id` and -`id_size` fields will be undefined. - -The function will return `SF_ERR_NO_ERROR` on success or non-zero on failure. - -## Note 1 - -When converting between integer PCM formats of differing size (e.g. using -sf_read_int() to read a 16 bit PCM encoded WAV file) libsndfile obeys one simple -rule: - -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](command.md) -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](command.md) interface, a command of -[SFC_SET_SCALE_FLOAT_INT_READ](command.md#sfc_set_scale_float_int_read) and a -parameter of SF_TRUE to force correct scaling. diff --git a/externals/libsndfile/share/doc/libsndfile/bugs.md b/externals/libsndfile/share/doc/libsndfile/bugs.md deleted file mode 100644 index f788c0e..0000000 --- a/externals/libsndfile/share/doc/libsndfile/bugs.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: page ---- - -# Reporting Bugs in libsndfile - -Before even attempting to report a bug in libsndfile please make sure you have -read the [Frequently Asked Questions](FAQ.md). If you are having a problem -writing code using libsndfile make sure you read the -[Application Programming Interface](api.md) 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](sndfile_info.md) 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 libsndfile -[GitHub issue tracker](https://github.com/libsndfile/libsndfile/issues). diff --git a/externals/libsndfile/share/doc/libsndfile/command.md b/externals/libsndfile/share/doc/libsndfile/command.md deleted file mode 100644 index b5a76f6..0000000 --- a/externals/libsndfile/share/doc/libsndfile/command.md +++ /dev/null @@ -1,2016 +0,0 @@ ---- -layout: page -title: libsndfile : the sf_command function. ---- - -# sf_command - -```c -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: - -| Name | Description | -|:------------------------------------------------------------------|:--------------------------------------------------------| -| [SFC_GET_LIB_VERSION](#sfc_get_lib_version) | Retrieve the version of the library as a string. | -| [SFC_GET_LOG_INFO](#sfc_get_log_info) | Retrieve the internal per-file operation log. | -| [SFC_GET_CURRENT_SF_INFO](#sfc_get_current_sf_info) | Retrieve `SF_INFO` struct of opened file. | -| [SFC_CALC_SIGNAL_MAX](#sfc_calc_signal_max) | Calculate the measured maximum signal value. | -| [SFC_CALC_NORM_SIGNAL_MAX](#sfc_calc_norm_signal_max) | Calculate the measured normalised maximum signal value. | -| [SFC_CALC_MAX_ALL_CHANNELS](#sfc_calc_max_all_channels) | Calculate the peak value for each channel. | -| [SFC_CALC_NORM_MAX_ALL_CHANNELS](#sfc_calc_norm_max_all_channels) | Calculate the normalised peak for each channel. | -| [SFC_GET_SIGNAL_MAX](#sfc_get_signal_max) | Retrieve the peak value for the file. | -| [SFC_GET_MAX_ALL_CHANNELS](#sfc_get_max_all_channels) | Retrieve the peak value for each channel. | -| [SFC_SET_NORM_FLOAT](#sfc_set_norm_float) | Set float normalisation behaviour. | -| [SFC_SET_NORM_DOUBLE](#sfc_set_norm_double) | Set double normalisation behaviour. | -| [SFC_GET_NORM_FLOAT](#sfc_get_norm_float) | Get float normalisation behaviour. | -| [SFC_GET_NORM_DOUBLE](#sfc_get_norm_double) | Get double normalisation behaviour. | -| [SFC_SET_SCALE_FLOAT_INT_READ](#sfc_set_scale_float_int_read) | Control scale factor on read. | -| [SFC_SET_SCALE_INT_FLOAT_WRITE](#sfc_set_scale_int_float_write) | Control scale factor on write. | -| [SFC_GET_SIMPLE_FORMAT_COUNT](#sfc_get_simple_format_count) | Get simple formats count. | -| [SFC_GET_SIMPLE_FORMAT](#sfc_get_simple_format) | Get information about a simple format. | -| [SFC_GET_FORMAT_INFO](#sfc_get_format_info) | Get information about a major or subtype format. | -| [SFC_GET_FORMAT_MAJOR_COUNT](#sfc_get_format_major_count) | Get the number of major formats. | -| [SFC_GET_FORMAT_MAJOR](#sfc_get_format_major) | Get information about a major format type. | -| [SFC_GET_FORMAT_SUBTYPE_COUNT](#sfc_get_format_subtype_count) | Get the number of subformats. | -| [SFC_GET_FORMAT_SUBTYPE](#sfc_get_format_subtype) | Get information about a subformat. | -| [SFC_SET_ADD_PEAK_CHUNK](#sfc_set_add_peak_chunk) | Control PEAK chunk write to WAV and AIFF. | -| [SFC_UPDATE_HEADER_NOW](#sfc_update_header_now) | Update the file header in write mode on demand. | -| [SFC_SET_UPDATE_HEADER_AUTO](#sfc_set_update_header_auto) | Update the file header on each write. | -| [SFC_FILE_TRUNCATE](#sfc_file_truncate) | Truncate a file open for write or for read/write. | -| [SFC_SET_RAW_START_OFFSET](#sfc_set_raw_start_offset) | Change the data start offset for raw files. | -| SFC_SET_DITHER_ON_WRITE | Not implemented. | -| SFC_SET_DITHER_ON_READ | Not implemented. | -| SFC_GET_DITHER_INFO_COUNT | Not implemented. | -| SFC_GET_DITHER_INFO | Not implemented. | -| [SFC_SET_CLIPPING](#sfc_set_clipping) | Control automatic clipping behaviour. | -| [SFC_GET_CLIPPING](#sfc_get_clipping) | Get current clipping setting. | -| [SFC_GET_EMBED_FILE_INFO](#sfc_get_embed_file_info) | Get information about embedded audio files. | -| [SFC_WAVEX_GET_AMBISONIC](#sfc_wavex_get_ambisonic) | Test a WAVEX file for Ambisonic format. | -| [SFC_WAVEX_SET_AMBISONIC](#sfc_wavex_set_ambisonic) | Modify a WAVEX header for Ambisonic format. | -| [SFC_SET_VBR_ENCODING_QUALITY](#sfc_set_vbr_encoding_quality) | Set the Variable Bit Rate encoding quality. | -| [SFC_SET_OGG_PAGE_LATENCY_MS](#sfc_set_ogg_page_latency_ms) | Set Ogg page latency for Opus file. | -| [SFC_GET_OGG_STREAM_SERIALNO](#sfc_get_ogg_stream_serialno) | Get Ogg stream serial number. | -| [SFC_SET_COMPRESSION_LEVEL](#sfc_set_compression_level) | Set the compression level. | -| [SFC_RAW_DATA_NEEDS_ENDSWAP](#sfc_raw_data_needs_endswap) | Determine if raw data needs endswapping. | -| [SFC_GET_BROADCAST_INFO](#sfc_get_broadcast_info) | Get the Broadcast Chunk info. | -| [SFC_SET_BROADCAST_INFO](#sfc_set_broadcast_info) | Set the Broadcast Chunk info. | -| [SFC_GET_CHANNEL_MAP_INFO](#sfc_get_channel_map_info) | Get the channel map info. | -| [SFC_SET_CHANNEL_MAP_INFO](#sfc_set_channel_map_info) | Set the channel map info. | -| [SFC_SET_CART_INFO](#sfc_set_cart_info) | Set the Cart Chunk info. | -| [SFC_GET_CART_INFO](#sfc_get_cart_info) | Get the Cart Chunk info. | -| [SFC_GET_LOOP_INFO](#sfc_get_loop_info) | Get loop info. | -| [SFC_GET_INSTRUMENT](#sfc_get_instrument) | Get instrument info. | -| [SFC_SET_INSTRUMENT](#sfc_set_instrument) | Set instrument info. | -| [SFC_GET_CUE_COUNT](#sfc_get_cue_count) | Get the cue marker count. | -| [SFC_GET_CUE](#sfc_get_cue) | Get cue marker info. | -| [SFC_SET_CUE](#sfc_set_cue) | Set cue marker info. | -| [SFC_RF64_AUTO_DOWNGRADE](#sfc_rf64_auto_downgrade) | Set auto downgrade from RF64 to WAV. | -| [SFC_GET_ORIGINAL_SAMPLERATE](#sfc_get_original_samplerate) | Get original samplerate metadata. | -| [SFC_SET_ORIGINAL_SAMPLERATE](#sfc_set_original_samplerate) | Set original samplerate metadata. | -| [SFC_GET_BITRATE_MODE](#sfc_get_bitrate_mode) | Get bitrate mode. | -| [SFC_SET_BITRATE_MODE](#sfc_set_bitrate_mode) | Set bitrate mode. | - ---- - -## 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 buffer - -### Examples - -```c -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 internal per-file operation log. - -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 buffer - -Example: - -```c -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_GET_CURRENT_SF_INFO - -Retrieve `SF_INFO` struct of opened file. - -`SFC_GET_CURRENT_SF_INFO` command copies `SF_INFO` struct of `sndfile` object to -provided buffer. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_GET_CURRENT_SF_INFO - -data -: A pointer to a valid SF_INFO* pointer - -datasize -: sizeof (SF_INFO) - -### Examples - -```c -SF_INFO sfinfo ; -sf_command (sndfile, SFC_GET_CURRENT_SF_INFO, sfinfo, sizeof (SF_INFO)) ; -``` - -### Return value - -Zero on success, non-zero otherwise. - -## 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) - -### Examples - -```c -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) - -### Examples - -```c -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 - -### Examples - -```c -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 - -### Examples - -```c -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) - -### Examples - -```c -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 - -```c -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: - -```c -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. - -### Examples - -```c -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: - -```c -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. - -### Examples - -```c -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 - -### Examples - -```c -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: - -```c -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: - -```c -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_INT_FLOAT_WRITE - -data -: NULL - -datasize -: TRUE or FALSE - -### Examples - -```c -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) - -### Examples - -```c -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: - -```c -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). - -### Examples - -```c -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 \ as: - -```c -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. - -### Examples - -```c -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) - -### Examples - -```c -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) - -### Examples - -```c -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) - -### Examples - -```c -int count ; -sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ; -``` - -### Return value - -Returns zero. - -## 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) - -### Examples - -Example 1: Retrieve all sybtypes supported by the WAV format. - -```c -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. - -```c -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. - -### Examples - -```c -/* 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()**](api.md#file-close-function). - -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. - -### Examples - -```c -/* Update the header now. */ -sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ; -``` - -### Return value - -Returns zero. - -## 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\*](api.md#write) functions. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_UPDATE_HEADER_AUTO - -data -: Not used (should be NULL) - -datasize -: `SF_TRUE` or `SF_FALSE` - -### Examples - -```c -/* 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. - -### Examples - -```c -/* 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`. - -### Examples - -```c -/* 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. - -### Examples - -```c -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. - -### Examples - -```c -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_EMBED_FILE_INFO - -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: - -```c -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: -. - -### Return value - -`SF_AMBISONIC_NONE(0x40)` or `SF_AMBISONIC_B_FORMAT(0x41)` 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(0x41)`) or off (`SF_AMBISONIC_NONE(0x40)`) -encoding. This command is currently only supported for files with -`SF_FORMAT_WAVEX` format. - -The Ambisonic WAVEX formats are defined here: - -. - -### 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. -It has no effect on un-compressed file formats. - -### 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_OGG_PAGE_LATENCY_MS - -Set page latency for Ogg Opus file in milliseconds. The value should be between -50.0 and 1600.0. This command is only implemented for Ogg Opus files. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_OGG_PAGE_LATENCY_MS - -data -: A pointer to a double value - -datasize -: sizeof (double) - -### Return value - -0 on success and non-zero otherwise. - -## SFC_GET_OGG_STREAM_SERIALNO - -Get the Ogg stream serial number for files with the Ogg major format. Ogg -stream serail numbers are a randomly chosen 32-bit value, used for -differentiating logical Ogg streams. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_OGG_STREAM_SERIALNO - -data -: A pointer to a 32-bit int value - -datasize -: sizeof (int32_t) = 4 - -### Return value - -0 on success and non-zero 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. It has no effect on -uncompressed file formats. - -### 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_DATA_NEEDS_ENDSWAP - -Determine if raw data read using [sf_read_raw()](api.md#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_DATA_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: - -```c -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_CHANNEL_MAP_INFO - -Retrieve the channel map contained in an AIFF or CAF Channel Layout chunk. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_GET_CHANNEL_MAP_INFO - -data -: a pointer to an array of int, the same size as the number of channels in the -file - -datasize -: number of channels * sizeof (int) - -Channel map positions are defined in an enum in *sndfile.h*: - -| Name | Value | Description | -|:-------------------------------------|:------|:------------------------------------------------------------------| -| SF_CHANNEL_MAP_INVALID | 0 | | -| SF_CHANNEL_MAP_MONO | 1 | | -| SF_CHANNEL_MAP_LEFT | 2 | Apple calls this 'Left' | -| SF_CHANNEL_MAP_RIGHT | 3 | Apple calls this 'Right' | -| SF_CHANNEL_MAP_CENTER | 4 | Apple calls this 'Center' | -| SF_CHANNEL_MAP_FRONT_LEFT | 5 | | -| SF_CHANNEL_MAP_FRONT_RIGHT | 6 | | -| SF_CHANNEL_MAP_FRONT_CENTER | 7 | | -| SF_CHANNEL_MAP_REAR_CENTER | 8 | Apple calls this 'Center Surround', Msft calls this 'Back Center' | -| SF_CHANNEL_MAP_REAR_LEFT | 9 | Apple calls this 'Left Surround', Msft calls this 'Back Left' | -| SF_CHANNEL_MAP_REAR_RIGHT | 10 | Apple calls this 'Right Surround', Msft calls this 'Back Right' | -| SF_CHANNEL_MAP_LFE | 11 | Apple calls this 'LFEScreen', Msft calls this 'Low Frequency' | -| SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER | 12 | Apple calls this 'Left Center' | -| SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER | 13 | Apple calls this 'Right Center' | -| SF_CHANNEL_MAP_SIDE_LEFT | 14 | Apple calls this 'Left Surround Direct' | -| SF_CHANNEL_MAP_SIDE_RIGHT | 15 | Apple calls this 'Right Surround Direct' | -| SF_CHANNEL_MAP_TOP_CENTER | 16 | Apple calls this 'Top Center Surround' | -| SF_CHANNEL_MAP_TOP_FRONT_LEFT | 17 | Apple calls this 'Vertical Height Left' | -| SF_CHANNEL_MAP_TOP_FRONT_RIGHT | 18 | Apple calls this 'Vertical Height Right' | -| SF_CHANNEL_MAP_TOP_FRONT_CENTER | 19 | Apple calls this 'Vertical Height Center' | -| SF_CHANNEL_MAP_TOP_REAR_LEFT | 20 | Apple and MS call this 'Top Back Left' | -| SF_CHANNEL_MAP_TOP_REAR_RIGHT | 21 | Apple and MS call this 'Top Back Right' | -| SF_CHANNEL_MAP_TOP_REAR_CENTER | 22 | Apple and MS call this 'Top Back Center' | -| SF_CHANNEL_MAP_AMBISONIC_B_W | 23 | | -| SF_CHANNEL_MAP_AMBISONIC_B_X | 24 | | -| SF_CHANNEL_MAP_AMBISONIC_B_Y | 25 | | -| SF_CHANNEL_MAP_AMBISONIC_B_Z | 26 | | -| SF_CHANNEL_MAP_MAX | 27 | | - -### Return value - -`SF_TRUE` if the file contained a Channel Layout chunk or `SF_FALSE` otherwise. - -## SFC_SET_CHANNEL_MAP_INFO - -Set the channel map contained in an AIFF or CAF Channel Layout chunk. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_CHANNEL_MAP_INFO - -data -: a pointer to an array of int, the same size as the number of channels in the -file - -datasize -: number of channels * sizeof (int) - -### Return value - -`SF_TRUE` if setting the Channel Layout 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](http://www.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: - -```c -#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_LOOP_INFO struct is defined in *sndfile.h* as: - -```c -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 ; -``` - -### Examples - -```c -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: - -```c -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 ; -``` - -`mode` values are defined as: - -| Name | Value | Description | -|:--------------------|:------|:------------| -| SF_LOOP_NONE | 800 | | -| SF_LOOP_FORWARD | 801 | | -| SF_LOOP_BACKWARD | 802 | | -| SF_LOOP_ALTERNATING | 803 | | - -### Examples - -```c -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_SET_INSTRUMENT - -data -: a pointer to an SF_INSTRUMENT struct - -datasize -: sizeof (SF_INSTRUMENT) - -### Examples - -```c -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. - -## SFC_GET_CUE_COUNT - -Retrieve the number of cue markers available for retrieval using the -[SFC_GET_CUE](#sfc_get_cue) command. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_GET_CUE_COUNT - -data -: a pointer to a uint32_t - -datasize -: sizeof (uint32_t) - -### Examples - -```c -uint32_t cue_count ; -sf_command (sndfile, SFC_GET_CUE_COUNT, &cue_count, sizeof (cue_count)) ; -``` - -### Return value - -`SF_TRUE` if the file header contains cue marker information for the file, -`SF_FALSE` otherwise. - -## SFC_GET_CUE - -Retrieve cue marker information from file. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_GET_CUE - -data -: a pointer to an SF_CUES struct - -datasize -: sizeof (SF_CUES) - -The SF_CUES struct is defined in *sndfile.h* as: - -```c -typedef struct -{ int cue_count ; - - struct - { int32_t indx ; - uint32_t position ; - int32_t fcc_chunk ; - int32_t chunk_start ; - int32_t block_start ; - uint32_t sample_offset ; - char name [256] ; - } cue_points [100] ; -} SF_CUES ; -``` - -There is also an SF_CUES_VAR \#define that allows reading/writing more than 100 -cue markers. - -### Examples - -```c -SF_CUES cues ; -sf_command (sndfile, SFC_GET_CUE, &cues, sizeof (cues)) ; -``` - -### Return value - -`SF_TRUE` if the file header contains cue marker information for the file, -`SF_FALSE` otherwise. - -## SFC_SET_CUE - -Set the cue marker information for the file. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_CUE - -data -: a pointer to an SF_CUES struct - -datasize -: sizeof (SF_CUES) - -### Examples - -```c -SF_CUES cues ; -sf_command (sndfile, SFC_SET_CUE, &cues, sizeof (cues)) ; -``` - -### Return value - -`SF_TRUE` if the file header contains cue marker information for the file, -`SF_FALSE` otherwise. - -## SFC_RF64_AUTO_DOWNGRADE - -Enable auto downgrade from RF64 to WAV. - -The EBU recomendation is that when writing RF64 files and the resulting file is -less than 4Gig in size, it should be downgraded to a WAV file (WAV files have a -maximum size of 4Gig). libsndfile doesn't follow the EBU recommendations -exactly, mainly because the test suite needs to be able test reading/writing -RF64 files without having to generate files larger than 4 gigabytes. - -Note: This command should be issued before the first bit of audio data has been -written to the file. Calling this command after audio data has been written will -return the current value of this setting, but will not allow it to be changed. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_RF64_AUTO_DOWNGRADE - -data -: NULL - -datasize -: SF_TRUE or SF_FALSE - -### Examples - -```c -/* Enable auto downgrade on file close. */ -sf_command (sndfile, SFC_RF64_AUTO_DOWNGRADE, NULL, SF_TRUE) ; -``` - -### Return value - -Returns `SF_TRUE` if `SFC_RF64_AUTO_DOWNGRADE` is set and `SF_FALSE` otherwise. - -## SFC_GET_ORIGINAL_SAMPLERATE - -Get original samplerate metadata. - -The Opus audio codec stores audio data independent of samplerate, but only -supports encoding or decoding at 8000Hz, 12000Hz, 16000Hz, 24000Hz or 48000Hz. -Opus includes a header field to record the original source input samplerate, and -a samplerate converter may be used if needed. - -This command gets the original samplerate header field. It does not enable any -(non-existent) samplerate conversion, nor change the current decoder samplerate. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_GET_ORIGINAL_SAMPLERATE - -data -: pointer to an integer - -datasize -: sizeof (int) - -### Examples - -```c -/* Get the original sample rate */ -int original_samplerate ; -sf_command (sndfile, SFC_GET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) ; -``` - -### Return value - -Returns `SF_TRUE` on success, `SF_FALSE` otherwise. - -The passed integer is set to the value of the original samplerate. - -## SFC_SET_ORIGINAL_SAMPLERATE - -Set original samplerate metadata. - -The Opus audio codec stores audio data independent of samplerate, but only -supports encoding or decoding at 8000Hz, 12000Hz, 16000Hz, 24000Hz or 48000Hz. -Opus includes a header field to record the original source input samplerate, and -a samplerate converter may be used if needed. - -When writing an Opus file this command sets the original samplerate header field -to the provided value, which is then stored in the file. This has no effect on -the current encoder samplerate. - -When reading an Opus file this command overrides the original samplerate value -as read from the file. libsndfile uses this value to choose what samplerate to -decode at, rounding up to the nearest valid Opus samplerate. After a successful -call, the file samplerate and frames count may have changed. - -Note: This command should be issued before the first bit of audio data has been -read from or written to the file. - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_ORIGINAL_SAMPLERATE - -data -: pointer to an integer - -datasize -: sizeof (int) - -### Examples - -```c -/* Store the original sample rate as 44100 */ -int original_samplerate 44100; -sf_command (sndfile, SFC_SET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (input_samplerate)) ; -``` - -### Return value - -Returns SF_TRUE on success, SF_FALSE otherwise. - -On write, can only succeed if no data has been written. On read, if successful, -[SFC_GET_CURRENT_SF_INFO](#sfc_get_current_sf_info) should be called to -determine the new frames count and samplerate - -## SFC_GET_BITRATE_MODE - -Get bitrate mode. - -The bitrate mode is one of: - -| Name | Value | Description | -|:-------------------------|:------|:------------------| -| SF_BITRATE_MODE_CONSTANT | 800 | Constant bitrate. | -| SF_BITRATE_MODE_AVERAGE | 801 | Average bitrate. | -| SF_BITRATE_MODE_VARIABLE | 802 | Variable bitrate. | - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_GET_BITRATE_MODE - -data -: NULL - -datasize -: anything - -### Return value - -Returns one of `SF_BITRATE_MODE_XXX` on success, `-1` otherwise. - -## SFC_SET_BITRATE_MODE - -Set bitrate mode. - -The bitrate mode is one of: - -| Name | Value | Description | -|:-------------------------|:------|:------------------| -| SF_BITRATE_MODE_CONSTANT | 800 | Constant bitrate. | -| SF_BITRATE_MODE_AVERAGE | 801 | Average bitrate. | -| SF_BITRATE_MODE_VARIABLE | 802 | Variable bitrate. | - -### Parameters - -sndfile -: A valid SNDFILE* pointer - -cmd -: SFC_SET_BITRATE_MODE - -data -: pointer to an integer - -datasize -: sizeof (int) - -### Return value - -Returns `SF_TRUE` on success, `SF_FALSE` otherwise. diff --git a/externals/libsndfile/share/doc/libsndfile/embedded_files.md b/externals/libsndfile/share/doc/libsndfile/embedded_files.md deleted file mode 100644 index e55f2ed..0000000 --- a/externals/libsndfile/share/doc/libsndfile/embedded_files.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: page ---- - -# 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/externals/libsndfile/share/doc/libsndfile/formats.md b/externals/libsndfile/share/doc/libsndfile/formats.md deleted file mode 100644 index 1d96737..0000000 --- a/externals/libsndfile/share/doc/libsndfile/formats.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -layout: page -title: libsndfile: Supported formats ---- - -# libsndfile : Supported formats - -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. - -{:.formats-table} -| | Microsoft WAV | SGI / Apple AIFF / AIFC |Sun / DEC / NeXT AU / SND | Headerless RAW | Paris Audio File PAF | Commodore Amiga IFF / SVX | Sphere Nist WAV | IRCAM SF | Creative VOC | Soundforge 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 PCM | R/W | R/W | | R/W | | | | | R/W | R/W | | R/W | | | | | | | -| Signed 8 bit PCM | | R/W | R/W | R/W | R/W | R/W | R/W | | | | | | R/W | | | R/W | R/W | R/W | -| Signed 16 bit PCM | R/W | R/W | R/W | R/W | R/W | R/W | R/W | R/W | R/W | R/W | R/W | R/W | R/W | | R/W | R/W | R/W | R/W | -| Signed 24 bit PCM | R/W | R/W | R/W | R/W | R/W | | R/W | | | R/W | | | | | | R/W | R/W | R/W | -| Signed 32 bit PCM | R/W | R/W | R/W | R/W | | | R/W | R/W | | R/W | R/W | R/W | R/W | | | R/W | | | -| 32 bit float | R/W | R/W | R/W | R/W | | | | R/W | | R/W | R/W | R/W | | | | R/W | | | -| 64 bit double | R/W | R/W | R/W | R/W | | | | | | R/W | R/W | R/W | | | | R/W | | | -| u-law encoding | R/W | R/W | R/W | R/W | | | R/W | R/W | R/W | R/W | | | | | | R/W | | | -| A-law encoding | R/W | R/W | R/W | R/W | | | R/W | R/W | R/W | R/W | | | | | | R/W | | | -| IMA ADPCM | R/W | | | | | | | | | R/W | | | | | | | | | -| MS ADPCM | R/W | | | | | | | | | R/W | | | | | | | | | -| GSM 6.10 | R/W | R/W | | R/W | | | | | | R/W | | | | | | | | | -| G721 ADPCM 32kbps | R/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](https://xiph.org/flac/) and [Ogg/Vorbis](https://xiph.org/vorbis/). - -From version 1.0.29, libsndfile can read and write -[Ogg/Opus](https://opus-codec.org/). - -From version 1.1.0, libsndfile can read and write MP3. - -Some of the file formats I am also interested in adding are: - -- Kurzweil K2000 sampler files. -- Ogg Speex. - -Other file formats may also be added on request. - -If you are interested in how to add a new format to a libsndfile, you may find -this [FAQ](new_file_type_howto.md) helpful. diff --git a/externals/libsndfile/share/doc/libsndfile/index.md b/externals/libsndfile/share/doc/libsndfile/index.md deleted file mode 100644 index b666335..0000000 --- a/externals/libsndfile/share/doc/libsndfile/index.md +++ /dev/null @@ -1,318 +0,0 @@ ---- -layout: home -title: The libsndfile Home Page ---- - -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](http://www.gnu.org/copyleft/lesser.html). - -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 -* Microsoft Windows - -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](formats.html). -* 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. - -## 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](http://www.vaxxine.com/ve3wwg/gnuwave.html) 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. -* Version 1.0.26 (November 22 2015) Fix for CVE-2014-9496, CVE-2014-9756 and - CVE-2015-7805. Add ALAC/CAF support. Minor bug fixes and improvements. -* Version 1.0.27 (June 19 2016) Fix a seek regression in 1.0.26. Add metadata - read/write for CAF and RF64. FIx PAF endian-ness issue. -* Version 1.0.28 (April 2 2017) Fix buffer overruns in FLAC and ID3 handling - code. Reduce default header memory requirements. Fix detection of Large File - Support for 32 bit systems. -* Version 1.0.29 (August 15 2020) Opus support, build system improvements and - bug fixes. -* Version 1.0.30 (September 19 2020) Bugfix release. Fix file descriptor leaks - in sf_open_fd () function. Fix critical CMake bug leading to broken ABI on - Linux platforms. Other numerous fixes to CMake build system, consider it - stable now. Fix some memory leaks. Fix handling of some SD2 files. Update - documentation. Integrate GitHub Actions for faster test builds and Oss-Fuzz - for fuzzing tests. Move sndfile.h.in from src/ to include/ directory. To avoid - problems, delete old generated sndfile.h from $(top_builddir)/src. -* Version 1.0.31 (January 24 2021) Bugfix release. Fix multiple memory leaks - reported by OSS-Fuzz. More SSE2-optimized functions for x86 and amd64. -* Version 1.1.0 (March 27 2022) Minor release, backward compatible with previous - releases. Added long-awaited MP3 support. Numerous improvements and bugfixes. - -## Similar or Related Projects - -* [SoX](http://sox.sourceforge.net/) is a program for converting between sound - file formats. -* [Wavplay](http://www.hitsquad.com/smm/programs/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](http://www.68k.org/~michael/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](ftp://ccrma-ftp.stanford.edu/pub/Lisp/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](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) -and -[version 3](http://www.gnu.org/copyleft/lesser.html). -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](http://www.gnu.org/copyleft/lesser.html). - -You can use libsndfile with -[Free Software](http://www.gnu.org/), -[Open Source](http://www.opensource.org/), -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](http://www.gnu.org/) -or -[Open Source](http://www.opensource.org/). -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](http://www.gnu.org/copyleft/lesser.html). - -## Download - -Check latest version on -[GitHub Releases page](https://github.com/libsndfile/libsndfile/releases/). - -Binaries and source packages are signed by current releaser David Seifert aka -@SoapGentoo. You can verify signatures with his public GPG key: - -``` ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v2 - -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 -=K3x+ ------END PGP PUBLIC KEY BLOCK----- -``` - -## See Also - -* [sndfile-tools](https://github.com/libsndfile/sndfile-tools): a small -collection of programs which use libsndfile. diff --git a/externals/libsndfile/share/doc/libsndfile/libsndfile.css b/externals/libsndfile/share/doc/libsndfile/libsndfile.css deleted file mode 100644 index 3386bc3..0000000 --- a/externals/libsndfile/share/doc/libsndfile/libsndfile.css +++ /dev/null @@ -1,101 +0,0 @@ -body { - background : black ; - color : white ; - font-family : arial, helvetica, sans-serif ; - line-height: 1.5 ; - margin-left: 6%; - margin-right: 6%; -} -td { - font-family : arial, helvetica, sans-serif ; - background : black ; - color : white ; -} -center { - font-family : arial, helvetica, sans-serif ; -} -p { - font-family : arial, helvetica, sans-serif ; - text-align : left ; -} -.indent_block { - font-family : arial, helvetica, sans-serif ; - text-align : left ; -} -br { - font-family : arial, helvetica, sans-serif ; -} -form { - font-family : arial, helvetica, sans-serif ; -} -ul { - font-family : arial, helvetica, sans-serif ; - text-align : left ; -} -ol { - font-family : arial, helvetica, sans-serif ; - text-align : left ; -} -dl { - font-family : arial, helvetica, sans-serif ; - text-align : left ; -} -h1 { - font-size : xx-large ; - background : black ; - color : #5050FF ; - text-align : left ; -} -h2 { - font-size : x-large ; - background : black ; - color : #5050FF ; - text-align : left ; -} -h3 { - font-size : large ; - background : black ; - color : #5050FF ; - text-align : left ; -} -h4 { - font-size : medium ; - background : black ; - color : #5050FF ; - text-align : left ; -} -pre { - font-family : courier, monospace ; - font-size : medium ; -} -code, -kbd, -samp, -var { - font-family: "Courier New", monospace, serif; - font-size: 1em; -} -a:link { color : #9090FF ; } -a:visited { color : #5050FF ; } -a:active { color : #FF00FF ; } -a:hover { background-color : #202080 ; } - -table.formats-table { - text-align: center; - font-size: small; - border-collapse: collapse; -} - -table.formats-table, table.formats-table th, table.formats-table td { - border: 1px solid white; -} - -.image-logo { - display: block; - margin-left: auto; - margin-right: auto; -} - -nav { - text-align: center; -} diff --git a/externals/libsndfile/share/doc/libsndfile/libsndfile.jpg b/externals/libsndfile/share/doc/libsndfile/libsndfile.jpg deleted file mode 100644 index 7855b92..0000000 Binary files a/externals/libsndfile/share/doc/libsndfile/libsndfile.jpg and /dev/null differ diff --git a/externals/libsndfile/share/doc/libsndfile/lists.md b/externals/libsndfile/share/doc/libsndfile/lists.md deleted file mode 100644 index 31a0962..0000000 --- a/externals/libsndfile/share/doc/libsndfile/lists.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -layout: page -title: libsndfile Mailing Lists ---- - -# libsndfile Mailing Lists - -**Note**: These mailing lists are not maintained by the libsndfile team anymore. -Use [GitHub issues and pull requests instead](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests). - -There are three mailing lists for libsndfile: - - - **libsndfile-announce@mega-nerd.com**   - [Subscribe](mailto:libsndfile-announce-request@mega-nerd.com?subject=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](mailto:libsndfile-devel-request@mega-nerd.com?subject=subscribe) - A list for discussing bugs, porting issues and feature requests. - Posting is restricted to subscribers. -- **libsndfile-users@mega-nerd.com**   - [Subscribe](mailto:libsndfile-users-request@mega-nerd.com?subject=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/externals/libsndfile/share/doc/libsndfile/new_file_type_howto.md b/externals/libsndfile/share/doc/libsndfile/new_file_type_howto.md deleted file mode 100644 index bb42208..0000000 --- a/externals/libsndfile/share/doc/libsndfile/new_file_type_howto.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -layout: page ---- - -# How to add new file format - - 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: . - -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 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 ; - -## Step 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/externals/libsndfile/share/doc/libsndfile/octave.md b/externals/libsndfile/share/doc/libsndfile/octave.md deleted file mode 100644 index f619ca6..0000000 --- a/externals/libsndfile/share/doc/libsndfile/octave.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: page ---- - -# libsndfile and GNU Octave - -[GNU Octave](http://www.octave.org/) 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](http://www.mathworks.com/). 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](http://www.metadecks.org/software/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](http://octave.sourceforge.net/audio/index.html). diff --git a/externals/libsndfile/share/doc/libsndfile/print.css b/externals/libsndfile/share/doc/libsndfile/print.css deleted file mode 100644 index deb5b13..0000000 --- a/externals/libsndfile/share/doc/libsndfile/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/externals/libsndfile/share/doc/libsndfile/sndfile_info.md b/externals/libsndfile/share/doc/libsndfile/sndfile_info.md deleted file mode 100644 index 78d3548..0000000 --- a/externals/libsndfile/share/doc/libsndfile/sndfile_info.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -layout: page -title: 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/externals/libsndfile/share/doc/libsndfile/tutorial.md b/externals/libsndfile/share/doc/libsndfile/tutorial.md deleted file mode 100644 index 848c175..0000000 --- a/externals/libsndfile/share/doc/libsndfile/tutorial.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: page ---- - -# 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/externals/libsndfile/share/doc/libsndfile/win32.md b/externals/libsndfile/share/doc/libsndfile/win32.md deleted file mode 100644 index 6106517..0000000 --- a/externals/libsndfile/share/doc/libsndfile/win32.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -layout: page ---- - -# Building libsndfile on Win32 - -**Note : For pre-compiled binaries for windows, both for win32 and win64, see -the main web page.** - -There are currently two build systems; the official GNU autotool based one and -a more limited and experimental CMake based build system. - -libsndfile is written to be compiled by a compiler which supports large chunks -of the 1999 ISO C Standard (tested with GCC, Clang and Visual Studio 2015). - -It is recommended to use CMake and Visual Studio to build libsndfile on Windows -but you can try the [MinGW](http://www.mingw.org/) compiler suite with Autotools -or CMake buildsystem. diff --git a/install-to-BlueShift.bat b/install-to-BlueShift.bat index 4080763..19c0d66 100644 --- a/install-to-BlueShift.bat +++ b/install-to-BlueShift.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y diff --git a/install-to-CSCZDeletedScenes.bat b/install-to-CSCZDeletedScenes.bat index 46f5369..43c5c2b 100644 --- a/install-to-CSCZDeletedScenes.bat +++ b/install-to-CSCZDeletedScenes.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y diff --git a/install-to-ConditionZero.bat b/install-to-ConditionZero.bat index 693c7f1..0c4910a 100644 --- a/install-to-ConditionZero.bat +++ b/install-to-ConditionZero.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y diff --git a/install-to-CounterStrike.bat b/install-to-CounterStrike.bat index ce9d86e..83da311 100644 --- a/install-to-CounterStrike.bat +++ b/install-to-CounterStrike.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y diff --git a/install-to-DayOfDefeat.bat b/install-to-DayOfDefeat.bat index 45cf9fd..d41ac53 100644 --- a/install-to-DayOfDefeat.bat +++ b/install-to-DayOfDefeat.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y diff --git a/install-to-HalfLife.bat b/install-to-HalfLife.bat index adc0494..e948739 100644 --- a/install-to-HalfLife.bat +++ b/install-to-HalfLife.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y diff --git a/install-to-OpposingForce.bat b/install-to-OpposingForce.bat index 505b2a1..469c485 100644 --- a/install-to-OpposingForce.bat +++ b/install-to-OpposingForce.bat @@ -1,6 +1,6 @@ echo off -if not exist "%~dp0build\externals\metahook\Release\metahook.exe" goto fail_nobuild +if not exist "%~dp0build\Release\metahook.exe" goto fail_nobuild if not exist "%~dp0build\Release\MetaAudio.dll" goto fail_nobuild set LauncherExe=metahook.exe @@ -14,7 +14,7 @@ echo ----------------------------------------------------- echo Copying files... -if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\externals\metahook\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y +if not exist "%GameDir%\%LauncherExe%" copy "%~dp0build\Release\metahook.exe" "%GameDir%\%LauncherExe%" /y copy "%~dp0externals\libsndfile\bin\sndfile.dll" "%GameDir%\" /y md "%GameDir%\%LauncherMod%\metahook\plugins" copy "%~dp0build\Release\MetaAudio.dll" "%GameDir%\%LauncherMod%\metahook\plugins" /y