Help with AudioFileGetProperty
Help with AudioFileGetProperty
- Subject: Help with AudioFileGetProperty
- From: Gilbert Mackall <email@hidden>
- Date: Mon, 24 Feb 2003 21:48:59 -0500
I am having a problem in understanding how the AudioFileGetProperty
function is passed a pointer for the AudioStreamBasicDescription of the
file I have selected. Below is the section of code I am having problems
with. In reading AudioFile.h it states:
AudioFileGetProperty( AudioFileID inAudioFile,
AudioFilePropertyID inPropertyID,
UInt32 *ioDataSize,
void *outPropertyData);
My problem seems to be that I am not understanding, how to pass a void
pointer.
- (IBAction)getFile:(id)sender
{
int result;
NSString *path;
FSRef *fileRef;
AudioFileID fileID;
UInt32 *theSize;
AudioStreamBasicDescription basicDescription;
NSArray *fileTypes = [NSArray
arrayWithObjects:@"AIFF",@"AIFC",@"WAVE",@"wav",nil];
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
[oPanel setAllowsMultipleSelection:NO];
result = [oPanel runModalForTypes:fileTypes];
if (result == NSOKButton)
{
NSArray *filesToOpen = [oPanel filenames];
path = [filesToOpen objectAtIndex:0];
printf("%s \n",[path cString]);
FSPathMakeRef([path fileSystemRepresentation],fileRef,NULL);
AudioFileOpen(fileRef, fsRdPerm, 0, fileID);
AudioFileGetProperty(fileID,kAudioFilePropertyDataFormat,theSize,basicDe
scription);
}
}
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.