• 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
Loading Audio File into Array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loading Audio File into Array


  • Subject: Loading Audio File into Array
  • From: Jannik <email@hidden>
  • Date: Tue, 24 Jan 2006 22:58:41 +0000

Hello list. I have a couple of questions regarding audio files. What I want to do is load an entire audio file into an array, which will be pointed to by an AudioBufferList.mBuffers[0].mData pointer. I already know the format more or less (stereo, 48 KHz, 24 bit, and the length will never be longer than 10 seconds). My questions are:

1. How do I determine what size the array containing the audio file should be initialized as? I am thinking I have to call ExtAudioFileGetProperty() with the constant of kExtAudioFileProperty_FileLengthFrames, which returns the number of frames of the input file as an SInt64. Then I will declare the array to be the size of the value which ExtAudioFileGetProperty returned.

2. What is the appropriate way to load the entire file into the array? I have seen AudioFileReadBytes() used in previous, old (OS X 10.2) emails to the mailing list, and ExtAudioFileRead used in the ConvertFile sample project. However, both of these take a UInt32, and I have an SInt64 from the ExtAudioFileGetProperty(). This makes me wonder if my assumptions are correct.

Thank you for any help.

Jannik
_______________________________________________
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: Loading Audio File into Array
      • From: john <email@hidden>
  • Prev by Date: Re: Universal AUs
  • Next by Date: Re: Loading Audio File into Array
  • Previous by thread: Re: afinfo / ExtAudioFile relies on file extensions?
  • Next by thread: Re: Loading Audio File into Array
  • Index(es):
    • Date
    • Thread