Search code examples
actionscript-3flashapache-flexmicrophone

ActionScript/Flex - Stop recording on silence


Is there a way to start recording (writing sample data to a ByteArray) when there's activity (by activity I mean anything but silence), and stop recording when there's one second of silence?

Any guidelines on how to approach this would be extremely appreciated.

(Sorry if part or all of the above sounds stupid, this is my first-ever ActionScript application; I'm building it because I need microphone access in a Web app).


Solution

  • in Microphone there is 'silenceLevel' property and 'setSilenceLevel()' method. This method specified microphone signal level after which dispatching activity event. Microphone#setSilenceLevel() method reference