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

The value of "sourceEnd" is out of range error in 2.0.0-alpha.0 #104

Closed
tony-ist opened this issue Jun 27, 2022 · 1 comment · Fixed by #110
Closed

The value of "sourceEnd" is out of range error in 2.0.0-alpha.0 #104

tony-ist opened this issue Jun 27, 2022 · 1 comment · Fixed by #110
Assignees

Comments

@tony-ist
Copy link

Issue:

RangeError [ERR_OUT_OF_RANGE]: The value of "sourceEnd" is out of range. It must be >= 0 && <= 3. Received 8 
  at validateOffset (node:buffer:113:3)
  at Buffer.compare (node:buffer:895:5) 
  at Decoder._transform (/Users/tony/Projects/aoede-bot/node_modules/prism-media/src/opus/Decoder.ts:23:13)
  ...

I get the aforementioned error when working with opus.Decoder from prism-media version 2.0.0-alpha.0. It originates there at chunk.compare call. I guess it is because of a small chunk with a length of 3. Any ideas how to fix?

Steps to reproduce:

const listenStream = connection.receiver.subscribe(userId, {
  end: {
    behavior: EndBehaviorType.AfterSilence,
    duration: 1000,
  },
})

const opusDecoder = new prism.opus.Decoder({
  frameSize: 960,
  channels: 1,
  rate: 48000,
})

inputStream.pipe(opusDecoder)

Further details:

  • Operating System: MacOS 11.5.2
  • Node.js version: 16.14.2
  • Commit I'm using: 2.0.0-alpha.0
@amishshah amishshah self-assigned this Jul 9, 2022
@dcapape
Copy link

dcapape commented Sep 18, 2022

I'm having exactly the same issue with the same code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants