From 975d4d97e4b9459c3d21b4dc3ecd807e9c330d9a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 10 Dec 2013 21:14:13 -0600 Subject: Use Opus for VoIP Server/client VoIP protocol is handled by adding new cvars cl_voipProtocol and sv_voipProtocol, sv_voip and cl_voip are used to auto set/clear them. All users need to touch are cl/sv_voip as 0 or 1 just like before. Old Speex VoIP packets in demos are skipped. New VoIP packets are skipped in demos if sv_voipProtocol doesn't match cl_voipProtocol. Notable difference between usage of speex and opus codecs, when using Speex client would be sent 80ms at a time. Using Opus, 60ms is sent at a time. This was changed because the Opus codec supports encoding up to 60ms at a time. (Simpler to send only one codec frame in a packet.) --- src/server/sv_snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/sv_snapshot.c') diff --git a/src/server/sv_snapshot.c b/src/server/sv_snapshot.c index 71c4b86c..58136388 100644 --- a/src/server/sv_snapshot.c +++ b/src/server/sv_snapshot.c @@ -548,7 +548,7 @@ static void SV_WriteVoipToClient(client_t *cl, msg_t *msg) if (totalbytes > (msg->maxsize - msg->cursize) / 2) break; - MSG_WriteByte(msg, svc_voip); + MSG_WriteByte(msg, svc_voipOpus); MSG_WriteShort(msg, packet->sender); MSG_WriteByte(msg, (byte) packet->generation); MSG_WriteLong(msg, packet->sequence); -- cgit