# Recording voice with Microphone and attach to a movieclip and playback(Stand alone)

**URL:** https://forum.kirupa.com/t/recording-voice-with-microphone-and-attach-to-a-movieclip-and-playback-stand-alone/197962
**Category:** Uncategorized
**Created:** [August 21, 2006, 10:29am UTC](https://forum.kirupa.com/t/recording-voice-with-microphone-and-attach-to-a-movieclip-and-playback-stand-alone/197962 "2006-08-21T10:29:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nish](https://avatars.discourse-cdn.com/v4/letter/n/9dc877/32.png) [@nish](https://forum.kirupa.com/u/nish)
#### Post date: [August 21, 2006, 10:29am UTC](https://forum.kirupa.com/t/recording-voice-with-microphone-and-attach-to-a-movieclip-and-playback-stand-alone/197962/1 "2006-08-21T10:29:25Z")

</div>

Dear all,  
I am trying to record speech using a microphone (stand alone) and attach it to a movieclip. As I am a newbie, can’t figure out what’s wrong. This is the code that I am using. I am writing this code for the button: btn\_record.

TEST\_record.fla is also attached.  
Finally, How can I payback the attached audio file?  
Please help.

* * *

on(press){

var activityLevel\_pb:mx.controls.ProgressBar;

activityLevel\_pb.mode = “manual”;  
activityLevel\_pb.label = “Activity Level: %3%%”;

this.createEmptyMovieClip(“sound\_mc”, this.getNextHighestDepth());

var active\_mic:Microphone = Microphone.get();  
sound\_mc.attachAudio(active\_mic);  
active\_mic.onActivity = function(active:Boolean) {  
if (active) {  
activityLevel\_pb.indeterminate = false;  
activityLevel\_pb.label = “Activity Level: %3%%”;

} else {  
activityLevel\_pb.indeterminate = true;  
activityLevel\_pb.label = “Activity Level: (inactive)”;  
}  
};  
this.onEnterFrame = function() {  
activityLevel\_pb.setProgress(active\_mic.activityLe vel, 100);  
};

}

* * *

thanks in advance  
Nish
