
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
audiobuffer-to-wav
Advanced tools
Encodes the contents of an AudioBuffer from the WebAudio API as WAVE. Supports 16-bit PCM and 32-bit float data.
The code for this has been adapted from the export feature of Recorder.js.
PRs welcome.
npm install audiobuffer-to-wav --save
var toWav = require('audiobuffer-to-wav')
var xhr = require('xhr')
var context = new AudioContext()
// request the MP3 as binary
xhr({
uri: 'audio/track.mp3',
responseType: 'arraybuffer'
}, function (err, body, resp) {
if (err) throw err
// decode the MP3 into an AudioBuffer
audioContext.decodeAudioData(resp, function (buffer) {
// encode AudioBuffer to WAV
var wav = toWav(buffer)
// do something with the WAV ArrayBuffer ...
})
})
See the demo for an example of loading MP3, decoding it, and triggering a download of the encoded WAV file.
A more advanced example might be to write the file using Node and Electron or hihat, i.e. an easy way to convert MP3/OGG/etc to WAV.
arrayBuffer = encodeWAV(audioBuffer, [opt])
Encodes the AudioBuffer instance as WAV, returning a new array buffer. Interleaves multi-channel data, if necessary.
By default, exports with 16-bit PCM (format: 1). You can specify opt.float32
instead, which will write format 3 with 32-bit float data.
MIT, see LICENSE.md for details.
FAQs
convert an AudioBuffer to .wav format
We found that audiobuffer-to-wav 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.