[opus] Opus Raw Pakcets
Rizwan Ishaq
rizwanishaq at gmail.com
Fri Jun 17 15:34:44 UTC 2016
Some more question,
>(0-11) bytes(12) - Header removed
>13 byte(1) - TOC byte removed ( and it tells me that only 1 frame, mono),
>rest of bytes are payload, (20 msec frame, i.e. 960 sample), I just want
to know, this payload by encoder is type of uint8, uint16, float??
i.e. how could I decide the type of these 960 samples from the payload, so
I can unpack this payload?
Regards,
Rizwan Ishaq
PH:0034-632 711 767
On Fri, Jun 17, 2016 at 1:54 PM, Ralph Giles <giles at thaumas.net> wrote:
> On 2016-06-17 10:50 AM, Rizwan Ishaq wrote:
>
> > 1) does 960 means number of samples in the (20msec frame)? (fs=48KHz)
>
> That's correct.
>
> > 2) The raw opus packet (i.e OPUS payload), how can I convert it to an
> > playable format?
>
> You can pass the payload section of the RTP packets directly to an opus
> decoder to convert to PCM float or integer samples.
>
> To save it in a file other audio players can handle, you need to
> re-encapsulate the data in a media container. Such files use the '.opus'
> filename extension. There's some rough example code for this in the
> opus-tools package. See for example
> https://git.xiph.org/?p=opus-tools.git;f=src/opusrtp.c;hb=HEAD#l103
>
> This disk and stream format is specified in
> https://tools.ietf.org/html/rfc7845.html
>
>
> > 3) is there any information OPUS payload has(except TOC(first byte))???
>
> The first several bytes define how the audio is split into frames, the
> duration, audio bandwidth, and the coding mode. This is described in
> https://tools.ietf.org/html/rfc6716#section-3.1
>
> > 4) I have RAW opus packets now, I want to convert it to representable
> > files, integer, float any method?? or any help (decoder)??
>
> You need to call `opus_decoder_create` to set up a decoder instance, and
> then pass each successive payload buffer to `opus_decode` or
> `opus_decode_float`.
>
> Hope that helps,
> -r
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20160617/65b066f3/attachment.html>
More information about the opus
mailing list