Re: why is ExtAudioFileSetProperty raises c++ exception?
Re: why is ExtAudioFileSetProperty raises c++ exception?
- Subject: Re: why is ExtAudioFileSetProperty raises c++ exception?
- From: Andy Davidson <email@hidden>
- Date: Mon, 24 Jul 2017 09:53:51 -0700
- Thread-topic: why is ExtAudioFileSetProperty raises c++ exception?
Thanks Kevin
Andy
From: Kevin Dixon <email@hidden>
Date: Sunday, July 23, 2017 at 9:18 PM
To: Andrew Davidson <email@hidden>
Cc: coreaudio-api <email@hidden>
Subject: Re: why is ExtAudioFileSetProperty raises c++ exception?
> Hi Andy,
>
> I guess what you're describing is if you create a symbolic breakpoint for All
> Exceptions Thrown, then yes, you will break in a lot of the ExtAudioFile APIs.
> Internally Apple implemented this library with C++, and apparently some code
> paths tend to produce exceptions that are caught internally by the library.
> It's a bit annoying when debugging, but nothing to worry about. Just check the
> OSStatus returned from the C-like API to see if everything is working.
>
> Kevin
>
> On Wed, Jul 19, 2017 at 3:30 PM, Andy Davidson <email@hidden>
> wrote:
>>
>> While working on some new UI functionality in IOS 10.x. I discovered some
>> ObjC audio code written years ago is raising c++ exception. I found this by
>> setting a break point in all exceptions in Xcode. I even if I clear all the
>> break points I am not able to run my app from Xcode. The app seems to work if
>> I run it stand alone (i.e. Not connected to Xcode).
>>
>> Does anyone know how I can catch c++ exceptions in the middle of my objc ?
>>
>> Here is a back trace
>>
>>
>> (lldb) bt
>> * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
>> frame #0: 0x000000018be82e70 libc++abi.dylib`__cxa_throw
>> frame #1: 0x00000001a21e872c
>> AudioCodecs`ACBaseCodec::GetPropertyInfo(unsigned int, unsigned int&,
>> unsigned char&) + 592
>> frame #2: 0x00000001a20cd808 AudioCodecs`GetPropertyInfo(void*, unsigned
>> int, unsigned int*, unsigned char*) + 44
>> frame #3: 0x00000001903af664
>> AudioToolbox`CodecConverter::CodecSupportsProperty(unsigned int) + 32
>> frame #4: 0x00000001902f2e38
>> AudioToolbox`AudioConverterChain::SetProperty(unsigned int, unsigned int,
>> void const*) + 1224
>> frame #5: 0x000000019049bf2c AudioToolbox`AudioConverterSetProperty + 88
>> frame #6: 0x0000000190254c20 AudioToolbox`ExtAudioFile::UpdateInternals()
>> + 356
>> frame #7: 0x000000019025530c
>> AudioToolbox`ExtAudioFile::SetClientFormat(CAStreamBasicDescription const&,
>> CAAudioChannelLayout const*) + 1136
>> frame #8: 0x000000019021948c AudioToolbox`ExtAudioFileSetProperty + 280
>> * frame #9: 0x000000010014bdc0 MusicTrainerLite`-[AudioConvertHelper
>> createOutputAudioFile:](self=0x00000001702e8380,
>> _cmd="createOutputAudioFile:", destinationURL=0x00000001700b5540) at
>> AudioConvertHelper.m:162
>> frame #10: 0x000000010014c3a0 MusicTrainerLite`-[AudioConvertHelper
>> convert:toAAC_InDestinationURL:](self=0x00000001702e8380,
>> _cmd="convert:toAAC_InDestinationURL:", audioSourceURL=0x00000001740be600,
>> accOutputURL=0x00000001700b5540) at AudioConvertHelper.m:219
>>
>>
>> It is raised by ExtAudioFileSetProperty
>>
>> CFURLRef tmp = (CFURLRef)destinationURL;
>>
>> err = ExtAudioFileCreateWithURL(tmp, kAudioFileM4AType, &dstFormat, acl,
>>
>> kAudioFileFlags_EraseFile, &destinationFile);
>>
>>
>> err = ExtAudioFileSetProperty(destinationFile,
>> kExtAudioFileProperty_ClientDataFormat,
>>
>> sizeOfFormatASBDStruct,
>> &audioSourceFormat);
>>
>>
>>
>> Over all this code is trying to convert a tmp file in LPCM format to an m4a
>> to save space on disk.
>>
>>
>>
>> The input/tmp file format is
>>
>>
>>
>> Sample Rate: 44100
>>
>> Format ID: lpcm
>>
>> Format Flags: C
>>
>> Bytes per Packet: 4
>>
>> Frames per Packet: 1
>>
>> Bytes per Frame: 4
>>
>> Channels per Frame: 2
>>
>> Bits per Channel: 16
>>
>> kAudioFormatFlagIsSignedInteger
>>
>> kAudioFormatFlagIsPacked
>>
>> kLinearPCMFormatFlagIsSignedInteger
>>
>> kLinearPCMFormatFlagIsPacked
>>
>> kLinearPCMFormatFlagsSampleFractionShift
>>
>> kAppleLosslessFormatFlag_32BitSourceData
>>
>>
>>
>> I am unable to call ExtAudioFileGetProperty After the exception
>>
>>
>>
>> AudioStreamBasicDescription debugOutputFormat;
>>
>> err = ExtAudioFileGetProperty(destinationFile,
>>
>> kExtAudioFileProperty_FileDataFormat,
>>
>> sizeOfFormatASBDStruct,
>>
>> &debugOutputFormat);
>>
>>
>>
>>
>>
>> Any suggestions would be appreciated
>>
>>
>>
>> Andy
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> om
>>
>> 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