Re: Iterating through audio data
Re: Iterating through audio data
- Subject: Re: Iterating through audio data
- From: Brian Willoughby <email@hidden>
- Date: Wed, 25 May 2011 21:01:17 -0700
If you want to plot every 100 samples, then set up an ExtAudioFile
class object with an AudioConverter that gives you a 4,410 Hz
sampling rate for a file with 44,100 Hz data. This will efficiently
thin out the data for you, and then your task will be much simpler.
You could also reduce the bit depth to 16-bit or less, assuming the
input file is 24-bit. On second thought, you may run into
difficulties attempting to break from the canonical 32-bit float, but
perhaps it's worth an attempt. At the very least, the sample rate
reduction will help even if you keep the canonical bit depth.
Brian Willoughby
Sound Consulting
On May 25, 2011, at 19:58, GW Rodriguez wrote:
Yes I assumed that I wasn't going to plot each sample. My plan was to
start with every 100 samples and see how it looks.
So here's what I'm looking at doing:
// open audio file
// find length in samples of the file
-(void) getData {
AudioBufferList tempList;
for (SInt64 i=1; i < length; i = i+50) {
Err = ExtAudioFileSeek(audioFileRef, i);
UInt32 s = (UInt32) i;
Err = ExAudioFileRead(audioFileRef, &s, &tempList)
// something to print amplitude
}
}
So I'm not sure about the AudioBuffer and how to get the float
values (-1.-1.).
Thanks a bunch Brian
_______________________________________________
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