Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: sending aac via rtp (Read 3050 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

sending aac via rtp

Hi everyone,

I want to stream AAC audio via RTP from iOS. To achieve this project I'm reading my audio from a file. I configured my encoder like this :

Code: [Select]
    audio.mDataFormat.mSampleRate = 22050; 
    audio.mDataFormat.mFormatID = kAudioFormatMPEG4AAC;
    audio.mDataFormat.mFormatFlags = kMPEG4Object_AAC_Main;
    audio.mDataFormat.mBytesPerPacket = 0; // 0 for VBR
    audio.mDataFormat.mFramesPerPacket = 1024;
    audio.mDataFormat.mBytesPerFrame = 0; // 0 for compressed format
    audio.mDataFormat.mChannelsPerFrame = 1;
    audio.mDataFormat.mBitsPerChannel = 0; // 0 for compressed format
    AudioFileTypeID fileType = kAudioFileAAC_ADTSType;

My file in ADTS has weird headers like this : 0xff 0xf9 0x5c 0x60 0x17 0xa0 0x0. According to this it's MPEG-2 version instead of MPEG-4 

So i gone to http://tools.ietf.org/html/draft-ietf-avt-rtp-mpeg2aac-02 in order to make valid RTP headers + payloads packets but I still can't read the stream without a valid SDP file. How can I make it ?