UNPKG

@flemist/ffmpeg-encode-decode

Version:

WASM (WebAssembly) encode/decode mp3/ogg/opus/vorbis from/to Float32Array. Well tested @ffmpeg/ffmpeg wrapper.

19 lines (17 loc) 590 B
/** * docs: http://ffmpeg.org/ffmpeg-codecs.html#libopus-1 * !! Attention opus encoder heavily distorts samples data */ function ffmpegEncodeOpusParams(options) { return [ '-c:a', 'libopus', '-b:a', options.bitrate + 'k', '-vbr', options.vbr || 'on', '-compression_level', (options.compression || 10) + '', '-frame_duration', (options.frameDuration || 20) + '', '-application', options.application || 'audio', '-cutoff', (options.cutoff || 0) + '', ...options.params || [], ]; } export { ffmpegEncodeOpusParams };