Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
waveshaper
Advanced tools
This library calculates render data in real-time from audio-data which can be used to draw (interactive) audio waveforms. waveshaper-dom is a libray that uses this to render interactive waveforms in the browser. The output is stored in the lastProcessResult property and is given per track to the registered callbacks. The format of the output data is per track a Float32Array which can be read in the following way:
for(let i = 0; i < data.length; i += 4) {
const negativeValue = data[i];
const positiveValue = data[i + 1];
const isIntervalBorder = data[i + 2];
const isInsideInterval = data[i + 3];
}
The length of the result array is options.width * 4, with each group of 4 containing information for a single point.
npm install waveshaper
const options = {
samplesPerPixel: 1024,
resolution: 64,
width: 300,
scrollPosition: 0,
meterType: 'rms',
samplerate: 44100
};
// data would generally contain decoded audio data
// If no data is provided the result array contains all 0's for positive and negative values.
const data = [
{ id: '1', data: new Float32Array(44100) },
{ id: '2', data: new Float32Array(44100) },
];
const tracks = [
{
id: '1', intervals: [
{ id: '1', start: 10, end: 30, offsetStart: 5, index: 1, source: '1' },
{ id: '2', start: 15, end: 20, offsetStart: 2, index: 2, source: '2' },
]
},
{
id: '2', intervals: [
{ id: '3', start: 10, end: 30, offsetStart: 5, index: 1, source: '1' },
{ id: '4', start: 15, end: 20, offsetStart: 2, index: 2, source: '2' },
]
},
];
const callback = function(options, renderData) {
// Options at time process was called
console.log(options);
for(let i = 0; i < renderData.length; i += 4) {
const negativeValue = renderData[i];
const positiveValue = renderData[i + 1];
const isIntervalBorder = renderData[i + 2];
const isInsideInterval = renderData[i + 3];
}
};
const WS = new WaveShaper(options);
WS.setData(...data)
.setTracks(...tracks)
.on('1', callback)
.on('2', callback)
.process();
console.log(WS.lastProcessResult);
FAQs
Waveform drawing library
The npm package waveshaper receives a total of 4 weekly downloads. As such, waveshaper popularity was classified as not popular.
We found that waveshaper 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.