Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Connect a Web Audio API AudioNode and stream out the realtime RMS audio level.
Connect a Web Audio API AudioNode and stream out the realtime RMS audio level.
$ npm install audio-rms
Stereo level meter using html5's meter element.
<meter id='L' min='-20' class='.left' high='0' value='-20' max='6' />
<meter id='R' min='-20' class='.right' high='0' value='-20' max='6' />
var AudioRMS = require('audio-rms')
var leftMeter = document.getElementById('L')
var rightMeter = document.getElementById('R')
var audioContext = new AudioContext()
var output = audioContext.createGain()
output.gain.value = 0.4
output.connect(audioContext.destination)
var oscillator = audioContext.createOscillator()
oscillator.connect(output)
oscillator.start()
// modulate audio level
var lfo = audioContext.createOscillator()
var amp = audioContext.createGain()
lfo.frequency.value = 1
amp.gain.value = 0.4
lfo.connect(amp)
amp.connect(output.gain)
lfo.start()
var rms = AudioRMS(audioContext)
output.connect(rms.input)
rms.on('data', function(data){
leftMeter.value = Math.max(-40, getDecibels(data[0]))
rightMeter.value = Math.max(-40, getDecibels(data[1]))
})
function getDecibels(value) {
if (value == null) return 0
return Math.round(Math.round(20 * (0.43429 * Math.log(value)) * 100) / 100 * 100) / 100
}
FAQs
Connect a Web Audio API AudioNode and stream out the realtime RMS audio level.
The npm package audio-rms receives a total of 4 weekly downloads. As such, audio-rms popularity was classified as not popular.
We found that audio-rms 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.