The Speex docs say that it's 'mainly' designed for 8/16/32kHz sampling rates. Most PC inputs seem to report sampling rates of 8kHz, 16kHz and 44.1kHz.
Does this mean I'm out of luck if I wa开发者_JAVA百科nt to use a 44.1kHz sampling rate?
Most of the sound cards reports these sampling rates but they do not prevent you to use Speex. All you have to do is to down-sample the captured audio to convert it from 44.1kHz to 32kHz so it can feed the Speex codec.
Do a search with audio resampling
on StackOverflow or Google and you will find several sample code.
Speex can handle any sampling rate (I have tested from 4kHz up to 48kHz, but Speex can do probably even higher), but it is optimized for 8 (narrow band), 16 (wide band) and 32kHz (ultra wide band). For my application, 24kHz (using wide band) sounds good (I find it better sounding than 32kHz at the same bitrate, but this depends on the audio material and taste).
I've found that jSpeex will encode audo recorded at 44.1kHz and this can be decoded by the command line tools (i.e., speexdec
).
精彩评论