Difference between revisions of "Speex FAQ"
(Added note about resampler)
|Line 104:||Line 104:|
=== Can I use Speex for 22.05 kHz, 44.1 kHz or 48 kHz signals? ===
=== Can I use Speex for 22.05 kHz, 44.1 kHz or 48 kHz signals? ===
Yesyou . Speex is optimised for 8 kHz and 16 kHz and it can (your mileage may vary) encode 32 kHz files as well. Anything else is unsupported and tends to be heavily sub-optimal. You might as well use Vorbis instead.
== Technical ==
== Technical ==
Revision as of 08:14, 14 October 2007
- 1 General
- 1.1 Vorbis is free software and patent-free; why do we need Speex?
- 1.2 Isn't there a free software implementation of the GSM-FR codec? Why is Speex necessary?
- 1.3 Ogg, Speex, Vorbis, what's the difference?
- 1.4 What's the extension for Speex files?
- 1.5 Can I use Speex for compressing music?
- 1.6 I converted some MP3s to Speex and the quality is bad. What's wrong?
- 1.7 How does Speex compare to other proprietary codecs?
- 1.8 Can Speex pass DTMF?
- 1.9 Can Speex pass V.9x modem signals correctly?
- 1.10 Does Speex have anything to do with the University of Sherbrooke?
- 1.11 When will version X of Speex be released
- 1.12 How can I help if I don't know about speech processing?
- 2 License
- 3 Using libspeex
- 3.1 Does Speex run on Windows?
- 3.2 Why is encoding so slow compared to decoding?
- 3.3 Why is Speex so slow on my iPaq (or insert any platform without a FPU)?
- 3.4 I'm getting unusual background noise (hiss) when using libspeex in my application. How do I fix that?
- 3.5 I get very distorted speech when using libspeex in my application. What's wrong?
- 3.6 Can Speex run on fixed-point processors or DSPs?
- 3.7 What architectures are supported?
- 3.8 Can I use Speex for 22.05 kHz, 44.1 kHz or 48 kHz signals?
- 4 Technical
Vorbis is free software and patent-free; why do we need Speex?
Vorbis is a great project but its goals are not the same as Speex. Vorbis is mostly aimed at compressing music and audio in general, while Speex targets human speech only. For that reason Speex can achieve much better results than Vorbis on speech, typically 2-4 times higher compression at equal quality.
Isn't there a free software implementation of the GSM-FR codec? Why is Speex necessary?
First of all, it's not clear whether GSM-FR is covered by a Philips patent (see http://kbs.cs.tu-berlin.de/~jutta/toast.html). Also, GSM-FR offers mediocre quality at a relatively high bit-rate, while Speex can offer equivalent quality at almost half the bit-rate. Last but not least, Speex offers a wide range of bit-rates and sampling rates, while GSM-FR is limited to 8 kHz speech at 13 kbps.
Ogg, Speex, Vorbis, what's the difference?
Ogg is a container format for holding multimedia data. Vorbis is an audio codec that uses Ogg to store its bit-streams as files, hence the name Ogg Vorbis. Speex also uses the Ogg format to store its bit-streams as files, so technically they would be "Ogg Speex" files, but you should perceive them as Speex files. One difference with Vorbis however, is that Speex is less tied with Ogg. Actually, if you just do Voice over IP (VoIP), you don't need Ogg at all.
What's the extension for Speex files?
Speex files tend to have the .spx extension. Note, however that the Speex tools (speexenc, speexdec) do not rely on the extension at all, so any extension will work.
Can I use Speex for compressing music?
Just like Vorbis is not really adapted to speech, Speex is really not adapted for music. In most cases, you'll be better of with Vorbis when it comes to music.
I converted some MP3s to Speex and the quality is bad. What's wrong?
This is called transcoding and it will always result in much poorer quality than the original MP3. Unless you have a really good (size) reason to do so, never transcode speech. This is even valid for self transcoding (tandeming), i.e. If you decode a Speex file and re-encode it again at the same bit-rate, you will lose quality.
How does Speex compare to other proprietary codecs?
It's hard to give precise figures since no formal listening tests have been performed yet. All I can say is that in terms of quality, Speex competes on the same ground as other proprietary codecs (not necessarily the best, but not the worst either). Speex also has many features that are not present in most other codecs. These include variable bit-rate (VBR), integration of narrowband and wideband, as well as stereo support. Of course, another area where Speex is really hard to beat is the quality/price ratio. Unlike many very expensive codecs, Speex is free and anyone may distribute or modify it at will.
Can Speex pass DTMF?
I guess it all depends on the bit-rate used. Though no formal testing has yet been performed, I'd say is correctly at 8 kbps and above. Also, make sure you don't use the lowest complexity (see SPEEX_SET_COMPLEXITY or --comp option), as it causes significant noise.
Can Speex pass V.9x modem signals correctly?
If I could do that I'd be very rich by now :-) Seriously, that would break fundamental laws of information theory.
Does Speex have anything to do with the University of Sherbrooke?
No. I have written Speex while pursuing my Ph.D. at the University of Sherbrooke (2002-2005) in mobile robotics. Although I did my master with the Sherbrooke speech coding group (in speech enhancement, not coding), I was no longer associated with them when developing Speex. Furthermore, Speex does not make use of any code or proprietary technology developed in the Sherbrooke speech coding group.
When will version X of Speex be released
When it's ready, which will be sooner if you help.
How can I help if I don't know about speech processing?
There's always "semi-technical" work to do. The documentation can be improved, and so can this FAQ.
Under what license is Speex released?
As of version 1.0 beta 1, Speex is released under the new BSD license. This license is one of the most permissive free software licenses.
Am I allowed to use Speex in commercial software?
Yes. As long as you comply with the license. This basically means you have to keep the copyright notice and you can't use our name to promote your product without authorization.
Do I have to release source code if I use Speex in a proprietary application?
No. The BSD license does not require you to release any source code. It is however appreciated (but not required) if you contribute back useful changes you make to Speex. This is generally also in your interest because it means you get maintenance of that code for free (i.e. no need to merge again in newer versions).
Does Speex run on Windows?
Compilation on Windows has been supported since version 0.8.0. There are also several front-ends available from the website.
Why is encoding so slow compared to decoding?
For most kinds of compression, encoding is inherently slower than decoding. In the case of Speex, encoding consists of finding, for each vector of 5 to 10 samples, the entry that matches the best within a codebook consisting of 16 to 256 entries. On the other hand, at decoding all that needs to be done is look up the right entry in the codebook using the encoded index. Since a lookup is much faster than a search, the decoder works much faster than the encoder.
Why is Speex so slow on my iPaq (or insert any platform without a FPU)?
You probably didn't build Speex with the fixed-point option (--enable-fixed-point). Even if you did, not all modes have been ported to use fixed-point arithmetic, so the code may be slowed down by a few float operations left (e.g. in the wideband mode).
I'm getting unusual background noise (hiss) when using libspeex in my application. How do I fix that?
One of the causes could be scaling of the input speech. Speex expects signals to have a +-32767 (signed short) dynamic range. If the dynamic range of your signals is too small (e.g. +-1.0), you will suffer important quantization noise. A good target is to have a dynamic range around +=8000 which is large enough, but small enough to make sure there's no clipping when converting back to signed short.
I get very distorted speech when using libspeex in my application. What's wrong?
There are many possible causes for that. One of them is errors in the way the bits are manipulated. Another possible cause is the use of the same encoder or decoder state for more than one audio stream (channel), which produces strange effects with the filter memories. If the input speech has an amplitude close to +-32767, it is possible that at decoding, the amplitude be a bit higher than that, causing clipping when saving as 16-bit PCM.
Can Speex run on fixed-point processors or DSPs?
Yes. You can compile Speex for fixed-point CPUs by passing the --enable-fixed-point option to the configure script or defining FIXED_POINT.
What architectures are supported?
Speex is designed to run on pretty much any CPU that can do 16x16 multiplications. That includes:
- TI C5x and C6x
- dsPIC (unsupported, unofficial port)
- Cell (in progress)
...and many others
Can I use Speex for 22.05 kHz, 44.1 kHz or 48 kHz signals?
Yes, but you must resample the signal to a supported sample rate before encoding. Speex is optimised for 8 kHz and 16 kHz and it can (your mileage may vary) encode 32 kHz files as well. Anything else is unsupported and tends to be heavily sub-optimal. You might as well use Vorbis instead. Note that Speex includes a resampler module as of version 1.2beta2. Refer to the section called Resampler in the Speex documentation.
CELP, ACELP, what's the difference?
CELP stands for "Code Excited Linear Prediction", while ACELP stands for "Algebraic Code Excited Linear Prediction". That means ACELP is a CELP technique that uses an algebraic codebook represented as a sum of unit pulses, thus making the codebook search much more efficient. This technique was invented at the University of Sherbrooke and is now one of the most widely used form of CELP. Unfortunately, since it is patented, it could not be used in Speex.
Where can I get information about how Speex works?
There is not (yet) a complete description of the algorithm (except for the source code itself). However, several aspects are documented either in the manual or in the paper Improved Noise Weighting in CELP Coding of Speech — Applying the Vorbis Psychoacoustic Model To Speex.