Does anyone know how to tame Minim’s memory consumption when recording files? I know that there is a boolean value to indicate wether AudioRecorder uses a memory buffer or writes directly to a file, but both ways seem to result in a rise of memory. Try the code and look at your Activity Monitor. Every time you press a key, memory goes up. Is there any way to get around this and make it stable to be able to record a lot?
- import ddf.minim.*;
- Minim minim;
- AudioRecorder recorder;
- AudioInput in;
- void setup() {
- minim = new Minim(this);
- in = minim.getLineIn(Minim.MONO);
- }
- void draw() {
- }
- void keyPressed() {
- recorder = minim.createRecorder(in, "foo.wav", false);
- recorder.beginRecord();
- }
- void keyReleased () {
- recorder.endRecord();
- recorder.save();
- println("Saved a record using no buffer");
- }