Minim 1.1 Released!

I’m very happy to announce the release of Minim 1.1!

If you’ve been using Minim 1.0, there are some important changes you need to be aware of:

Another major change from 1.0 is the inclusion of a bunch of Interfaces that define library functionality. Essentially what I’ve done is defined how everything in the library should behave and then written an implementation of that spec. This is why createRecorder takes Recordable as the first argument and not an AudioInput or other concrete class. The use of Interfaces shouldn’t break any of your existing code because I used the existing methods of Minim as the starting point for the Interfaces.

I fixed a host of bugs relating to mp3 playback for this release. They should behave exactly like WAV and AU files now. There are many more examples now, one for each method of each Interface that defines the functionality of Minim classes. Examples are organized by Interface, rather than by concrete class, hopefully this isn’t too confusing for people.

Please let me know if you have any problems or questions!

10 thoughts on “Minim 1.1 Released!

  1. If you wanted to do something in real time with every single sample of audio input, what approach would you take? Would you record to a file and retrieve the samples from the file, or something else? With the interfaces defined now, would you implement something similar to an AudioBuffer that would only empty when you polled it?

  2. The only way to get absolutely every sample is to implement AudioListener and then add one as a listener on your AudioInput. This is because the thread that reads from the input will refill the buffer of your AudioInput much more quickly than 60 times per second, which is about as often you can hope to poll the buffer in draw().

    You could choose to do something like you’ve suggested, an object that you poll for samples in draw (you’d want to make both the polling method and the samples methods synchronized), but it would depend on what you wanted to do with the samples.

  3. hey I’m using Minim to play a sound file in processing – but I can’t figure out how to play the file just once… I have it playing fine using:

    Minim.start(this);
    player = Minim.loadFile(“clip.mp3″, 512);
    player.play();

    but I need it to stop playing after this and it seems to keep playing over and over and over…

    any help would be great.

  4. Hey, great work!
    I had some slight problems with the scrubbing demo. The rewind is not working (or VERY slow) the further you are within an MP3 file. I worked around this by pausing the music and moving the red marker until mouseReleased. Just then I change actually the position in the file.

    I have just two smaller problems remaining: When the end of an mp3 file is reached the Java process consumes 100% cpu time. And it stays that way even I close the file and open another one (I use a Java/Javascript interface for opening files inside HTML).
    And the second problem is the length of the mp3 file: It works when I run the applet locally, but not when I run it from a web server.
    Is there a workaround for this?

    Greets from Germany,
    Ben

  5. Thanks for pointing out the bugs, I’m not surprised they all have to do with mp3 playback. That has been a real pain, especially where the browser is concerned. I suspect the reason for the third one has something to do with applet permissions or possibly just the type of file handle you get from a packed jar as opposed to an actual file system. I seem to recall dealing with that issue at a certain point.

  6. Hello
    With Minim sound in java get’s easy!!! Great Work !!!
    Question.
    If I have a AudioPlayer, is it possible to have a listener ore anything else, that can tell me, that the sound is played ready, so that it can start now, to play a next soundfile?

    And second Question.
    Is it possible to change the pitch (I mean play it faster or slower) ?

    A problem I have is, if I want to change the pan or gain. It is not recognized if i do this to early.

    my workaround is to have a request like this, which is called in the repeated draw method, before change any parameters.

    boolean canPlay(){
    player.pause();
    player.mute();
    test=player.isMuted();
    player.unmute();
    return(test);
    }

    Thank you very much for this great library.

    Oliver

  7. Hey Oliver,

    That is a weird workaround and I’m not sure why it works for you as you say it does. There isn’t an event that you can listen for to tell you when the sound finishes playing, I’m trying to avoid having too much callback stuff because it can be confusing for beginners. What you can do is poll the isPlaying() method of the AudioPlayer. If you just start the player playing and don’t stop it yourself, this will return false when the sound is done playing. Or, at least it should. This may not work entirely correctly in Minim 1.1 but I am making absolutely sure it does for the next release.

    There isn’t any way to change the pitch of the sound at the moment, a SAMPLE_RATE control is not typically available from Javasound. But I’m working on something that will make this possible.

  8. Hello

    Minim is a great thing. It is easy to use and has many nice interfaces.

    But ther is one problem I can’t resolve.

    I have an app which gets the signal from an input line, then it filters the signal and finally renders the waveform. perfekt.

    Now I’d like to add a signal (e.g. SineWave) to this input signal before the rendering? But I can’t find a suitable hook?

    Basil

  9. Basil: What you could do is write a class that implements AudioEffect and then just have it add the signal to the samples it receives. Your process function might look like this:

    void process(float[] samps)
    {
       sine.generate(samps);
    }
    
  10. Hi first of all thanks for the library, for a newbie like me it has been easy enough to start to play with sound.
    but I’ve a question:

    I’m using the beat detect, and it’s working fine, but i need to save every frame as a png. The problem is that adding the saveImage code the frame rate drop and the sync between audio and images behave not in the right way.
    any suggestions?

    thanks
    lorenzo

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">