Hi jcl!
As you already know, I want to use the built in sound functions for my VoIP feature. Now I ran over two new problems and I need you knowledge to solve them:
1) For VoIP, my application records a stream during runtime and splits the recorded stream into small 20 ms packets. These are sent over the network and then played with snd_play(). This is working well, but I noticed small noises/delays between the calls.
To explain the problem, try the following:
//Lite-C:
function main()
{
wait(1);
while(1)
{
SOUND* dummy_snd = snd_create("dummy.wav");
var sndhandle = snd_play(dummy_snd,100,0);
while(snd_playing(sndhandle)) {wait(1);}
snd_remove(dummy_snd);
wait(1);
}
}
dummy.wav is a tone. The output should be one long tone, but in reality between the snd_play() instructions small delays/noise can be heard.
Get the soundfile
here (use dummy.wav).
What can I do against this delay/noise?
2) Using ent_playsound() in a thread causes a crash. But I would need ent_playsound() also to be threadsave so that I can make a 3d VoIP.
What shell I do? Any possibility that this function gets threadsafe in one of the next updates?
Thanks for your help!