Jump to content
  • Advertisement
Sign in to follow this  

speech/audio compression

This topic is 2860 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

(This is for an FPS game)

I want in game voice and I tried my own compression algorithm, but without optimizing it I compress to maybe half.

My main questions on this topic are:
What is a reasonable amount of bytes per second to send? Currently I only send packets when a player presses a key or lets go of a key. So my packets are normally no more than maybe 50 bytes sent from a player each second.

So when I add in audio, I don't know what I'm expecting to not get lag. 1MB of audio in a second is obviously huge. So what is reasonable?

Has anyone used "Speex". I tried using the API, but when I encode/decode it gives me completely bogus numbers.

Share this post


Link to post
Share on other sites
Advertisement
Speex is a wonderful codec, and for the 10-30 kbps range, it's really hard to beat.

I've used it several times to good effect. You should encode, then decode, then listen to it -- "bogus numbers" doesn't say much.

Share this post


Link to post
Share on other sites
Well I went through the code and then said I gotta be doing something wrong. So I used their sample.c file, and still bogus.

Bogus = regardless if I send in a float array of all '25.5' or '45.5', I will get the same result from encoding. Of course it compiles fine. I can remove the DLL and it doesn't crash though, which leads me to believe the library is not correct and not linking to the right code somewhere. I also took the source and built to a static library as well. Tried different versions of the source too.

Share this post


Link to post
Share on other sites
Quote:
Original post by dpadam450
Bogus = regardless if I send in a float array of all '25.5' or '45.5', I will get the same result from encoding.


You are aware that from an audio perspective, an array of all '25.5' and one of all '45.5' are the same thing, correct? Hint: it's the same as an array of all '0.0'.

Share this post


Link to post
Share on other sites
Very valid point. I've been up so late reading different algorithms and such and I didn't think about that. Will give it a try thanks.

Share this post


Link to post
Share on other sites
That didn't do anything either, I can send in all .5, or I can send in a full second of recorded data in 160 byte chunks, and each encode it does, gives back the same result of data every single time. I just don't know what could be setup wrong. I know there was something with LIBC.lib at first and I managed to get rid of that problem. Maybe that actually broke it?

When I call speex_encode it modifies my input as well. I'm assuming it is modifying it to what values where actually encoded? It just is giving wrong data.

[Edited by - dpadam450 on July 21, 2010 6:56:48 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!