We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I wonder what is the allowed combinations of rate and frameSize options for prism.opus.Encoder?
rate
frameSize
prism.opus.Encoder
From my experiments just a limited list is actually allowed, step left or right - and it's crashing with segmentation fault error.
Here is a code for example which crashes:
import prism from 'prism-media'; import fs from 'fs'; import { PassThrough } from 'stream'; const samplingRate = 32000; // (1) const frameSize = 60; // (2) const stream = fs.createReadStream('01.wav'); const transcoderStream = new prism.FFmpeg({ args: ['-i', '-', '-f', 's16le', '-filter:a', `aresample=${samplingRate}`, '-channel_layout', 'mono'], }); const encoderOptions = { rate: samplingRate, channels: 1, frameSize: Math.round((frameSize / 1000) * samplingRate), }; console.log(encoderOptions, 'Encoder options'); const encodeStream = new prism.opus.Encoder(encoderOptions); stream.pipe(transcoderStream).pipe(encodeStream).pipe(new PassThrough());
If you change lines (1) and (2) to:
const samplingRate = 48000; // (1) const frameSize = 20; // (2)
or
const samplingRate = 16000; // (1) const frameSize = 60; // (2)
it won't crash.
I would like to have a helper function for generating appropriate inputs for prism.opus.Encoder.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I wonder what is the allowed combinations of
rate
andframeSize
options forprism.opus.Encoder
?From my experiments just a limited list is actually allowed, step left or right - and it's crashing with segmentation fault error.
Here is a code for example which crashes:
If you change lines (1) and (2) to:
or
it won't crash.
I would like to have a helper function for generating appropriate inputs for
prism.opus.Encoder
.The text was updated successfully, but these errors were encountered: