Minim does not play till complete end.
in
Contributed Library Questions
•
11 months ago
Hello there,
I encountered a strange thing with minim.
Somehow it most of the time (very inconsistent) it does not play the sound file till the complete end, and stops a couple milliseconds before. Actually it does stop at the end of the audiofile's lenght BUT there is still "audio left"
If I hit play again, it plays a bit more of the end. I can continue this until the true end is reached.
What is even worse if the soundfile stops at the end (same happends when pressed pause anywhere on the track) and i cue it to any other position, a short bit of the "last" audio get's played before continuing with the new position. As if there was still audio in the buffer. Which does not only create "wrong sounds" it put's everything (millisecond position and real sound) out of sync.
I am trying to build an audioplayer, where sync is very important, but somehow minim seems so buggy that it looks impossible.
Or am I doing something wrong?
I can't be the first one who encounters this problem, can I?
grab the soundfile here: http://www.marc-tiedemann.de/daten/121117_153941.wav
I encountered a strange thing with minim.
Somehow it most of the time (very inconsistent) it does not play the sound file till the complete end, and stops a couple milliseconds before. Actually it does stop at the end of the audiofile's lenght BUT there is still "audio left"
If I hit play again, it plays a bit more of the end. I can continue this until the true end is reached.
What is even worse if the soundfile stops at the end (same happends when pressed pause anywhere on the track) and i cue it to any other position, a short bit of the "last" audio get's played before continuing with the new position. As if there was still audio in the buffer. Which does not only create "wrong sounds" it put's everything (millisecond position and real sound) out of sync.
I am trying to build an audioplayer, where sync is very important, but somehow minim seems so buggy that it looks impossible.
Or am I doing something wrong?
I can't be the first one who encounters this problem, can I?
- import controlP5.*;
- import ddf.minim.*;
- import ddf.minim.analysis.FFT;
- ControlP5 playPauseGui;
- Minim minim;
- AudioPlayer soundFile;
- void setup(){
- size(400,400);
- playPauseGui = new ControlP5(this);
- playPauseGui.addButton("Play", 0, 200, 125, 30, 10);
- playPauseGui.addButton("Pause", 0, 250, 125, 30, 10);
- playPauseGui.addButton("Stop_Player", 0, 300, 125, 30, 10).setLabel("Stop");
- minim = new Minim(this);
- soundFile = minim.loadFile("data/121117_153941.wav");
- }
- public void draw(){
- background(200);
- text(soundFile.position()+" / "+soundFile.length(),20,20);
- }
- public void Play(){
- soundFile.play();
- }
- public void Pause(){
- soundFile.pause();
- }
- public void Stop_Player(){
- soundFile.pause();
- soundFile.rewind();
- }
grab the soundfile here: http://www.marc-tiedemann.de/daten/121117_153941.wav
1