• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getting PCM data from an audio file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >getting PCM data from an audio file (From: "Andrew GFunk" <email@hidden>)

  • Prev by Date: getting PCM data from an audio file
  • Next by Date: Apple DLS only audible on first few instruments
  • Previous by thread: getting PCM data from an audio file
  • Next by thread: Re: getting PCM data from an audio file
  • Index(es):
    • Date
    • Thread