
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.
audio-visualization-tool
Advanced tools
Light weight tool for customize audio player with visualization effects
Lightweight and customizable audio visualization toolkit build up on web audio api.
A thin wrapper of Audio Element and Web Audio API.
It currently uses canvas2D as the graphic engine, I will implement the ability to use Three.js later.
Demo: https://eggtronic.github.io/web-audio-visualization-tool/
![]() Firefox | ![]() Chrome |
---|---|
latest versions | latest versions |
- Run
npm install
- Run
npm run build
to build- Run
npm run dev
for development
You can install it from npm (unstable)
`npm install --save audio-visualization-tool`
You can also get it from cdn in script tag
<script src='https://cdn.jsdelivr.net/npm/audio-visualization-tool@0.0.1/lib/index.js'></script>
In your html body you need create 2 canvas element and 1 audio element.
<audio id="myAudio" src="..." data-author="..." data-title="..."></audio>
<canvas id="myCanvas" width="800" height="400"></canvas>
<canvas id="myStaticCanvas" width="800" height="400"></canvas>
<script src='https://cdn.jsdelivr.net/npm/audio-visualization-tool@0.0.1/lib/index.js'></script>
<script type="module" src='example.js'></script>
- Create an example.js file and copy the js code below into it. (you can also use your own name)
- You will need to reference 2 canvas element id and 1 audio element id to init the AudioVisualizer.
- (optional) You can reference your own canvases.
- You can reuse my example style for a better preview (it's in the index.html)
window.addEventListener('DOMContentLoaded', () => {
'use strict';
const AudioVisualizer = AudioVisualizeTool.AudioVisualizer;
const {
Ripple
} = AudioVisualizeTool.defaultElements;
const {
renderTime,
renderInfo,
renderLoading,
clearLoading,
renderBackgroundImg,
renderLounge,
renderProgressbar,
renderProgressbarShadow,
renderSeekBar,
renderSeekBarShadow,
bindSeekBarEvent,
renderPlayControl,
bindPlayControlEvent,
renderVolumeBar,
bindVolumeBarEvent
} = AudioVisualizeTool.defaultRenderHooks;
const {
setCanvasStyle,
setStaticCanvasStyle
} = AudioVisualizeTool.defaultInitHooks;
let ripple = new Ripple();
let audioVisualizer = new AudioVisualizer({
autoplay: false,
loop: true,
initVolume: 0.5, // 0 to 1;
fftSize: 512, // the frequency sample size for audio analyzer
framesPerSecond: 60, // the refresh rate for rendering canvas (not static canvas)
audio: 'myAudio',
audioURLs: ['./static/reverie.mp3'], // these urls are for tempo(NPM) detection only
canvas: 'myCanvas', // main canvas for rendering frames
canvasStatic: 'myStaticCanvas', // static canvas
customCanvases: [], // you can add your own canvases
// customize your theme
theme: {
barWidth: 2,
barHeight: 5,
barSpacing: 7,
barColor: '#ffffff',
shadowBlur: 20, // avoid this attribute for rendering frames, it can reduce the performance
shadowColor: '#ffffff',
font: ['12px', 'Helvetica'],
},
// hooks contain callbacks just before/after differency lifecycle stage
// cb in before hooks should return promises
beforeInitHook: [],
afterInitHook: [setCanvasStyle, setStaticCanvasStyle],
beforeLoadAudioHook: [renderLoading],
afterLoadAudioHook: [clearLoading, renderPlayControl],
beforeStartHook: [],
afterStartHook: [],
beforePauseHook: [],
afterPauseHook: [renderProgressbar, renderTime, renderSeekBar, renderPlayControl],
beforeResumeHook: [],
afterResumeHook: [],
// you can react to volume change here
onVolumeChangeHook: [renderVolumeBar],
// hook for static canvas
beforeStaticHook: [renderBackgroundImg],
onStaticHook: [renderProgressbarShadow, renderInfo, renderSeekBarShadow, renderVolumeBar],
// hooks that will be excuted for each frame
// used for the main canvas
onFrameHook: [renderLounge, renderProgressbar, renderTime, renderSeekBar, ripple.render()],
// you may bind your events here
onEventHook: [bindPlayControlEvent, bindSeekBarEvent, bindVolumeBarEvent],
// you may release some resourse here
// if loop is ture this hook will not be excuted
onEndHook: [],
})
audioVisualizer.init();
}, false);
editing...
I haven't specified an contributing guide, but I welcome all contributions. If you have any questions or ideas just email me.
FAQs
Light weight tool for customize audio player with visualization effects
The npm package audio-visualization-tool receives a total of 2 weekly downloads. As such, audio-visualization-tool popularity was classified as not popular.
We found that audio-visualization-tool 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.