Minim AudioPlayer .play()'s corruption of sample end

edited October 2016 in Library Questions

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

Tagged:

Answers

  • Debugging thoughts:

    1. Have you tried putting your play commands inside a sketch with a setup / draw loop?
    2. Have you tried multiple wav files, or other formats like mp3? Is the problem affecting one wav file, all wavs, or any audio file?
  • edited October 2016

    Have you tried putting your play commands inside a sketch with a setup / draw loop?

    As I'd expect, it makes no difference here. Would you expect it to?

    Have you tried multiple wav files

    I've tried alternative WAV files and the same corruption affects them all.

    or other formats like mp3?

    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".

    Is the problem affecting one wav file, all wavs, or any audio file?

    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 second the need for setup() and draw().

    I dispute the sufficiency of 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...

    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.

Sign In or Register to comment.