The bitrate (measured in kbps) of audio data captured by Flash Player from the microphone depends on 2 big factors:

  1. the audio codec used for encoding: Speex or Nellymoser’s ASAO
  2. the sample rate used with ASAO (mic.rate) and the encode quality used with Speex (mic.encodeQuality)

When capturing data from the microphone using Flash Player you can choose between the 2 audio codecs available for encoding: Speex and NellyMoser’s ASAO (Flash Player can of course decode for playback more audio codecs including MP3 and AAC).

To set the codec, use the Microphone.codec property.

Nellymoser Asao

When using the Nellymoser codec you can choose between five different microphone sample rate values: 5, 8, 11, 22 and 44.

Each of these rates correspond to a certain sample rate value (measured in Hz), as noted in the following table:

Screen Shot 2015-09-30 at 14.17.08

A rate of 22 means the audio data will contain 22,050 samples every second. For comparison the tracks on an audio CD are sampled at 44,100 samples/second (44.1 kHz).

Each of these rate values consumes bandwidth of roughly double its value. For example the 8kHz setting consumes roughly 16kbps and 11kHz setting consumes roughly 22 kbps.

mic.rateSample rate (Hz)Bitrate (kbps)*
55,51211.025
88,00016
1111,02522.05
2222,05044.1
4444,10088.2
* Bitrate is approximate, it also depends on the microphone hardware

To set the rate, use the Microphone.rate property.

The Microphone.rate documentation also mentions the default value behaviour:

The default value is 8 kHz if your sound capture device supports this value. Otherwise, the default value is the next available capture level above 8 kHz that your sound capture device supports, usually 11 kHz.

Speex

Speex on the other hand has a fixed sampling rate of 16kHz. Speex allows control of the quality by offering us 11 different encoding quality options, from 0 to 10. Each setting translates to a different bitrate. The AS3 Reference Documentation lists the bitrate for each setting:

mic.encodingQualitySample rate (kHz)Bitrate (kbps)
0163.95
1165.75
2167.75
3169.80
41612.8
51616.8
61620.6
71623.8
81627.8
91634.2
101642.2
The bit rate values that are listed represent net bit rates and do not include packetization overhead.

To set the encoding quality, use the Microphone.encodingQuality property.

Voice Activity Detection with Speex

Speex also includes voice activity detection (VAD) and automatically reduces bandwidth when no voice is detected. For this to happen efficiently Adobe recommends that you set the silence level to 0. To set the silence level, use the Microphone.setSilenceLevel() method.

 

Further reading

VoIP Bandwidth and Microphones blog post on Adobe Connect

ActionScript 3 reference for the Microphone object

Encoding recommendations for achieving low latency with Wowza