Re: getting PCM data from an audio file
Re: getting PCM data from an audio file
- Subject: Re: getting PCM data from an audio file
- From: Philippe Wicker <email@hidden>
- Date: Mon, 2 Jun 2003 17:19:33 +0200
On Monday, June 2, 2003, at 07:41 AM, Andrew GFunk wrote:
FSRef fsRef;
FSPathMakeRef ([[thisBundle pathForResource:@"Waiting2"
ofType:@"aif"] UTF8String], &fsRef, NULL);
AudioFileOpen(&fsRef, 1, 0, &originalAudioFile);
AudioFileGetProperty(originalAudioFile,
kAudioFilePropertyDataFormat,
&propertySize, &srcFmt);
printf("mSampleRate %g\n", srcFmt.mSampleRate);
You could check if FSPathMakeRef returns a non null FSRef.
FSPathMakeRef expects a 1st parameter which is a const UInt8* but a C
string (char* or SInt8*) containing a UNIX (POSIX) path works well
(this is how I use it myself). Maybe pathForResource it is not
returning a standard UNIX path in your case? It could be also that the
resource you're searching does not exist. You could try a call to
FSPathMakeRef with a path to an AIFF file you are sure about (eg
/tmp/YourFile.aiff, or ./YourFile.aiff if your file resides in the same
directory than the executable).
Regards,
Philippe Wicker
email@hidden
_______________________________________________
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.