Record Sound in Android using ActionScript 3 -
i build application record sound in desktop using actionscript 3 , convert application andriod application there problem sampledataevent.sample_data event doesn't receive data record here code :
private var _microphone:microphone; private var _buffer:bytearray = new bytearray(); private var _difference:uint; public function record():void { if ( _microphone == null ) _microphone = microphone.getmicrophone(); _difference = gettimer(); _microphone.setsilencelevel(_silencelevel, _timeout); _microphone.gain = _gain; _microphone.rate = _rate; _buffer.length = 0; _microphone.addeventlistener(sampledataevent.sample_data, onsampledata); _microphone.addeventlistener(statusevent.status, onstatus); } private function onsampledata(event:sampledataevent):void { _recordingevent.time = gettimer() - _difference; dispatchevent( _recordingevent ); var butedata:number; while(event.data.bytesavailable > 0) { butedata = event.data.readfloat(); _buffer.writefloat(butedata); soundbytes.writefloat( butedata); } }
anyone can here thanx
i think, maybe don't check out air android settings. if not checked in record_audio. should check it.
refer below image.
Comments
Post a Comment