Voice Chat

So, guess what I got distracted with. That's right voice chat. I was doing some reading on the OpenAL API and noticed it had support for both streaming and audio capture.

So of course first thing I think of is voice chat for the game. So in my excitement I pounded out a nice chunk of code related to voice chat.

The idea of it being that you would hear people within ear shot and OpenAL would take care of the direction modification & volume relative to distance.

The game's networking code is already designed to be relatively low latency so I should be able to pull this off. However there are a couple tricks.

One is Managing all of those OpenAL resources. I'm pretty sure there are a limit to the number of sources etc you can have. I'm not sure if those are just active ones aka ones playing or if it is a hard limit in the API. So I don't know if just creating them in the scene nodes will work like I want it too.

Second is making my messages efficient. I believe voip only sends data when it is not dead air. I would like to replicate that as best as I can so it will work correctly. However I don't know how to manipulate the sound buffer. So at least for now the voice chat is started and stopped with the middle mouse button. If the user hits the button right before they speak and lets off right after then it should be relatively efficient with the exception of the dead space in normal speak.

So now that I got everyone all excited I have some bad news. All of the work I did is worthless until I get all the movement logic completed. Also there is quit allot more work that needs to be done to the actual voice chat code to make it work.

For one I'm not processing voice chat messages client side and the server isn't even looking at them. Also the Client isn't sending voice chat messages and I haven't created an object to contain the wave data.

So I have some basic bits in place but not even close to enough to make this thing work yet.

I plan to implement this the rest of the way in the future but I would like to get my actual 0.1.0 goals completed before I start going for bonus items.

No guarantee I won't see some cool code and get distracted again though. Sorry folks it's how I roll.


  1. i think i just got re-excited about things

  2. Lol, ya.

    I want you to know this is allot of work though. I found a plugin to count lines of code finally.

    In the client alone there are 11,667 lines of code.

    In the server there are 8,838 lines of code.

    So basically I'm almost at 20k lines of code and you can't even see other people yet.


Post a Comment

Popular posts from this blog

VK9 - Milestone8 Completed

VK9 - Milestone13 Completed

VK9 - Milestone16 Completed