Original Post
Hello, I'm working on voice chat and I have a second thread that gets the user voice each milisecond and sends it to the server. What I want to know is how can I get the 'sound' into a variable so I can send it to the server through Winsock for a structure? Also if someone can correct me on this source code if I have something that isn't right about the recording let me know, I haven't tested this yet.
while(!quitThread)
{
system->recordStart(0, sound, true);
Sleep(1);
system->recordStop(0);
channel->stop();
sendPack.code = 0; Letting the server know this is a voice.
//Example of what I am looking for.
sound.GetSoundBuffer(sendPack.buffer); //Get the recorded sound made in a milisecond.
//Winsock send function
send(s, (char const *)&sendPack, (int) sizeof(sendPack), 0);
}