Sign in to follow this  

Voice transmission?

This topic is 3593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can i send and then play voice over a connection? and what connection is better for this? TCP or UDP? I'm interested in making an ingame chat without occupying too much bandwidth..... :)

Share this post


Link to post
Share on other sites
Raknet supports voice chat.

Other options would be Ventrillo or TeamSpeak.

Doing it yourself however is a non-trivial task. You need a way to record and replay sound and some form of compression, usually tied to the networking protocol you use.

Using either TCP or UDP is fine, characteristics of them remain the same.

Quote:
I'm interested in making an ingame chat without occupying too much bandwidth


Bandwidth isn't really an issue. It's timely delivery and consequently handling packet loss that are more important. This would be biggest argument against TCP.

Share this post


Link to post
Share on other sites
Quote:
Using either TCP or UDP is fine, characteristics of them remain the same.


Do not use TCP for voice chat. If a single packet is lost, you will end up with significant talk delays because of the resend time.

Typical voice chat one-way structure:


void SenderLoop() {
while (Running) {
AccumulateMicrophoneData();
while (AccumulatedData() >= DataNeededForOneCompressedFrame) {
CompressAndSendOneFrame();
}
}
}

void ReceiverLoop() {
OutputBuffer buf = new Buffer(DejitterLatency);
while (Running) {
while (PossiblyReceivePackets()) {
DecodePacketAndAddToBuffer(buf);
}
while (SoundOutputHasSpace()) {
AddDataFromBuffer(buf);
}
}
}


Share this post


Link to post
Share on other sites

This topic is 3593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this