audio - Draw waveform for microphone in flex, is it possible? -
i'm making audio recorder adobe flex (microphone, netstream), want current audio wave microphone display in visualization area, idea how can data?
you'll need using flash player 10 think that's first time got access to microphone apis.
then there's simple function can call microphone data:
private var soundbytes:bytearray = new bytearray; soundmixer.computespectrum(soundbytes, false);
i call computespectrum code in enter frame handler , draw out wave form there.
edit: don't want mislead you. think above code pre-recorded audio file. if want user microphone in flash 10. this:
private var _mic:microphone; _mid = microphone.getmicrophone(); _mic.addeventlistener( sampledataevent.sample_data, onsampledata ); protected function onsampledata( event:sampledataevent ):void { while( event.data.bytesavailable ){ var n:number = event.data.readfloat(); } }
Comments
Post a Comment