This project has moved and is read-only. For the latest updates, please go here.

Audio Sample Position

Feb 25, 2015 at 7:27 PM

What is the most efficient way to get position/timing data for each audio sample? Any help is appreciated!

Feb 26, 2015 at 5:56 PM
in what context? are you playing / recording audio / examining a file?
Feb 26, 2015 at 8:25 PM
Apologies for being so vague. This is what I would like to do: Analyze each sample in a wav file. For each sample, I want to get its position while additionally performing an FFT or autocorrelation on it. So if the audio file is 1 minute in duration and I know there is a Middle C in there, I want to find its start or onset time (in milliseconds). Or I might like to find the onset for another primary frequency in the audio. I know this is a difficult thing...

I'm not playing or recording, just analyzing. Also, I just finished both Pluralsight classes. They were very helpful.

Feb 27, 2015 at 7:36 AM
Well you know where you are in the file from the Sample Rate. If (say) there are 44100 samples per second, then to 44100th sample is at 1.0 seconds.
Also you can't perform an FFT on an individual sample - you'd do it on a block of samples (say 512).
Glad you found the pluralsight courses helpful :)
Feb 27, 2015 at 5:36 PM
Thanks Mark. That is very helpful. Yeah, I realized recently that I should have said I'm doing FFT on a group of samples-not one.
Anyway, your answer solves my issue.

Thanks again,

Brandon Campbell