1

I am working on a guitar tuner PWA, and have implemented 2 pitch detection algorithms in order to see which is the best. The app is supposed to work by getting the audio data through a microphone connected to the device.

In order to get the audio data, I am using the following function from the WebAudioAPI in order to access the device microphone:

navigator.mediaDevices.getUserMedia({
        audio: {
          autoGainControl: false,
          echoCancellation: false,
          noiseSuppression: false,
        },
})

On desktop, everything works, and the microphone audio is picked up and both the algorithms work just as expected.

On mobile, when testing on a Oneplus 6, everything works just like on desktop. But after trying to test on a Samsung Galaxy Note 10 the algorithms don't detect anything frequency.

For my first attempt to figure out what is going on I have tried outputting the sound captured by the microphone back through speakers in order for me to check if the microphone detects any sound. On desktop and the Oneplus 6, I can hear back my voice just normal.

On the Samsung phone the audio either sounds like that static from the old tvs or like phone interference Sound demo here. My intuition tells me that this may be because the samsung phone has more microphones (either 2 or three) and that may mess up with the application since I am not specifying in any way which microphone to use. That is just a hunch though.

So, does anyone have any ideas how I may proceed towards solving this issue? Or how can explicitly control with WebAudioAPI which microphones I want to use?

0 Answers0