opensubscriber
   Find in this group all groups
 
Unknown more information…

c : coreaudio-api@lists.apple.com 17 January 2006 • 10:26AM -0500

Re: PlayFile-based code crashes on multichannel wav
by William Stewart

REPLY TO AUTHOR
 
REPLY TO GROUP




it looks like you are crashing because you aren't catching the  
exception...

Just put a try-catch block around this (the problematic file doesn't  
have a channel layout I guess)

Bill

On 16/01/2006, at 5:02 PM, Michael Hanna wrote:

> I have a simple app that is based on the PlayFile example. It crashes
> on a particular multichannel wav file. The file WILL play in AU Lab
> and QuickTime Player 7.
>
> strangely, a different multichannel wav file plays properly.
>
> crashing file:
> http://siddha.ca/mymusic/samples/multichannel/qwave.wav
>
> non-crashing file:
> http://siddha.ca/mymusic/samples/multichannel/drmapan.wav
>
> code section:
>
> // if we have a surround file, then we should try to tell the output
> AU what the order of the channels will be
> if (fFileFormat.NumberChannels() > 2) {
> UInt32 layoutSize = 0;
> OSStatus err;
>
> NSLog(@"before AudioFileGetPropertyInfo");
>
> XThrowIfError (err = AudioFileGetPropertyInfo (fAudioFile,
> kAudioFilePropertyChannelLayout, &layoutSize, NULL),
>    "kAudioFilePropertyChannelLayout");
>
> NSLog(@"after AudioFileGetPropertyInfo");
> if (!err && layoutSize) {
> char* layout = new char[layoutSize];
>
> err = AudioFileGetProperty(fAudioFile,
> kAudioFilePropertyChannelLayout, &layoutSize, layout);
> XThrowIfError (err, "Get Layout From AudioFile");
>
> // ok, now get the output AU and set its layout
> XThrowIfError (AUGraphGetNodeInfo(fGraph, outputNode, NULL, NULL,
> NULL, &fileAU), "AUGraphGetNodeInfo");
>
> err = AudioUnitSetProperty (fileAU,  
> kAudioUnitProperty_AudioChannelLayout,
> kAudioUnitScope_Input, 0, layout, layoutSize);
> XThrowIfError (err, "kAudioUnitProperty_AudioChannelLayout");
>
> delete [] layout;
> }
> }
>
> "after AudioFileGetPropertyInfo" never gets printed, so I assume that
> the crash occurs at AudioFileGetPropertyInfo().
>
> any suggestions on what the issue may be? How do I catch this sort of
> exception, or better yet, how do I diagnose the problem? I tried
> NSLogging the contents of the various parameters of the
> AudioFileGetPropertyInfo() call, but I could not inspect them at
> compile-time(some sort of 'anonymous struct' error).
>
> entire method source:
>
> http://rafb.net/paste/results/uE1OmC96.html
>
> o/p of the error:
>
> [Session started at 2006-01-16 16:32:14 -0800.]
> playing file: /Users/mhanna/mydev/audio/samples/multichannel/qwave.wav
> format: AudioStreamBasicDescription:  4 ch,  22050 Hz, 'lpcm'
> (0x0000000C) 16-bit little-endian signed integer
> 2006-01-16 16:32:29.150 SimplePlayFile[1962] before  
> AudioFileGetPropertyInfo
> terminate called after throwing an instance of 'CAXException'
>
>
> regards,
> Michael
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      (Coreaudio-api@list...)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/coreaudio-api/bills%40apple.com
>
> This email sent to bills@appl...

--
mailto:bills@appl...
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (Coreaudio-api@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/coreaudio-api/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.