sdroege / ebur128

Implementation of the EBU R128 loudness standard
MIT License
99 stars 16 forks source link

Add WASM/JS support via wasm-bindgen #33

Closed sdroege closed 1 year ago

sdroege commented 4 years ago

Fixes https://github.com/sdroege/ebur128/issues/32

Can be built with wasm-pack:

wasm-pack build --target web -- --features wasm

Example using this can be found here: https://coaxion.net/~slomo/ebur128-wasm/

TODO

sdroege commented 4 years ago

Currently kind-of blocked by https://github.com/rustwasm/wasm-pack/issues/886

Workaround for now would be

diff --git a/Cargo.toml b/Cargo.toml
index bc79e90..e03ba85 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -60,6 +60,10 @@ version = "1.2.4"
 name = "ebur128"
 version = "1.2.4"

+[package.metadata.wasm-pack.profile.release]
+# See https://github.com/rustwasm/wasm-pack/issues/886
+wasm-opt = false
+
 [[bench]]
 name = "interp"
 harness = false
wong2 commented 3 years ago

is it working now?

sdroege commented 3 years ago

is it working now?

Yes, see https://coaxion.net/~slomo/ebur128-wasm/

I need to spend some time on cleaning this up and merging it though, see the TODO list in the initial commit.

wong2 commented 3 years ago

great!

sdroege commented 3 years ago

If you want to help with that, please go ahead :)