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

ogg-opus-decoder

Package Overview
Dependencies
Maintainers
0
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.6.12 to 1.6.13

4

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

@@ -57,5 +57,5 @@ "type": "module",

"@wasm-audio-decoders/common": "9.0.5",
"codec-parser": "2.4.3",
"codec-parser": "2.5.0",
"opus-decoder": "0.7.6"
}
}
# `ogg-opus-decoder`
`ogg-opus-decoder` is a Web Assembly Ogg Opus audio decoder.
* 108.5 KiB minified bundle size
* 108.9 KiB minified bundle size
* Browser and NodeJS support

@@ -6,0 +6,0 @@ * Built in Web Worker support

@@ -13,4 +13,4 @@ import { WASMAudioDecoderCommon } from "@wasm-audio-decoders/common";

absoluteGranulePosition,
samples,
data,
totalSamples,
} from "codec-parser";

@@ -53,3 +53,2 @@

this._channels = this._forceStereo ? 2 : header[channels];
this._beginningSampleOffset = null;

@@ -99,13 +98,2 @@ this._decoder = new this._decoderClass({

// record beginning sample offset for absoluteGranulePosition logic
if (
this._beginningSampleOffset === null &&
Number(oggPage[absoluteGranulePosition]) > -1
) {
this._beginningSampleOffset =
oggPage[absoluteGranulePosition] -
BigInt(oggPage[samples]) +
BigInt(this._preSkip);
}
if (oggPage[isLastPage]) {

@@ -116,17 +104,16 @@ // in cases where BigInt isn't supported, don't do any absoluteGranulePosition logic (i.e. old iOS versions)

(this._totalSamplesDecoded / this._sampleRate) * 48000;
const totalOggSamples_48000 = Number(
oggPage[absoluteGranulePosition] - this._beginningSampleOffset,
);
// trim any extra samples that are decoded beyond the absoluteGranulePosition, relative to where we started in the stream
const samplesToTrim = Math.round(
((totalDecodedSamples_48000 - totalOggSamples_48000) / 48000) *
((totalDecodedSamples_48000 - oggPage[totalSamples]) / 48000) *
this._sampleRate,
);
for (let i = 0; i < channelData.length; i++) {
channelData[i] = channelData[i].subarray(
0,
samplesDecoded - samplesToTrim,
);
if (samplesToTrim > 0) {
for (let i = 0; i < channelData.length; i++) {
channelData[i] = channelData[i].subarray(
0,
samplesDecoded - samplesToTrim,
);
}
}

@@ -133,0 +120,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