wegylexy / rnnoise_wasm

RNNoise for WASM
MIT License
50 stars 10 forks source link

use in broswer #8

Closed vishaldhull09 closed 3 years ago

vishaldhull09 commented 3 years ago

https://jmvalin.ca/demo/rnnoise/noise.js

as far as i understood , demo for browser is using this file to load Rnnoise any idea how this file is created from the saved model, as I don't want to use node.js

wegylexy commented 3 years ago

No, my demo works completely differently from theirs. Mine uses WASM instead of JS for RNNoise. To use your own model, change https://github.com/xiph/rnnoise/blob/master/src/rnn_data.c in the submodule, and then run https://github.com/wegylexy/rnnoise_wasm/blob/master/build-docker.sh to build a new WASM.

vishaldhull09 commented 3 years ago

No, my demo works completely differently from theirs. Mine uses WASM instead of JS for RNNoise. To use your own model, change https://github.com/xiph/rnnoise/blob/master/src/rnn_data.c in the submodule, and then run https://github.com/wegylexy/rnnoise_wasm/blob/master/build-docker.sh to build a new WASM.

i was trying to use it directly in browser , I got this Uncaught (in promise) TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. do I have to change anything in code or build file ?

wegylexy commented 3 years ago

Your server must specify Content-Type: application/wasm in the response header for *.wasm files.

wegylexy commented 3 years ago

To test on your local machine, you can create a simple node.js server. See https://github.com/wegylexy/rnnoise_wasm/blob/master/demo/server.mjs#L25 .

For nginx, config MIME types as follow:

    types {
        application/wasm wasm;
    }
vishaldhull09 commented 3 years ago

thanks for the help , i got this can we save and download input and denoised voice separately....or to upload a voice and get a denoised output

wegylexy commented 3 years ago

No downloading/uploading, it all runs in the browser locally. Do whatever you like.