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

scratch-audio

Package Overview
Dependencies
Maintainers
1
Versions
443
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scratch-audio - npm Package Compare versions

Comparing version 0.1.0-prerelease.20190108181031 to 0.1.0-prerelease.20190114210212

2

package.json
{
"name": "scratch-audio",
"version": "0.1.0-prerelease.20190108181031",
"version": "0.1.0-prerelease.20190114210212",
"description": "audio engine for scratch 3.0",

@@ -5,0 +5,0 @@ "main": "dist.js",

@@ -159,3 +159,3 @@ const StartAudioContext = require('./StartAudioContext');

if (sound.data.length === 0) {
return Promise.resolve(this.audioContext.createBuffer(1, 1, this.audioContext.sampleRate));
return this._emptySound();
}

@@ -169,3 +169,4 @@

// Try decoding as adpcm
return new ADPCMSoundDecoder(this.audioContext).decode(bufferCopy2);
return new ADPCMSoundDecoder(this.audioContext).decode(bufferCopy2)
.catch(() => this._emptySound());
})

@@ -183,2 +184,10 @@ .then(

/**
* An empty sound buffer, for use when we are unable to decode a sound file.
* @returns {AudioBuffer} - an empty audio buffer.
*/
_emptySound () {
return this.audioContext.createBuffer(1, 1, this.audioContext.sampleRate);
}
/**
* Decode a sound, decompressing it into audio samples.

@@ -185,0 +194,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