Skip to content
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

Opus Error hadn't been handle correctly #11

Closed
emthy0 opened this issue Sep 25, 2021 · 2 comments
Closed

Opus Error hadn't been handle correctly #11

emthy0 opened this issue Sep 25, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@emthy0
Copy link

emthy0 commented Sep 25, 2021

I found these errors on @discord/opus when speaking from a web browser which the error hasn't been handle correctly, so it will crash the whole app.

events.js:292
      throw er; // Unhandled 'error' event
      ^

TypeError: The compressed data passed is corrupted
    at Decoder._decode (C:\Users\ironp\Project\discord-speech-recognition-cont\node_modules\discord.js\node_modules\prism-media\src\opus\Opus.js:64:25)
    at Decoder._transform (C:\Users\ironp\Project\discord-speech-recognition-cont\node_modules\discord.js\node_modules\prism-media\src\opus\Opus.js:204:22)
    at Decoder.Transform._read (internal/streams/transform.js:205:10)
    at Decoder.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Decoder.Writable.write (internal/streams/writable.js:303:10)
    at Readable.ondata (internal/streams/readable.js:719:22)
    at Readable.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
Emitted 'error' event on Decoder instance at:
    at Decoder.onerror (internal/streams/readable.js:760:14)
    at Decoder.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
@Rei-x
Copy link
Owner

Rei-x commented Sep 25, 2021

As far as I can see, I can't handle this error properly, because it occurs in event (and try catch doesn't work there). It's an issue with @discordjs/opus library - discordjs/opus#49
If you find a solution, please create a pull request.

/edit
Okay, nvm, maybe I have found a solution.

@Rei-x
Copy link
Owner

Rei-x commented Sep 25, 2021

See #12 if it fixes your issue.

@Rei-x Rei-x added the bug Something isn't working label Sep 25, 2021
@Rei-x Rei-x closed this as completed Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants