Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I know this is an old question but just came across the problem.</p> <p>There is a bug with the SPEEX codec as noted here: <a href="http://tech.groups.yahoo.com/group/flexcoders/message/144047" rel="nofollow" title="Microphone soundTransform and SPEEX codec bug">Microphone soundTransform and SPEEX codec bug</a></p> <p>This bug basically says that using the SPEEX codec ignores the sound transform. As a work around for this I setup a toggle function to switch the settings for the microphone to display activity before the audio is attached to a NetStream and to work around the bug.</p> <blockquote> <p>Note: A Microphone object only dispatches Activity events when your application is monitoring the microphone. Thus, if you do not call setLoopBack( true ), add a listener for sample data events, or attach the microphone to a NetStream object, then no activity events are dispatched. <a href="http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7d0c" rel="nofollow">AS3 Docs</a></p> </blockquote> <p>Setup the Mic: (m is an instance variable)</p> <pre><code>m = Microphone.getMicrophone(); m.setSilenceLevel(0); m.gain = 75; m.setUseEchoSuppression(true); m.rate = 16; //rate only applies to NELLYMOSER Codec - but 16 kHz matches SPEEX default setting m.setLoopBack(true); //necessary to get activity m.codec = SoundCodec.NELLYMOSER; //this is default m.soundTransform = new SoundTransform(0); //mute so you don't get crazy echo! </code></pre> <p>Toggle for 'offline' and 'online' activity monitoring</p> <pre><code>protected function audioMeterToggle(switch:String) { if(switch == "offline") { m.setLoopBack(true); m.soundTransform.volume = 0; m.codec = SoundCodec.NELLYMOSER; } else { m.setLoopBack(false); m.soundTransform.volume = 1; m.codec = SoundCodec.SPEEX; } } </code></pre> <p>Switching codecs helps reduce bandwidth.</p> <p>Hope this helps save someone some time.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload