diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2025-03-04 22:45:19 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2025-03-04 22:45:19 -0300 |
commit | 79ff3692b9462fc79d93bd74213ce6904340fc13 (patch) | |
tree | 22055c038783b87cceffe3d2220cc2b568a4493d /opus |
First public commit
Diffstat (limited to 'opus')
-rw-r--r-- | opus/.gitignore | 2 | ||||
-rwxr-xr-x | opus/build_script.sh | 29 | ||||
-rwxr-xr-x | opus/get_opus.sh | 4 |
3 files changed, 35 insertions, 0 deletions
diff --git a/opus/.gitignore b/opus/.gitignore new file mode 100644 index 0000000..edb557c --- /dev/null +++ b/opus/.gitignore @@ -0,0 +1,2 @@ +/opus-* +/libs diff --git a/opus/build_script.sh b/opus/build_script.sh new file mode 100755 index 0000000..cb2e0ef --- /dev/null +++ b/opus/build_script.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +cd opus-1.5.2 + +s_EXPORTED_FUNCTIONS="-s EXPORTED_FUNCTIONS=$(printf '_%s,' \ +opus_decoder_create \ +opus_strerror \ +opus_decode_float \ +malloc +)_free" + +#shared_flags="-O1 -fno-unroll-loops -fno-inline -flto -mnontrapping-fptoint" +shared_flags="-Oz -flto -fno-inline -mnontrapping-fptoint" +compile_flags="-DNDEBUG -DNO_STDIO $shared_flags" +link_flags="$shared_flags -s MALLOC=emmalloc -s ASSERTIONS=0 -s INITIAL_MEMORY=196608 -s TOTAL_STACK=48736 -s STANDALONE_WASM=1 -s PURE_WASI=1 -s STACK_OVERFLOW_CHECK=0 -s WASM_BIGINT=1 -s ABORTING_MALLOC=0 -s MEMORY_GROWTH_GEOMETRIC_STEP=0 -s ALLOW_MEMORY_GROWTH=1" + +emconfigure ./configure STRIP='emstrip' CFLAGS="$compile_flags" LDFLAGS="$link_flags" --host=wasm32 --disable-dependency-tracking --disable-shared +emmake make + +#emcc --no-entry $s_EXPORTED_FUNCTIONS $link_flags libmp3lame/.libs/libmp3lame.a +#em++ --no-entry $s_EXPORTED_FUNCTIONS $link_flags $compile_flags -o pocketfft.wasm impl.cc + +#mkdir -p ../../src/main/resources/opus/ +#cp a.out.wasm ../../src/main/resources/opus.wasm +#cp LICENSE COPYING ../../src/main/resources/opus/ + +exit 0 diff --git a/opus/get_opus.sh b/opus/get_opus.sh new file mode 100755 index 0000000..a7fd7e0 --- /dev/null +++ b/opus/get_opus.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +wget https://downloads.xiph.org/releases/opus/opus-1.5.2.tar.gz +tar -xf opus-1.5.2.tar.gz |