Speex format support for compressed voice files

Posted By: Orange Brat

Speex format support for compressed voice files - 06/07/07 10:01

3DGS already has ogg support, so it would only make sense to complement it with support for Speex given it uses ogg as a container. I can convert any audio format to a Speex file using the new encoder provided by dBpoweramp, but we need a way for the engine to open the format and spit out the sound.

http://www.speex.org/

Quote:

Speex is an Open Source/Free Software patent-free audio compression format designed for speech. The Speex Project aims to lower the barrier of entry for voice applications by providing a free alternative to expensive proprietary speech codecs. Moreover, Speex is well-adapted to Internet applications and provides useful features that are not present in most other codecs. Finally, Speex is part of the GNU Project and is available under the revised BSD license.




The developers of the AI project Façade integrated Speex and the download size of the application plummeted from 800MB to 167MB, so the space savings are significant for projects featuring large amounts of audio.


Just in case Conitec says no way......


If there are any bored programmers are out there who might want to take a crack at creating an A6/A7 compatible DLL to allow 3DGS to open/read the Speex format, this would be most appreciated. Please post here or in User Contributions if someone should ever decide to do so. Information relevant for programming needs is here: http://www.speex.org/docs/

If someone has already done this, please post a link if it's a public application. I know A.Russell had mentioned it a while back, but there hasn't been any movement on that front in some time.

Posted By: fastlane69

Re: Speex format support for compressed voice files - 06/07/07 19:00

Quote:

large amounts of audio.





...or large amounts of speech?
I ask because lot's of 3DGS games have the former but almost none the latter.

And I have to admit I have no idea what the difference between speech and audio would be nor how the compression scheme would be different.
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/08/07 00:00

Good catch, I meant large amounts of speech. For audio, you can use the already supported Vorbis format (ogg). According to what I've read, Speex is designed specifically for speech. That dBpoweramp codec page says specifically not to use it for music. I guess it's "smart" enough to know the difference, and I don't see why the same company would create two formats, one for standard audio (Vorbis) and another for speech (Speex). The also have their answer to MPEG4 video called Theora (Wintermute Engine has supported this for sometime), and a few other projects, but Speex, Theora, and Vorbis (which 3DGS can already read) are the main ones for us.

Anyway, thanks for catching that. It actually does make a difference. I'm going to do a bit more research on it, and if I find anything that really outlines the difference between "speech" and "audio" I'll post it here.


@jcl: When you see this, if you could verify whether you might add this to your todo list, I would appreciate it greatly. It's not one of those "I need it now not yesterday" deals, but it would determine my next move in regards to a 3rd party alternative sooner rather than later. If you think it might make it in (should you decide to implement it) say in the next 6 months, then that's fine by me. I'm getting to the point in my project where I'm needing to make some decisions (some free, some not), so I'm in a heavy duty organizing mode. Sorry if I become a bother. Implementing Theora playback would be nice, too.
Posted By: xXxGuitar511

Re: Speex format support for compressed voice file - 06/08/07 05:27

speech requires a lot less detail, and can be compressed differently to save space. Speech is mostly mid-range. Not too much of the high's or lows...
Posted By: adoado

Re: Speex format support for compressed voice file - 06/08/07 06:13

Is Speex just a codec for audio or is it strictly for VOIP - as I have seen it used in VOIP applications..?

Thanks,
Adoado
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/08/07 06:21

Probably both. All 3DGS needs is the ability to open it up and play the format. The dBpoweramp audio convertor I linked to has an encoder plugin and it'll compress a non-compressed original voice file (probably a WAV) to the spx format. If you don't use any spoken dialogue or very little then it probably isn't something to use, however for projects with ALOT of spoken dialogue this is what it would be best used for. See the Facade example I gave in the first post. I remember when it was first released it was a massive 800MB download. I just recently looked at it again after a recent story on it posted at Gamasutra and as of version 1.1 everything had been compressed to the spx format and it reduced the size to 167MB (13XMB for the Mac version since an additional bit of info. isn't required for the Mac version).

While it is true that a lot of 3DGS projects aren't using a lot of spoken dialogue, it's also true that a lot aren't using bones animation, shaders, or multiplayer, yet we have access to those features should we need them. I'd love to be able to use Vorbis for music (which I am), Speex for speech, and Theora for any video files I include. All three formats are stored inside an OGG file, so it's a matter of including the other format (or two if Theora ever makes it in). I just hope the audio "hiccup" that others have cited can be eliminated. The entire process is pointless if a split second delay occurs every single time a new audio file is loaded. The Open Al and FMOD plugins eliminate this hiccup, but would it exist if 3DGS natively supported Speex?
Posted By: adoado

Re: Speex format support for compressed voice file - 06/08/07 06:33

Oh ok then. So a Speex file is saved as a .spx? Or is it in a .ogg file? Just curious as I am searching the net now for a way to play speex files. Maybe if I can find the right resources I could do something...

So far I cannot find many resources on this

Thanks,
adoado.
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/08/07 10:50

From what I gather, the data is contained in the spx format but is stored in the ogg file, and you have to parse it or whatever. Given 3DGS will read an ogg audio file, I'm assuming they're parsing the Vorbis file from it. Ogg is the "transparent layer" container object that all of their formats are stored in (vorbis, theora, speex, etc). Check out the documentation section at the Speex site for technical info: http://www.speex.org/docs/api/speex-api-reference/index.html. Info related to their video format is at http://www.theora.org/.

That encoder I keep mentioning (see my initial post for link) compresses an audio file into the spx format, so I'm assuming this needs to be "placed" into an ogg file or perhaps it can be read in the raw spx format. That info is likely on the speex site and would be something for a potential programmer or Conitec to research.

Quote:


Speex is based on CELP and is designed to compress voice at bitrates ranging from 2 to 44 kbps. Some of Speex's features include:








-Narrowband (8 kHz), wideband (16 kHz), and ultra-wideband (32 kHz) compression in the same bitstream
-Intensity stereo encoding
-Packet loss concealment
-Variable bitrate operation (VBR)
-Voice Activity Detection (VAD)
-Discontinuous Transmission (DTX)
-Fixed-point port
-Acoustic echo canceller
-Noise suppression









Note that Speex has a number of features that are not present in other codecs, such as intensity stereo encoding, integration of multiple sampling rates in the same bitstream (embedded coding), and a VBR mode; see our comparison page for more.




Posted By: fastlane69

Re: Speex format support for compressed voice file - 06/08/07 19:50

Interesting. Never thought of speech as different than music but I guess it really is. The frequency range, the modulation, the timing...

It would be interesting to see how many people would actually use this. After all, not many people use or need to use speech in their games. And I'm not sure this would change if it were readily available in 3DGS.

Don't know. Never thought of using speech myself. Might be worthwhile to poll the community and see not how many people would use it (cause then everyone will jump on the bandwagon) but rather how many people have THOUGHT of using speech in their game.
Posted By: xXxGuitar511

Re: Speex format support for compressed voice file - 06/09/07 05:52

Speech is not on my priority list for my current project, so I will save it until my project is becomming finished. My project is small and won't require too much speech, just little phrases every now and then, so I'm not really in need of this right now.

However, if you were creating an RPG then long texts might be really important
Posted By: tompo

Re: Speex format support for compressed voice file - 06/09/07 07:49

I will vote for YES!

why? because sometimes spech is needed even in FP-S games like narrator's voice, online helper's voice, tutorial's voice or something and of'course RPG with dialogues.

If this will save memory and increase fps... why not?!?! Even if I don't need it right now, but when my game will be in final touch it will be usefull.
It's like a terrain generator.... some people need it someone not, becouse they are making space shooter, but it should be added

I hope You undarstand my Polish-English middle Atlantic language
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/09/07 11:00

The terrain editor/generator analogy is a pretty good one. Shaders is another. Some need it, some don't. Large amounts of speech are basically the norm in commercial games these days, but if you don't use very much speech then it probably wouldn't be a priority.

I'm creating a traditional, adventure game with a 129-page script (just for the dialogue and narration for the story portion...this doesn't include descriptions of objects, idle chatter when talking to someone during interactive portions, etc), and it would be commercial suicide to not add speech to the game. Back in the old days, you could d/l optional speech packs but this isn't the old days. I'm hoping Speex will pop up on the beta page sometime in the next weeks/months (hey, my behind the view negative numbers idea is in beta now so anything is possible ), so I'll just hold my breath, pass out, and check when I come to. Given the amount of speech I'll require, you can see why I have an interest in something like this.

If it never makes it in, there's always a 3rd party approach, and perhaps A.Russell will add it to his AL Plugin as he said he may someday. He's been gone for a while, so I hope he sees my post in his thread whenever he makes it back. I'll take either way...Conitec,, A.Russell, or someone else if I have to fork over a bit of green to make it happen.
Posted By: Felixsg

Re: Speex format support for compressed voice file - 06/12/07 11:17

I not renember well but think gamestudio support that.
but not all the windows versions? support adpcm compresion
in wav files (can be 4 bit audio, only for voice) and then the files are more small

"ADPCM Audio Codec" coming with all version of windows
probably you can save with audio software in that format
diferent types of compression if you like music but with very bad quality
but for voice are perfect, think the speex if for use if your program in other operating system, but gamestudio only runs in windows
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/12/07 11:21

Speex is a 3rd party format. It's stored in a spx file which is contained in the ogg file. 3DGS supports ogg, but it's for Vorbis audio only. Speex is a separate thing designed for voice compression only. They have a 3rd one called Theora for video compression, and it's supposed to compete with MPEG4. All three formats are stored in a ogg file. 3DGS only supports Vorbis at the moment, and I'm request for both Speex and Theora; however Speex would be higher priority for now.
Posted By: Felixsg

Re: Speex format support for compressed voice file - 06/12/07 11:25

Quote:

Speex is a 3rd party format. It's stored in a spx file which is contained in the ogg file. 3DGS supports ogg, but it's for Vorbis audio only. Speex is a separate thing designed for voice compression only. They have a 3rd one called Theora for video compression, and it's supposed to compete with MPEG4. All three formats are stored in a ogg file. 3DGS only supports Vorbis at the moment, and I'm request for both Speex and Theora; however Speex would be higher priority for now.




And support wav think and wav can be compressed with the adpcm codec
only is a option in the quality from 16 bit to 4 bit
I not sure but think is that possible
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/12/07 11:30

Yes, I'm concerned about quality, as well as the final size. The best quality possible and the smallest size possible is the ultimate goal; however I would rank quality above size for my own purposes. My title features a large amount of speech, so I don't know if a compressed WAV file would be beneficial; however I know nothing about adpcm, nor if it is readable by 3DGS.
Posted By: xXxGuitar511

Re: Speex format support for compressed voice file - 06/12/07 18:26

Even if you limit the quality of the WAV for voice, WAV is a horrible format. They are the bitmaps of sound, no compression. Speex is more similar to an mp3, better compression but with limited channels optimized for voice...
Posted By: Felixsg

Re: Speex format support for compressed voice file - 06/13/07 14:57

Quote:

Even if you limit the quality of the WAV for voice, WAV is a horrible format. They are the bitmaps of sound, no compression. Speex is more similar to an mp3, better compression but with limited channels optimized for voice...




Them I don't know but think yes what formats support .ogg
not have any very low bits (8kbits) for voice
I can check but At the moment I not use

but with audacity probably is can confirm
Sourceforge
Posted By: Orange Brat

Re: Speex format support for compressed voice file - 06/13/07 15:21

As I've stated many times, ogg supports Vorbis (audio), Theora (MPEG4-quality video), and Speex (speech) (and maybe others from http://www.xiph.org/). Ogg is simply a container. They also created the excellent and widely used FLAC lossless format. In fact, it's probably the most widely used of the various lossless codecs.
© 2024 lite-C Forums