
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
web-audio-api
Advanced tools
This library implements the web audio API specification on node.js.
And this is not even alpha. Use this library only if you're the adventurous kind.
Each time you create an AudioNode
(like for instance an AudioBufferSourceNode
or a GainNode
), it inherits from DspObject
which is in charge of two things:
_schedule
_tick
Each time you connect an AudioNode
using source.connect(destination, output, input)
it connects the relevant AudioOutput
instances of source
node the the relevant AudioInput
instance of the destination
node.
To instantiate all of these AudioNode
, you needed an overall AudioContext
instance. This latter has a destination
property (where the sound will flow out), instance of AudioDestinationNode
, which inherits from AudioNode
. The AudioContext
instance keeps track of connections to the destination
. When that happens, it triggers the audio loop, calling _tick
infinitely on the destination
, which will itself call _tick
on its input ... and so forth go up on the whole audio graph.
Most of the AudioNodes ... Most of many other things ... :(
npm install web-audio-api
Get ready, this is going to blow up your mind :
npm install
gulp default
node test/manual-testing/AudioContext-sound-output.js
AudioContext
just writes PCM data to a node writable stream. The default stream is a stream created with Speaker
, which plays the audio back to your soundcard. But you can use any writable stream, file, including the stdin
of a child process.
For example, here is an example for streaming audio to an icecast server, using ices :
var spawn = require('child_process').spawn
, AudioContext = require('web-audio-api').AudioContext
, context = new AudioContext()
var ices = spawn('ices', ['ices.xml'])
context.outStream = ices.stdin
Cool huh?
Gibber is a great audiovisual live coding environment for the browser made by Charlie Roberts. For audio, it uses Web Audio API, so you can run it on node-web-audio-api. First install gibber with npm :
npm install gibber.audio.lib
Then to you can run the following test to see that everything works:
npm test gibber.audio.lib
Wow! The whole thing is not even half-done that there's already some extensions for it! See the list in the wiki.
Right now everything runs in one process, so if you set a break point in your code, there's going to be a lot of buffer underflows, and you won't be able to debug anything.
One trick is to kill the AudioContext
right before the break point, like this:
context._kill()
debugger
that way the audio loop is stopped, and you can inspect your objects in peace.
Tests are written with mocha. To run them, install mocha with :
npm install -g mocha
And in the root folder run :
npm test
To test the sound output :
npm install
gulp default
node test/manual-testing/AudioContext-sound-output.js
To test AudioParam
against AudioParam
implemented in a browser, open test/manual-testing/AudioParam-browser-plots.html
in that browser.
61 Sébastien Piquemal
16 ouhouhsami
4 John Wnek
2 anprogrammer
1 Andrew Petersen
channelInterpretation
'speakers'decodeAudioData
onended
implementeddecodeAudioData
, support only for wavScriptProcessorNode
AudioBufferSourceNode
start
have no effectAudioContext : method collectNodes
audioports : bug fixes
0.2.0
FAQs
Node.js implementation of Web audio API
The npm package web-audio-api receives a total of 3,519 weekly downloads. As such, web-audio-api popularity was classified as popular.
We found that web-audio-api 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.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.