speech/audio compression

Started by
4 comments, last by dpadam450 13 years, 9 months ago
(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.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

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.
enum Bool { True, False, FileNotFound };
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.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

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'.

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.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

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]

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement