Retrieving samples from an audio file at arbitrary times, i.e., NOT synced with playback
in
Contributed Library Questions
•
2 years ago
Hi there,
I'm interested in doing some audio visualization in Processing. For my application I need to be able to access large arrays of contiguous audio samples. For instance, I might need all the samples between two specific times in a file. Ultimately I'll be windowing these samples and sending them to an analysis algorithm.
To state this in code, I'm looking for a function like this:
- float[] samples = audioFile.getSamples(startTime, endTime);
I've looked at using Minim, but as far as I can tell, Mimim's focus is a bit different. Minim can give me access to the samples that are being played *right now*, e.g.
by attaching a "listener" to an AudioPlayer, but this doesn't meet my needs. I don't want the samples that happen to be playing whenever the draw loop decides to execute. I want the samples at specific times that I specify.
Does anyone know how I might be able to get at this sort of data?
If there's a way to do this through existing Minim functions, so much the better. If I'll need to hack Minim, or use another library all together, any advice on where to start would be much appreciated.
Many thanks, :)
D.
1