mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
35 lines
667 B
JavaScript
35 lines
667 B
JavaScript
const { Wave } = require('@foobar404/wave');
|
|
|
|
class WaveVisualizer {
|
|
constructor(
|
|
audioContext,
|
|
audioSource,
|
|
visualizerContainer,
|
|
canvas,
|
|
audioNode,
|
|
stream,
|
|
options,
|
|
) {
|
|
this.visualizer = new Wave(
|
|
{ context: audioContext, source: audioSource },
|
|
canvas,
|
|
);
|
|
for (const animation of options.animations) {
|
|
this.visualizer.addAnimation(
|
|
eval(`new this.visualizer.animations.${animation.type}(
|
|
${JSON.stringify(animation.config)}
|
|
)`),
|
|
);
|
|
}
|
|
}
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
resize(width, height) {
|
|
}
|
|
|
|
render() {
|
|
}
|
|
}
|
|
|
|
module.exports = WaveVisualizer;
|