In my as3 application i capture sound input using Microphone class. But i faced with problem.
Duration of my recording less then original sound. The problem is easily reproduced if put a microphone device near the sound speakers.
I begin to play local mp3 using Sound class and put microphone samples into byte array. After that i save byte array with microphone samples into local file (raw data) and load this file to Audacity. Also i load to Audacity original mp3 file.
The picture shows two sound waves as it shows in the Audacity.

I expect to see in the Audacity two synchronized sound waves - record and original sound. But i see by the end of the recording out of sync increase. And at the end i see different durations.
And one more thing. I have 2 computers for my tests. This problem occurs on first computer if i initialize microphone with rate 44100, but if i set rate 22050 problem there is no. On the second computer is no problem at all - neither with a rate of 44100, nor with the rate 22050.
Does anyone had this problem? Why this occur?
Hope on your help, thanks!