We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Here, every attempt to play a sample using code like this:
import ddf.minim.*;
Minim minim;
AudioPlayer player;
minim = new Minim(this);
player = minim.loadFile("C:\\temp\\4.wav");
player.play();
suffers from truncation e.g. this input:
gives this outpurecorded with WMCapture):
Any idea why I am getting this and (presumably) other users are not?
I have no such playback problem with any of the many other audio programs I use on the same computer, inc. GoldWave.
Java is Version 8 update 31, OS is Windows.
EDIT:
Input
Output with bufferSize 65535
Answers
Debugging thoughts:
As I'd expect, it makes no difference here. Would you expect it to?
I've tried alternative WAV files and the same corruption affects them all.
All other formats I have tried suffer the same corruption (e.g. mp3) or an error e.g. "Couldn't load the file C:\temp\4.flac".
I haven't found a single audio file that doesn't get corrupted. Have you?
i second the need for setup() and draw().
minim will be writing the data in chunks. your code finishes after the first chunk, doesn't give it time to write the second chunk...
I dispute the sufficiency of setup() and draw().
As I said, here the same fail happens with .play() moved to draw(). I've added an example. Does that example succeed for you?
@chrisjj -- I can confirm that I'm seeing / hearing the same problems using your test sketches in Processing 3.2.1 on OS X 10.10.5. Sorry to say that I don't know enough about minim to have a guess about why play() is doing that.
Have you considered submitting this / your StackOverflow thread as a minim github issue to ddf? It is happening on Mac and Windows -- this does look like a library bug.