# Recording sound using timer

**URL:** <https://forum.kirupa.com/t/recording-sound-using-timer/324731>\
**Category:** flash\
**Created:** [September 6, 2011, 8:04am UTC](https://forum.kirupa.com/t/recording-sound-using-timer/324731 "2011-09-06T08:04:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zen08](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@Zen08](https://forum.kirupa.com/u/Zen08)\
**Post date:** [September 6, 2011, 8:04am UTC](https://forum.kirupa.com/t/recording-sound-using-timer/324731/1 "2011-09-06T08:04:42Z")

</div>

Hi guys.

need a big little help on how could i record the precise time(in milliseconds) where sound effects are being played. This is what i have in mind/ or what i have done so far as an example:

[LIST=1]  
[_]i start clicking the ‘record button’ and the timer starts.  
[_]Then i play a sound effect and the time elapsed is 1.444 seconds,  
[\*]after that i stop the recording.  
[/LIST]

What i was doing is push the values of the timer elapsed into an array as a string. So when i hit the ‘play recorded clip’ button, the timer starts again but this time:

[LIST=1]  
[_]it is constantly checking for the timer  
[_]On the example i have stated above; when the time elapsed at 1.444 seconds, i expect the sound i’ve played when i recorded to play.  
[/LIST]

I have the methods needed to fire away the specific sound effect. The one thing i need help though is how could i achieve this in a better way? Coz what i’m doing right now doesn’t seem to work.

What i do is this:

```auto

// i have placed the timer elapsed in a var
// this code is inside an ENTER_FRAME listener
var timeElapsed = getTimer();

if(timeElapsed == 'storedTimeArray[0]');
{
     //basically, i'm going to call the method to play the sound effect.
}

```
