
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Draw the wave in canvas use processed data from audio Element or MediaStream
Import the module and bundle it for the browser with your favorite module bundler,
$ npm install audio2wave
import { Audio2Wave } from 'audio2wave';
const audio = document.getElementById('audio');
const container = document.getElementById('container')
const audio2wave = new Audio2Wave({
audio,
container,
drawerConfig: {
color: '#007fff'
},
dataConfig: {
fftSize: 512
}
});
audio.onplay = () => {
audio2wave.start();
}
audio.onpause = () => {
audio2wave.stop();
}
window.onunload = () => {
audio2wave.destroy();
}
Or
import { Audio2Wave } from 'audio2wave';
const audio = new MediaStrem();
// .... TODO: add tracks
const container = document.getElementById('container')
const audio2wave = new Audio2Wave({
audio,
container,
drawerConfig: {
color: '#007fff'
},
dataConfig: {
fftSize: 512
}
});
queueMicrotask(() => {
audio2wave.start()
});
window.onunload = () => {
audio2wave.destroy();
}
export declare class Audio2Wave implements IBase {
private drawer;
private processer;
private config;
constructor(config: IConfig);
start(): void;
stop(): void;
private stateChagneHandler;
private addEventListener;
private removeEventListener;
destroy(): Promise<void>;
}
type IPartial<T> = {
[P in keyof T]?: T[P]
}
type IReadOnly<T> = {
readonly [P in keyof T]: T[P]
}
type IRequired<T> = {
[P in keyof T]-?: T[P]
}
type IPick<T, K extends keyof T> = {
[P in K]: T[P]
}
export interface IDataConfig {
fftSize: 128|256|512|1024;
}
export enum ALIGN {
LEFT,
CENTER,
RIGHT,
}
export interface CanvasWH {
width: number;
height: number;
}
export interface IDrawerConfig {
color: string;
barWidth: number;
align: ALIGN;
xSpace: number;
canvasWH: CanvasWH;
}
export interface IConfig {
audio: IAudio | IStream;
container: IContainer;
dataConfig?: IPartial<IDataConfig>;
drawerConfig?: IPartial<IDrawerConfig>;
}
export interface IContainer extends HTMLElement {
}
export interface IAudio extends HTMLMediaElement {
}
export interface IStream extends MediaStream {
}
FAQs
draw wave in canvas from audio element source
We found that audio2wave 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.