Minim Loading & Buffers
in
Core Library Questions
•
3 years ago
I'm trying to simply load an audio file into memory where I can then access the information as an array.
The above approach seems immediately suspect, though, because if I'm just loading a file, then specifying a buffer size makes no sense.
I can access the audio data in SoundSample, as an array, but only if I first "trigger" the sample. (Otherwise, I just get zeros.)
Perhaps "loadSample" spins off a thread to load the audio, and "trigger" forces it to go in real time. In this case, the buffer would exist to say, "If you can't wait for the audio to load, I'll play it back in real time." But then, wouldn't AudioSample would be a pointless and redundant class?
Ideas?
Thank you,
Bill
Minim minim;
AudioSample SoundSample = minim.loadSample ("ferret_banter.wav", 2048);
AudioSample SoundSample = minim.loadSample ("ferret_banter.wav", 2048);
The above approach seems immediately suspect, though, because if I'm just loading a file, then specifying a buffer size makes no sense.
I can access the audio data in SoundSample, as an array, but only if I first "trigger" the sample. (Otherwise, I just get zeros.)
AudioSample SoundSample = minim.loadSample ("ferret_banter.wav", 2048);
AudioSample SoundSample.trigger();
AudioSample SoundSample.trigger();
Perhaps "loadSample" spins off a thread to load the audio, and "trigger" forces it to go in real time. In this case, the buffer would exist to say, "If you can't wait for the audio to load, I'll play it back in real time." But then, wouldn't AudioSample would be a pointless and redundant class?
Ideas?
Thank you,
Bill
2