New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using OpusAudioDecoder to decode a single file in Electron #63
Comments
I've never tried running this library in Electron, but I think it should work fine, since Electron is just a browser under the hood. Could you post the full stack traces so I can see where in the decoders those errors are being thrown? Also, do you have a repo I can clone down so I can reproduce the error? I might have to experiment with some solutions on this. I have a couple things you can try in the meantime: Could you try setting I recently made a change in how the web workers are implemented in this library. Could you try ogg-opus-decoder/1.4.4 and see if version also has the errors? |
Hello,
Here's the stack from version 1.5.0.
C:\Users\ogome\code\leveltool\stest\peli.opus: TypeError: Cannot read
properties of null (reading 'decodeFrames')
at DecoderState._sendToDecoder (OggOpusDecoder.js:38:1)
at DecoderState._decode (
Version 1.4.4 fails with the same stack trace.
Yes, you can find a repo here. And thanks much for looking into this!
Just do yarn && yarn dev
This has some additional stuff but what you want is in
src/lib/sound/decoders/. Main.ts expects a file in
__dirname/peli.opus.
https://github.com/ogomez92/rhythm_rage_level_helper_tool
Thanks.
…On 12/18/22, Ethan Halsall ***@***.***> wrote:
I've never tried running this library in Electron, but I think it should
work fine, since Electron is just a browser under the hood.
Could you post the full stack traces so I can see where in the decoders
those errors are being thrown? Also, do you have a repo I can clone down so
I can reproduce the error? I might have to experiment with some solutions on
this.
I have a couple things you can try in the meantime:
Could you try setting `nodeIntegrationInWorker: true` to `false`? This might
be causing an issue with how ogg-opus-decoder detects if it's running in a
browser or NodeJS.
I recently made a change in how the web workers are implemented in this
library. Could you try ogg-opus-decoder/1.4.4 and see if version also has
the errors?
--
Reply to this email directly or view it on GitHub:
#63 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
also, changing nodeIntegrationInWorker didn't change the behaviour.
…On 12/18/22, Oriol Gómez ***@***.***> wrote:
Hello,
Here's the stack from version 1.5.0.
C:\Users\ogome\code\leveltool\stest\peli.opus: TypeError: Cannot read
properties of null (reading 'decodeFrames')
at DecoderState._sendToDecoder (OggOpusDecoder.js:38:1)
at DecoderState._decode (
Version 1.4.4 fails with the same stack trace.
Yes, you can find a repo here. And thanks much for looking into this!
Just do yarn && yarn dev
This has some additional stuff but what you want is in
src/lib/sound/decoders/. Main.ts expects a file in
__dirname/peli.opus.
https://github.com/ogomez92/rhythm_rage_level_helper_tool
Thanks.
On 12/18/22, Ethan Halsall ***@***.***> wrote:
> I've never tried running this library in Electron, but I think it should
> work fine, since Electron is just a browser under the hood.
>
> Could you post the full stack traces so I can see where in the decoders
> those errors are being thrown? Also, do you have a repo I can clone down
> so
> I can reproduce the error? I might have to experiment with some solutions
> on
> this.
>
> I have a couple things you can try in the meantime:
>
> Could you try setting `nodeIntegrationInWorker: true` to `false`? This
> might
> be causing an issue with how ogg-opus-decoder detects if it's running in
> a
> browser or NodeJS.
>
> I recently made a change in how the web workers are implemented in this
> library. Could you try ogg-opus-decoder/1.4.4 and see if version also has
> the errors?
>
> --
> Reply to this email directly or view it on GitHub:
> #63 (comment)
> You are receiving this because you authored the thread.
>
> Message ID: ***@***.***>
|
Thanks for that additional info. I think I found the problem and will be releasing a fix here soon. |
Go ahead and try out |
Thanks, I'll check it out. Just curious, was the issue web worker
specific or is it because of the Electron environment? I'm guessing
Electron has some weird processing with webworkers? I don't have much
experience with WASM other than using it in js.
Thanks!
…On 12/18/22, Ethan Halsall ***@***.***> wrote:
Go ahead and try out `ogg-opus-decoder/1.5.1`. I was able to get it working
with your repo locally. I've also bumped the other decoders, and that should
resolve the problem with the worker on those as well. Let me know if it
works for you!
--
Reply to this email directly or view it on GitHub:
#63 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
I think the issue was probably in your build pipeline. I am using a This conditional on line 4 below fixes the problem by extending wasm-audio-decoders/src/common/src/WASMAudioDecoderWorker.js Lines 1 to 6 in 598abd1
There might be a configuration option in the bundling tool your using, webpack I think, that fixes this too, but it seems like a common problem. Fixing this here should make this library simpler to use. |
Environment: Electron 17.0.1, renderer process, with nodeIntegrationInWorker: true
I have found an issue trying to decode an Opus file using OggOpusDecoderWebWorker.
I am getting the error as follows:
I only need to decode a single file, so I am sing await (I know it is a bad idea, I have read the best practices guide in the docs).
Curiously OggOpusDecoder (without the web worker) works fine.
I am running into a similar issue with the mpeg decoder web worker (works without the worker), saying that URL scheme must be of type file, but I can open another issue if needed, maybe it's something in Electron's part or I am doing something wrong so I think one issue will suffice for now?
Thanks for your assistance.
The text was updated successfully, but these errors were encountered: