myers / chord_detector

Javascript bindings for chord detector
44 stars 14 forks source link

Demo in mobile dorsnt work. #2

Open cambo2015 opened 5 years ago

cambo2015 commented 5 years ago

Hey cool project. I tried to get the demo working on my phone but it doesn't seem to work, at least for me. Is it just the demo/phone? Would love to use this library in the future.

chrisspen commented 3 years ago

I noticed this too. It works fine for me in a desktop browser, but it only partially works on an Android browser. It registers changes volume, but it just doesn't detect notes. Maybe it's something with the weird/special speakers used in phones?

chrisspen commented 3 years ago

I've managed to get it partially working in mobile by adding these audio constraints to the call for navigator.mediaDevices.getUserMedia:

echoCancellation: false,
noiseSuppression: false,
autoGainControl: false

I suspect that on mobile browsers they usually default to having these enabled, which probably helps voice audio but destroys the fidelity of musical pitches.

Unfortunately, it's still a little off for me. It's showing the pitch as being exactly one note off from what my tone generator makes.