
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
opus-encode
Advanced tools
#opus-encode
Encode audio buffer streams to ogg opus. AFAIK, this only works in the browser.
##Installation
npm install --save opus-encode
##Usage
var concat = require('concat-stream');
var encode = require('opus-encode');
var stream = require('stream');
// request an audio file
var req = new XMLHttpRequest();
req.open('GET', '/path/to/file.wav', true);
req.responseType = 'arraybuffer';
req.onload = function () {
var res = req.response;
var ctx = new AudioContext();
// decode the file to audio buffers
ctx.decodeAudioData(res, function (buf) {
var audio = new stream.Readable({objectMode: true});
// convert the audio buffers to an object stream
audio._read = function () {
this.push(buf);
this.push(null);
};
// create a stream that concats all encoded data
var doSomething = concat(function (buf) {
// this blob contains the ogg opus encoded audio
var blob = new Blob([buf.toArrayBuffer()]);
});
audio.pipe(encode()).pipe(doSomething);
});
};
req.send();
##Disclaimer
I don't pretend to understand how the encoder actually works. I modified the encoder written by chris-rudmin in his fork of RecordJS.
##Tests
In order to run tests in the browser make sure you open your browser with the following flag:
--allow-file-access-from-files
FAQs
Encode audio buffer streams to ogg opus.
We found that opus-encode 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.