Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ogg-opus-decoder

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ogg-opus-decoder - npm Package Compare versions

Comparing version 1.4.5 to 1.5.0

6

package.json
{
"name": "ogg-opus-decoder",
"version": "1.4.5",
"version": "1.5.0",
"description": "Web Assembly streaming Ogg Opus decoder",

@@ -52,6 +52,6 @@ "type": "module",

"dependencies": {
"@wasm-audio-decoders/common": "5.1.1",
"@wasm-audio-decoders/common": "6.0.0",
"codec-parser": "2.2.0",
"opus-decoder": "0.5.4"
"opus-decoder": "0.6.0"
}
}
# `ogg-opus-decoder`
`ogg-opus-decoder` is a Web Assembly Ogg Opus audio decoder.
* 104.4 KiB minified bundle size
* 105.4 KiB minified bundle size
* Browser and NodeJS support

@@ -86,3 +86,12 @@ * Built in Web Worker support

samplesDecoded: 1234, // number of PCM samples that were decoded per channel
sampleRate: 48000 // sample rate of the decoded PCM
sampleRate: 48000, // sample rate of the decoded PCM
errors: [ // array containing descriptions for any decode errors
{
message: "libopus -4 OPUS_INVALID_PACKET: The compressed data passed is corrupted",
frameLength: 400, // length of the frame or data in bytes that encountered an error
frameNumber: 21, // position of error relative to total frames decoded
inputBytes: 4905, // position of error relative to total input bytes
outputSamples: 18888, // position of error relative to total output samples
}
]
}

@@ -93,2 +102,4 @@ ```

Decoding will proceed through any errors. Any errors encountered may result in gaps in the decoded audio.
### Multichannel Output

@@ -95,0 +106,0 @@

@@ -10,2 +10,3 @@ import { WASMAudioDecoderCommon } from "@wasm-audio-decoders/common";

this._decoderOperations = [];
this._errors = [];
this._decoded = [];

@@ -20,2 +21,3 @@ this._channelsDecoded = 0;

.then(() => [
this._errors,
this._decoded,

@@ -37,6 +39,7 @@ this._channelsDecoded,

async _sendToDecoder(frames) {
const { channelData, samplesDecoded } =
const { channelData, samplesDecoded, errors } =
await this._instance._decoder.decodeFrames(frames);
this._decoded.push(channelData);
this._errors = this._errors.concat(errors);
this._totalSamples += samplesDecoded;

@@ -43,0 +46,0 @@ this._channelsDecoded = channelData.length;

@@ -0,1 +1,3 @@

import { DecodeError } from "@wasm-audio-decoders/common/types";
declare module "ogg-opus-decoder" {

@@ -6,2 +8,3 @@ export interface OpusDecodedAudio {

sampleRate: 48000;
errors: DecodeError[];
}

@@ -8,0 +11,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc