I'm trying to make use of the 'Audio Converter Service' - AudioConverterFillComplexBuffer
I'm hitting quite a few issues. Firstly I don't know how to populate the ioOutputDataPacketSize
. I've parsed my SDP descriptor, and I'm getting 8000Hz, 1 channel
AAC-LC.
a=fmtp:98 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1588
I receive some data ready for conversion via RTP (of various sizes), remove the headers as shown below, and what I'm then expecting is a 16bit AU-headers-length field, following that I would have the AU headers that should allow me to determine the frame/packet size etc. What I'm seeing though is just a zero for the header length...
I'm receiving AAC-LC / AAC-hbr over RTP, packet received looks like:
0x24 0x00 - unknown framing
0x05 0x84 - rfc4571 - 2bytes packet length
0x80 0x61 0x00 0x00 - 12bytes rtp header - rfc3016
0x00 0x00 0x05 0xA0
0x05 0x5F 0xEB 0x2E
0x00 0x00 0x01 0xB0 - rtp payload ie. start of AAC header??
0x03 0x00 0x00 0x01
0xB5 0x09 0x00 0x00
0x01 0x00 0x00 0x00
0x01 0x20 0x00 0x84
0x40 0x06 0x68 0xA0
0x21 0xE0 0xA3 0x1F
0x00 0x00 0x01 0xB6 ...
I get the above 'header' every couple of seconds, and in between several packets starting with:
0x00 0x00 0x01 0xB6
So it looks like a consistent header, but maybe I'm misunderstanding rfc3640.
So two questions really:
How can I determine the value for ioOutputDataPacketSize
.
Is the AAC header above actual AAC data that I could pass straight into the conversion function? or do I need to strip the header (once I can actually decode and calculate its size)
I haven't really found any examples for doing this conversion from one NSData input to another NSData output. Some examples using disk based conversions, but they don't offer much help for in-memory conversion.
My mistake, this is not audio data I'm looking at, but video data! now I can actually extract the correct sized packets.