Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

minim dependency stops midi #103

Open
jeroendouwes opened this issue Dec 21, 2019 · 1 comment
Open

minim dependency stops midi #103

jeroendouwes opened this issue Dec 21, 2019 · 1 comment

Comments

@jeroendouwes
Copy link

jeroendouwes commented Dec 21, 2019

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:
<dependency> <groupId>net.compartmental.code</groupId> <artifactId>minim</artifactId> <version>2.2.2</version> </dependency>
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
Copy link
Author

A workarround (for when you don't need mp3 support) is using and exclusion in the dependency:
<exclusion> <groupId>com.googlecode.soundlibs</groupId> <artifactId>mp3spi</artifactId> </exclusion>
I think the problem is that this dependency registers javazoom.spi.mpeg.sampled.file.MpegAudioFileReader as javax.sound.sampled.spi.AudioFileReader.
This AudioFileReader returns an MpegAudioFormat from it's getAudioFileFormat method

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant