[Speex-dev] How to get size of WB frame in bits/bytes?
Alexander.Chemeris at sipez.com
Fri Jan 25 13:45:03 PST 2008
On 1/26/08, Jean-Marc Valin <jean-marc.valin at usherbrooke.ca> wrote:
> Alexander Chemeris a écrit :
> > Is there any way to determine frame size in bits or bytes of
> > encoded frame in WB mode for given quality? That is I need
> > to know how many bits encoded frame will occupy in RTP
> > packet. I see SPEEX_SUBMODE_BITS_PER_FRAME request,
> > but it works like this only for NB mode, and for WB mode
> > it return size of WB "subframe" (?) only.
> SPEEX_SUBMODE_BITS_PER_FRAME should definitely work for both
> narrowband and wideband. How are you using it and what value does
> it return?
Well, it works in the way it is supposed to work (I guess), but not in a way
I want it to work. In case of WB it maps passed value to one of
SpeexSBMode::submodes elements, which are SpeexSubmode. And then
it just return value of corresponding SpeexSubmode::bits_per_frame.
As far as I understand how Speex is working it is only number of
bits in WB part of frame, and I have to retrive number of bits in NB part
of frame and then summ them up. But mapping of quality values to
NB/WB submode pairs are hidden inside libspeex and is not accessible
from API. Am I correct?
SIP VoIP, IM and Presence Consulting
tel: +1 (617) 273-4000
More information about the Speex-dev