• 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: Iterating through audio data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Iterating through audio data


  • Subject: Re: Iterating through audio data
  • From: Brian Willoughby <email@hidden>
  • Date: Wed, 25 May 2011 18:33:48 -0700

Waveform displays are generally a very reduced bandwidth depiction of the audio data because the full audio data is almost always inefficient to access as quickly as needed for display. As a result, nearly every successful audio product uses some sort of caching mechanism to create the reduced data image from the original audio data and store it away somewhere for fast access. To that end you can access the audio file directly, and use your own custom format for the cached data. Keep in mind that you do not need 24-bit samples, and you certainly don't need 44,100 samples per every second of audio.

If you want to leverage as much Apple code as possible, I recommend the AudioFile and ExtAudioFile classes. With these, you can scan through all the data as fast as the computer can read it, without being limited to the time it would take to play the audio. These classes do use ASBD structures, but the structures do not contain the actual audio data. Instead, they describe the format of the data, and then you pull the actual data from the AudioFile class as fast as you want.

You can combine these tasks using ExtAudioFile to embed sample rate conversion and bit depth reduction, such that your cached data for the image is created as you read the file. This is a good way to leverage Apple's optimized code. If you're worried about missing isolated peak samples, then you might not want sample rate conversion, but in general you will obtain a perfectly nice rendition of the waveform by reducing its rate and depth to the point that it fits within the pixels of your view.

Brian Willoughby
Sound Consulting


On May 25, 2011, at 17:38, GW Rodriguez wrote:
I am attempting to draw a waveform (a seemingly taboo topic), and I'm not looking for tips on how to do this. I am just not sure how to get all the samples/amplitudes.

If someone can point me in the direction, is it in the ASBD? And how do I speed through and read all that data not in audio time but as fast as the computer can?

_______________________________________________ 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: Iterating through audio data
      • From: GW Rodriguez <email@hidden>
References: 
 >Iterating through audio data (From: GW Rodriguez <email@hidden>)

  • Prev by Date: Re: Iterating through audio data
  • Next by Date: Re: Iterating through audio data
  • Previous by thread: Re: Iterating through audio data
  • Next by thread: Re: Iterating through audio data
  • Index(es):
    • Date
    • Thread