ddf / Minim

A Java audio library, designed to be used with Processing.
http://code.compartmental.net/tools/minim
GNU Lesser General Public License v3.0
668 stars 136 forks source link

minim dependency stops midi #103

Open jeroendouwes opened 4 years ago

jeroendouwes commented 4 years ago

Playing a midi file using javax.sound.midi:

Sequencer sequencer = MidiSystem.getSequencer(); sequencer.open(); File file = new File("test.mid"); Sequence sequence = MidiSystem.getSequence(file); sequencer.setSequence(sequence); sequencer.start();

stops working when a minim dependeny is added to the pom: `

net.compartmental.code minim 2.2.2

` Is there a way to use javax.sound.midi and minim at the same time? I already have midi support for the lights of my Christmas tree but would also like to integrate the very nice FFT and beat detection features of minim.

jeroendouwes commented 4 years ago

A workarround (for when you don't need mp3 support) is using and exclusion in the dependency: `

com.googlecode.soundlibs
                <artifactId>mp3spi</artifactId>
            </exclusion>

I think the problem is that this dependency registersjavazoom.spi.mpeg.sampled.file.MpegAudioFileReaderasjavax.sound.sampled.spi.AudioFileReader. ThisAudioFileReaderreturns anMpegAudioFormatfrom it'sgetAudioFileFormat` method