New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

audio-param-transform

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-param-transform - npm Package Compare versions

Comparing version 0.4.0 to 1.0.0

5

index.js

@@ -8,3 +8,2 @@ var Scheduler = require('./scheduler')

param.context = audioContext
param._sampleRate = audioContext.sampleRate
param.transform = transform

@@ -35,3 +34,3 @@ param.clearTransforms = clearTransforms

var transformParam = new TransformParam(this.context, defaultValue, param._transformCallback)
var transformParam = TransformParam(this.context, defaultValue, param._transformCallback)
transformParam.operation = operation

@@ -51,3 +50,3 @@ transformParam._transforms = []

var duration = to - from
var steps = Math.max(1, Math.floor(duration * param._sampleRate))
var steps = Math.max(1, Math.floor(duration * param.context.sampleRate))
var defaultValue = param.defaultValue

@@ -54,0 +53,0 @@

2

package.json
{
"name": "audio-param-transform",
"version": "0.4.0",
"version": "1.0.0",
"description": "Apply multiple transforms with custom functions to Web Audio API AudioParams.",

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

@@ -1,16 +0,14 @@

module.exports = TransformAudioParam
module.exports = function TransformAudioParam(audioContext, defaultValue, cb){
var instance = Object.create(proto, properties)
instance.context = audioContext
instance._callback = cb
function TransformAudioParam(audioContext, defaultValue, cb){
if (!(this instanceof TransformAudioParam)){
return new TransformAudioParam(audioContext, defaultValue, cb)
}
Object.defineProperties(this, properties)
this.context = audioContext
this._callback = cb
this._events = []
this._events.truncateFrom = truncateFrom
this._events.truncateTo = truncateTo
this.defaultValue = defaultValue
this._lastValue = defaultValue
this._sampleRate = audioContext.sampleRate
instance._events = []
instance._sampleRate = audioContext.sampleRate
instance._events.truncateFrom = truncateFrom
instance._events.truncateTo = truncateTo
instance.defaultValue = defaultValue
instance._lastValue = defaultValue
return instance
}

@@ -29,5 +27,3 @@

TransformAudioParam.prototype = {
constructor: TransformAudioParam,
var proto = {
setValueAtTime: function(value, at){

@@ -111,4 +107,4 @@ this.addEvent({

var duration = toTime - fromTime
var steps = Math.max(1, Math.floor(duration * this._sampleRate))
var curve = new Float32Array(steps)
var steps = Math.max(1, Math.floor(duration * this._sampleRate))

@@ -133,3 +129,3 @@ for (var i=0;i<steps;i++){

} else if (target.at <= time){
if (typeof target.value == 'object'){
if (target.value instanceof Float32Array){
lastValue = target.value[target.value.length-1]

@@ -136,0 +132,0 @@ } else {

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