opus-decoder
Advanced tools
Comparing version 0.6.7 to 0.7.0
{ | ||
"name": "opus-decoder", | ||
"version": "0.6.7", | ||
"version": "0.7.0", | ||
"description": "Web Assembly streaming Opus decoder", | ||
@@ -5,0 +5,0 @@ "type": "module", |
# `opus-decoder` | ||
`opus-decoder` is a Web Assembly Opus audio decoder. | ||
* 83.3 KiB minified bundle size | ||
* 84.3 KiB minified bundle size | ||
* Browser and NodeJS support | ||
@@ -132,2 +132,3 @@ * Built in Web Worker support | ||
forceStereo: false, | ||
sampleRate: 48000, | ||
preSkip: 0, | ||
@@ -149,2 +150,5 @@ channels: 2, | ||
* Number of samples to skip at the beginning reported by the Opus header. | ||
* `sampleRate` *optional, defaults to `48000`* | ||
* Sample rate the decoder will output. | ||
* Valid sample rates: `8000, 12000, 16000, 24000, or 48000` | ||
#### ***Required for Multichannel Decoding.** (Channel Mapping Family >= 1)* | ||
@@ -201,2 +205,5 @@ * `channels` *optional, defaults to `2`* | ||
* Number of samples to skip at the beginning reported by the Opus header. | ||
* `sampleRate` *optional, defaults to `48000`* | ||
* Sample rate the decoder will output. | ||
* Valid sample rates: `8000, 12000, 16000, 24000, or 48000` | ||
#### ***Required for Multichannel Decoding.** (Channel Mapping Family >= 1)* | ||
@@ -203,0 +210,0 @@ * `channels` *optional, defaults to `2`* |
@@ -54,2 +54,3 @@ import { WASMAudioDecoderCommon } from "@wasm-audio-decoders/common"; | ||
this._decoder = this._common.wasm.opus_frame_decoder_create( | ||
this._sampleRate, | ||
this._channels, | ||
@@ -145,3 +146,3 @@ this._streamCount, | ||
decoded.samplesDecoded, | ||
48000 | ||
this._sampleRate | ||
); | ||
@@ -183,3 +184,3 @@ }; | ||
samplesDecoded, | ||
48000 | ||
this._sampleRate | ||
); | ||
@@ -198,2 +199,3 @@ }; | ||
const sampleRate = options.sampleRate; | ||
const channels = options.channels; | ||
@@ -216,2 +218,7 @@ const streamCount = options.streamCount; | ||
// libopus sample rate | ||
this._sampleRate = [8e3, 12e3, 16e3, 24e3, 48e3].includes(sampleRate) | ||
? sampleRate | ||
: 48000; | ||
// channel mapping family 0 | ||
@@ -218,0 +225,0 @@ this._channels = isNumber(channels) ? channels : 2; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
200933
262
1199