bool SendAudio(COMData_audio audio) { string header = COMData.macroInit + audio.type + COMData.macroSeparator + audio.data.Length + COMData.macroEnd; Log.Debug(header); socket.Send(System.Text.Encoding.UTF8.GetBytes(header)); int bytesSent = socket.Send(audio.data); return(bytesSent == audio.data.Length); }
void ReceiveAudio(int audioSize) { COMData_audio audio = new COMData_audio(); audio.data = new byte[audioSize]; int sizeReceived = socket.Receive(audio.data); if (audioSize == sizeReceived) { infoReceived.Enqueue(audio); Log.Debug("Image Received: " + audio.data.Length); } }
void ReceiveAudio(int audioSize) { COMData_audio audio = new COMData_audio(); audio.data = new byte[audioSize]; int sizeReceived = socket.Receive(audio.data); if (audioSize == sizeReceived) { server.infoReceived.Enqueue(new KeyValuePair <int, COMData>(id, audio)); Log.Debug("Audio Received: " + audio.data.Length); } }