I'm making a voice chat using audio streaming. Everything works fine; I can talk into mic and voice is sent to client and sound is played in sync. However, I come upon a slight little problem that I didn't expect.
As long as both client and server apps are not disturbed the sound is sent to other app and other app plays it back immediately but if either app is disturbed, like if user mouse down on titlebar and moves Form around, the sound is buffered but not played until user releases mouse. This causes a delay from the time I send voice and the other app plays it back. So, if a user is moving his Form around and, let's say it took him 30 seconds to stop moving the Form and then releases the mouse it will take about 30 seconds before he can hear the playback, Now, he is out of sync and all sound from this point on will be out of sync. If he does it again then the delay just gets greater.
My question is, is there a way to prevent this from happening. What can I do so that the sound is not interfered with. Any suggestions.
As long as both client and server apps are not disturbed the sound is sent to other app and other app plays it back immediately but if either app is disturbed, like if user mouse down on titlebar and moves Form around, the sound is buffered but not played until user releases mouse. This causes a delay from the time I send voice and the other app plays it back. So, if a user is moving his Form around and, let's say it took him 30 seconds to stop moving the Form and then releases the mouse it will take about 30 seconds before he can hear the playback, Now, he is out of sync and all sound from this point on will be out of sync. If he does it again then the delay just gets greater.
My question is, is there a way to prevent this from happening. What can I do so that the sound is not interfered with. Any suggestions.