rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.88k stars 160 forks source link

getUserMedia() build error #145

Closed dibyendu1 closed 1 year ago

dibyendu1 commented 1 year ago

I am creating a ReactJS based application where I am using Wad for live pitch detection from the microphone input. When the project is built and run using 'serve -s build', and accessed through IP_ADDRESS:PORT, the application throws an error 'getUserMedia is unsupported'. But the application runs well using localhost:PORT .

We observed a strange behaviour. While using localhost:PORT , the browser asks for the permission to access the microphone. But while using IP_ADDRESS:PORT, the browser doesn't ask for permission and the application breaks.

To Reproduce var voice = new Wad({ source: "mic", env: { hold: 1, release: 0 } }); var tuner = new Wad.Poly(); tuner.setVolume(0); voice.play(0)

Device :

rserota commented 1 year ago

When the project is accessed through the IP address, is it served using HTTPS, or just plain HTTP? getUserMedia can only be accessed over HTTPS. This restriction doesn't apply to localhost.

dibyendu1 commented 1 year ago

Yes I was trying to run the build on http. I will try using https tomorrow and update this issue thread with the results. Thank you for the help.

dibyendu1 commented 1 year ago

Hi. Yes the application is working fine on https. Thank you for the clarification!!....

rserota commented 1 year ago

I'm glad you were able to resolve your issue. I hope you're enjoying using WadJS.