Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
audio-automator
Advanced tools
A better way to change AudioParam values.
This library was created to deal with some of the issues I've encountered when working with the WebAudio AudioParam (MDN) automation features. The web-audio-api provides 6 functions for automating param values, as well as letting you set the param.value directly:
There are however, some annoyances with the API (IMHO), so I created this library. For example, when using any of the 6 functions above, the param.value does not change while automations are occurring, so you cannot inspect where in the automation you are (you have to calculate this yourself by keeping track of timings). Also, when you cancel an automation, the "value" jumps back to the value when the automation started (which may or may not be what you intended).
I've "fixed" these issues by always setting the param.value directly, and not using the built-in web audio automation functions. This allows me to expose different types of automation easing functions, as well as allowing end users to inspect automation timings and values at any time. It also lets you schedule new automations that just "pick up from the right spot". Meaning you don't have to cancel running automations if you don't want to. Just schedule a new one, and the most recent automation added will work correctly.
You can check out a live demo here:
Install the module with: npm install audio-automator
import AudioAutomator from 'audio-automator';
// create a context, and a gain node (which we will automate)
const audioContext = new AudioContext();
const gain = audioContext.createGain();
// create our AudioAutomator
const auto = new AudioAutomator(audioContext);
// Automate the gain node:
// This waits for 3 seconds, then starts using a `sinInOut` easing
// function to change the value of the gain node to 0.5. It will
// take 1.2 seconds to complete the automation.
auto.sinInOut(gain.gain, 0.5, 1.2, 3);
Copyright (c) 2016 skratchdot
Licensed under the MIT license.
FAQs
A better way to change AudioParam values
The npm package audio-automator receives a total of 5 weekly downloads. As such, audio-automator popularity was classified as not popular.
We found that audio-automator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.