• 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
Simple audio file opening/reading/conversion?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple audio file opening/reading/conversion?


  • Subject: Simple audio file opening/reading/conversion?
  • From: Aaron Wishnick <email@hidden>
  • Date: Tue, 12 Feb 2008 22:59:21 -0500

I'm writing an audio unit which will need to load audio files into memory. I'm confused by all the different interfaces available. Here's what I'm using so far. When I play the sound back in Process(), I get static, so I'd like to know if anybody sees anything glaring here:

OSStatus Sample::Open( std::string filename ) {
FSPathMakeRef((UInt8 *)filename.c_str(), &m_fsRef, NULL);
OSStatus retVal = AudioFileOpen ( &m_fsRef, fsRdPerm, 0, &m_fileID );


// should do error checking here


UInt32 uSize = sizeof( m_uLength );
AudioFileGetProperty( m_fileID, kAudioFilePropertyAudioDataByteCount, &uSize, &m_uLength);


m_fFrames.resize( m_uLength, 0.0f );


retVal = AudioFileReadBytes( m_fileID, false, 0, &m_uLength, &m_fFrames[0] );


return retVal;


return 0;
}
 _______________________________________________
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

  • Follow-Ups:
    • Re: Simple audio file opening/reading/conversion?
      • From: "Art Gillespie" <email@hidden>
  • Prev by Date: Re: AUVal Reported error: kAudioUnitErr_TooManyFramesToProcess
  • Next by Date: Re: Simple audio file opening/reading/conversion?
  • Previous by thread: Re: AUVal Reported error: kAudioUnitErr_TooManyFramesToProcess
  • Next by thread: Re: Simple audio file opening/reading/conversion?
  • Index(es):
    • Date
    • Thread