Opusfile and Opusurl

repository·main·Indexed 41 days ago

https://github.com/xiph/opusfile

High-level C libraries for decoding and seeking within Opus audio files. Opusfile handles files on local filesystems, while Opusurl extends this functionality to files accessed via HTTP(S). Dependencies include libopus, libogg, and openssl.

Tokens
691
Snippets
1
Records
4
Agent score
2%

What's inside Opusfile

  1. Overview of Opusfile and Opusurl

    main

    The opusfile and opusurl libraries provide high-level APIs for working with Opus files.

    • opusfile: Used for decoding and seeking within .opus files stored on local disk.
    • opusurl: Extends functionality to allow decoding and seeking within Opus files served over HTTP(S).
  2. Dependencies for Opusfile and Opusurl

    main

    To use these libraries, you must ensure the following dependencies are available in your environment:

    • opusfile requires libopus and libogg.
    • opusurl requires opusfile and openssl.
  3. Build the opusfile release package for Windows

    main

    To create a binary release package for Windows, you can run make package. The manual process involves:

    1. Compile dynamic opusfile:
      • Run ./configure --host=i686-w64-mingw32 --prefix=/path/to/builddir/mingw PKG_CONFIG_PATH=/path/to/builddir/mingw/lib/pkgconfig.
      • Run make && make check && make -C doc/latex.
      • Note: If Doxygen fails due to unescaped '#' characters in URLs, use Doxygen 1.8.15 or 1.8.3.
    2. Prepare Release Directory: Create a directory named opusfile-${version}-win32.
    3. Copy Files:
      • Copy AUTHORS, COPYING, README.md (converted to DOS line endings), and include/opusfile.h (place opusfile.h directly in the release dir, not in an include/ subfolder).
      • Copy .libs/libopusfile-0.dll and .libs/libopusfile.a to the release dir.
      • Copy .libs/libopusurl-0.dll and .libs/libopusurl.a to the release dir.
      • Copy mingw/bin/*.dll and any other required dependency DLLs (e.g., libgcc_s_dw2-1.dll, libwinpthread-1.dll) to the release dir.
      • Copy doc/latex/refman.pdf to opusfile-${version}-win32/opusfile-${version}.pdf.
      • Copy examples/.libs/*.exe to the release dir.
    4. Finalize:
      • Run i686-w64-ming32-strip *.dll *.a *.exe in the release dir.
      • Generate checksums: sha256sum * > SHA256SUMS.txt.
      • Sign checksums: gpg --detach-sign --armor SHA256SUMS.txt.
      • Create the archive: zip -r opusfile-${version}-win32.zip opusfile-${version}-win32/* in the parent directory.
  4. Cross-compile opusfile using mingw

    main

    To cross-compile opusfile for Windows using mingw, you must first build its dependencies: libogg, libopus, and openssl. If you need to run make check during the process, you may need wine installed.

    Build OpenSSL

    Use the following command to build OpenSSL for mingw:

    CROSS_COMPILE="i686-w64-mingw32-" ./Configure mingw no-asm no-shared --prefix=$PWD/mingw && make depend && make -j8 && make install

    Build opusfile

    Once dependencies are ready, build opusfile using the following command:

    CC=i686-w64-mingw32-gcc PKG_CONFIG_PATH=$PWD/lib/pkgconfig RANLIB=i686-w64-mingw32-ranlib make -f ../unix/Makefile
    CC=i686-w64-mingw32-gcc PKG_CONFIG_PATH=$PWD/lib/pkgconfig RANLIB=i686-w64-mingw32-ranlib make -f ../unix/Makefile