cwilso / PitchDetect

Pitch detection in Web Audio using autocorrelation
https://cwilso.github.io/PitchDetect/
MIT License
1.31k stars 440 forks source link

The browser closes the microphone connection after some seconds in Firefox #6

Closed tirithen closed 10 years ago

tirithen commented 10 years ago

I'm impressed by this demo, and made a bower package of some of the code https://github.com/tirithen/PitchDetector , however in both your and mine version the connection to the microphone closes after ~ 5 - 30 seconds. The icon beside the address field in the browser disappears but I cannot find a way to detect any error happening.

Did you experience the same problem (using Firefzox 32.0.1)?

AdaRoseCannon commented 10 years ago

This is usually a problem with firefox garbage collecting the mediaStreamSource, make sure it is declared in a place it won't be GC'd such as in the global scope or on the window object.

cwilso commented 10 years ago

Well, that's pretty messed up. As long as it's connected and pulling input, it shouldn't be garbage collected. But fixed, with https://github.com/cwilso/Audio-Input-Effects/commit/218d568d834f2637dee83522d8e099ee5bd36917.