03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See also<br />

gain (Microphone.gain property), setUseEchoSuppression<br />

(Microphone.setUseEchoSuppression method)<br />

setRate (Microphone.setRate method)<br />

public setRate(rate:Number) : Void<br />

Sets the rate, in kHz, at which the microphone should capture sound.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Parameters<br />

rate:Number - The rate at which the microphone should capture sound, in kHz. Acceptable<br />

values are 5, 8, 11, 22, <strong>and</strong> 44. The default value is 8 kHz if your sound capture device<br />

supports this value. Otherwise, the default value is the next available capture level above 8<br />

kHz that your sound capture device supports, usually 11 kHz.<br />

Example<br />

The following example sets the microphone rate to the user's preference (which you have<br />

assigned to the userRate variable) if it is one of the following values: 5, 8, 11, 22, or 44. If it<br />

is not, the value is rounded to the nearest acceptable value that the sound capture device<br />

supports.<br />

active_mic.setRate(userRate);<br />

The following example lets you use a ComboBox instance, called rate_cb, to change the rate<br />

at which your microphone captures sound. The current rate displays in a Label instance called<br />

rate_lbl.<br />

this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());<br />

var active_mic:Microphone = Microphone.get();<br />

sound_mc.attachAudio(active_mic);<br />

var rate_array:Array = new Array(5, 8, 11, 22, 44);<br />

rate_cb.dataProvider = rate_array;<br />

rate_cb.labelFunction = function(item:Object) {<br />

return (item+" kHz");<br />

};<br />

for (var i = 0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!