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

scratch-audioengine

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scratch-audioengine - npm Package Compare versions

Comparing version 0.1.0-prerelease.1476387439 to 0.1.0-prerelease.1476480694

2

package.json
{
"name": "scratch-audioengine",
"version": "0.1.0-prerelease.1476387439",
"version": "0.1.0-prerelease.1476480694",
"description": "audio engine for scratch 3.0",

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

# scratch-audioengine
#### Scratch audio engine is for playing sounds, instruments and audio effects in Scratch 3.0 projects
#### Please note this project is at an early stage and we are not ready for pull requests
[![Build Status](https://travis-ci.com/LLK/scratch-audioengine.svg?token=KcCHRot8oJYS4bsz1qET&branch=master)](https://travis-ci.com/LLK/scratch-audioengine)

@@ -5,0 +7,0 @@

var Tone = require('tone');
var Soundfont = require('soundfont-player');
function AudioEngine () {
function AudioEngine (sounds) {

@@ -28,4 +28,5 @@ // tone setup

this.soundSamplers = [];
this.loadSounds(sounds);
// soundfont setup
// soundfont setup

@@ -46,2 +47,11 @@ // instrument names used by Musyng Kite soundfont, in order to

AudioEngine.prototype.loadSounds = function (sounds) {
for (var i=0; i<sounds.length; i++) {
var url = sounds[i].fileUrl;
var sampler = new Tone.Sampler(url, function () {
this.soundSamplers[url] = sampler;
}.bind(this)).toMaster();
}
};
AudioEngine.prototype.playSound = function (soundNum) {

@@ -149,9 +159,2 @@ this.soundSamplers[soundNum].triggerAttack();

AudioEngine.prototype.loadSounds = function (sounds) {
for (var sound in sounds) {
var sampler = new Tone.Sampler(sound.fileUrl).toMaster();
this.soundSamplers[sound.fileUrl] = sampler;
}
};
AudioEngine.prototype._clamp = function (input, min, max) {

@@ -158,0 +161,0 @@ return Math.min(Math.max(input, min), max);

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

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