[Speex-dev] Size of each block in a circular buffer and the sample rate

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Sat May 20 13:40:25 PDT 2006


> Is frameSize in bytes?  If not, what unit is it in?  I need to know so I 
> know how big to make each element in my circular buffer.

It's in samples, regardless of whether you use floats or shorts.

> Also, do I need to call
> 
> speex_encoder_ctl( enc_state, SPEEX_SET_SAMPLING_RATE, &sampleRate );
> 
> Depending on sample rate I record my audio in?  If not, is there any 
> benefit to setting the sample rate, such as reduced bandwidth?

The only thing Speex does with the sampling rate is compute the final
bit-rate it corresponds to. If you use a "nominal" bit-rate (8 kHz for
narrowband, 16 kHz for wideband, ...), which I strongly recommend, you
don't even need to call this.

	Jean-Marc


More information about the Speex-dev mailing list