Search code examples
javascripthtml5-audioaudio-recordingweb-audio-api

Volume of Microphone using web-audio-draw (rserota/wad)


So this answer's my question with using the native html API: https://stackoverflow.com/a/51859377/604950

But I want to use the WAD library: https://github.com/rserota/wad#audio-meter

This is a codepen I started to try and mix the ideas together of #audio-meter and #pitch-detection . https://codepen.io/FlorianMettetal/pen/oNXjPOj?editors=0011

But you can see in the console.logging and playing some music into a microphone, that the volume is always 0 and clipping always false

Object {
  clipping: false,
  noteName: "G#2",
  pitch: 103,
  volume: 0
}
Object {
  clipping: false,
  noteName: "G#2",
  pitch: 103,
  volume: 0
}

Thanks for any help on this


Solution

  • I looked through your code briefly, and I noticed at least one thing thing that didn't look right. When you call this.tuner.setVolume(0), that basically mutes the microphone, or whatever was added to the tuner. That would explain why the output volume you see is always 0, and why clipping is always false. You probably want to leave the volume at the default level, or set it so some non-zero number (less than or equal to 1).

    I hope you're enjoying using Wad.js!