[Speex-dev] RFC 5574 and multiple frames

Marian Kechlibar marian.kechlibar at circletech.net
Tue Nov 24 00:24:28 PST 2009


Hi Jean-Marc,

thank you for your answer. The situation I am in is a bit complicated,
though...

1. I am not sure whether I understand VAD correctly, but in my view,
VAD, when it actually detects silence, starts producing zero-length
frames which do not have to be sent to the remote party, and, from time
to time, some comfort noise packets. Is that right? If not, please feel
free to correct me.

2. Now imagine this: your code wants to send, say, at most 3 Speex
frames per RTP packet. It is running with VAD active. The code collects
frames, and, as soon as it has collected 3 frames, it sends them in a
RTP packet to the remote party. But, with VAD, one has to be a bit more
careful: namely, if you collect two "regular" voice frames and then the
codec detects silence, you want to send those two collected frames
immediately, OK? Is there any way how to find out when exactly the codec
switched to silence and whether the latest frame produced by the
speex_encode() function was "regular", or zero-length silence packet, or
a comfort noise packet?

Best regards

Marian Kechlibar

Jean-Marc Valin napsal(a):
> Hi,
>
> The Speex bit-packer already does everything you need. Just call speex_encode()
> multiple times to encode multiple frames and call speex_decode() multiple times
> to decode these frames.
>
>    Jean-Marc
>
>
> Quoting Marian Kechlibar <marian.kechlibar at circletech.net>:
>
>   
>> Hello all,
>>
>> I am experimenting with Speex in a mobile VoIP application, and it seems
>> that it is worth stuffing more than one codec frame into a single RTP
>> packet; mainly, that sending several frames per packet relieves the
>> underlying network socket connection, which is notoriously problematic
>> in mobile devices.
>>
>> RFC 5574 defines the exact way how to put multiple Speex frames into a
>> single RTP packet, and how to extract them again. However, the frame
>> boundaries are not on octet boundaries, and I am quite confused on how
>> to actually format the RTP payload from multiple frames.
>>
>> Does the current code of speex contain an utility which would package
>> multiple Speex frames into a block according to RFC 5574, and extract
>> them again? Or do I have to write this packing/unpacking code myself? I
>> tried some searching, but no I found no reference implementation of the
>> formatting...
>>
>> BR,
>>
>> Marian Kechlibar
>>
>>
>>
>> _______________________________________________
>> Speex-dev mailing list
>> Speex-dev at xiph.org
>> http://lists.xiph.org/mailman/listinfo/speex-dev
>>
>>
>>     
>
>
>
>   



More information about the Speex-dev mailing list