Re: Does iPhone's iLBC Audio Format support 30ms mode?
Re: Does iPhone's iLBC Audio Format support 30ms mode?
- Subject: Re: Does iPhone's iLBC Audio Format support 30ms mode?
- From: Ming <email@hidden>
- Date: Mon, 04 Jun 2012 14:27:44 +0800
Hi Zack,
I can confirm that it's working fine and I've been integrating it in
PJSIP (http://www.pjsip.org) successfully. Unfortunately I couldn't
remember what I did exactly that make it work. I only remembered that
it was rather simple and I found it after I tested it on Mac (instead
of iPhone).
Best regards,
Ming
On Mon, Jun 4, 2012 at 6:00 AM, Zack Coder <email@hidden> wrote:
> I realize this thread appears to have long-since died, but I found it while
> searching around for solutions to the same problem. My encoding works fine,
> but all I hear is clicking when I decode from iLBC to PCM. Does anyone have
> any updates/results here?
>
> Thanks,
> Z
>
> On Friday, April 9, 2010 12:59:59 AM UTC-4, Sauw Ming wrote:
>>
>> Hi all,
>>
>> I'm trying to encode/decode from linear PCM (8KHz, mono, 16 bits) to
>> kAudioFormatiLBC (8 KHz, mono) format on iPhone OS 3.1.2.
>>
>> Following iPhone's sample application in:
>>
>> http://developer.apple.com/iphone/library/samplecode/iPhoneExtAudioFileConvertTest/Listings/ExtAudioFileConvert_cpp.html#//apple_ref/doc/uid/DTS40009222-ExtAudioFileConvert_cpp-DontLinkElementID_7
>>
>> When I use the following function:
>> dstFormat.mSampleRate = 8000.0;
>> dstFormat.mFormatID = kAudioFormatiLBC;
>> dstFormat.mChannelsPerFrame = 1;
>> // use AudioFormat API to fill out the rest of the description
>> AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
>> 0, NULL, &size, &dstFormat);
>>
>> It will always gives me:
>> dstFormat.mFramesPerPacket = 160;
>> dstFormat.mBytesPerPacket = 38;
>> i.e. the 20ms mode, which, I supposed, is the default format here.
>> Using this mode, the encoding/decoding worked flawlessly. However, my
>> application needs to support the 30ms mode (i.e. the encoding/decoding
>> of 240 to 50), so I try to manually set mFramesPerPacket to 240 and
>> mBytesPerPacket to 50. It seems to be successful since all functions
>> return successfully (both AudioConverterNew() and
>> AudioConverterFillComplexBuffer() return noErr). The encoding works
>> fine, however the decoding (from iLBC to PCM) doesn't seem to work
>> anymore, I can only hear something similar to clicking sound. So I am
>> just wondering whether iLBC AudioConverter actually supports the 30ms
>> mode (especially the decoding from 50 bytes iLBC format to 240 samples
>> of PCM, since the encoding seems OK)?
>>
>> Below is the srcFormat (the PCM format):
>>
>> Thank you,
>> Ming
>>
>> srcFormat.mSampleRate = 8000.0;
>> srcFormat.mFormatID = kAudioFormatLinearPCM;
>> srcFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
>> | kLinearPCMFormatFlagIsPacked;
>> srcFormat.mBitsPerChannel = 16;
>> srcFormat.mChannelsPerFrame = 1;
>> srcFormat.mBytesPerFrame = srcFormat.mChannelsPerFrame
>> * srcFormat.mBitsPerChannel >> 3;
>> srcFormat.mFramesPerPacket = 1;
>> srcFormat.mBytesPerPacket = srcFormat.mBytesPerFrame *
>> srcFormat.mFramesPerPacket;
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>>
>> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden