Capture the volume of audio data.
https://tomk79.github.io/node-soundwave/demo/
$ npm install --save @tomk79/soundwave
<script src="path/to/soundwave/dist/soundwave.js"></script>
<audio src="path/to/sound.mp3" controls id="audio-element"></audio>
<script>
const soundWave = new SoundWave(
document.getElementById("audio-element"), {
destination: true, // Whether to output audio
channels: 2, // Number of audio channels
});
soundWave.on('sound', function(volume){
console.log(volume[0]);
});
</script>
- Initial release.
MIT License.
Tomoya Koyanagi (@tomk79)