-
Notifications
You must be signed in to change notification settings - Fork 57
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
Buffer #51
Comments
You need to make sure that the length of the argument to encoder.encode() is a multiple of 2.5ms. Since you are encoding with 16000 and two channels (!) that would be multiple of 1622.5 = 80 frames that is 160 bytes. A good normal window size is 20ms, so that would make you have the data buffer at 8*160 bytes exactly. That said, then the implementation does not check for the return value of |
im currently not working on that project anymore but i will need it in the near future, so im thankful for your answer! i will close this issue when i get to try this! |
and how i can fix it? |
Up, thanks for your answer, but can you provide a code example to solve the problem ? |
Up! Someone who can fix it?? |
I met a similar issue and I found a solution. I am not sure it is a general solution for every one but here I just share it: If Split the buffer into 3840-length smaller buffers, encode then and concat the result. Sample code: let result = Buffer.alloc(0)
for(let i = 3840; i <= buffer.length; i +=3840) {
result = Buffer.concat([result, encoder.encode(buffer.subarray(i - 3840, i))]);
} The code above is untested. I cannot share my tested code here since it is coupled with other parts of my project. |
Please describe the problem you are having in as much detail as possible:
When i try to construct the Method
OpusEncoder
node exits witherrno 4294930435
or withError: Cannot create a Buffer larger than 0x100000000 bytes
.The first one occurs only when rate is set to
32000
on the constructor and the scond on on every other rateInclude a reproducible code sample here, if possible:
just construct OpusEncoder.
Further details:
the problem occurs in line 6
@discordjs/opus version:
Node.js version: 15.3.0
Operating system: Windows 10 Pro 64bit
Priority this issue should have – please be realistic and elaborate if possible:
medium
The text was updated successfully, but these errors were encountered: