java port game music emu. mavenized and spi-zed also.
name | description | status | comment |
---|---|---|---|
gbs | Game Boy | ✅ | green |
nsf | NES | ✅️ | green |
spc | SNES | ✅️ | green |
vgm | Mega Drive | ✅ | Ym2612(mame:dallongeville+green), Sn76489(green) |
AudioInputStream vgmAis = AudioSystem.getAudioInputStream(Paths.get(vgz).toFile());
AudioFormat inFormat = sourceAis.getFormat();
AudioFormat outFormat = new AudioFormat(inFormat.getSampleRate(), 16, inFormat.getChannels(), true, true, props);
AudioInputStream pcmAis = AudioSystem.getAudioInputStream(outFormat, vgmAis);
SourceDataLine line = (SourceDataLine) AudioSystem.getLine(new DataLine.Info(SourceDataLine.class, pcmAis.getFormat()));
line.open(pcmAis.getFormat());
line.start();
byte[] buffer = new byte[line.getBufferSize()];
int bytesRead;
while ((bytesRead = pcmAis.read(buffer)) != -1) {
line.write(buffer, 0, bytesRead);
}
line.drain();
track
... specify track # in the file to play
libgme.endless
... loop audio playing or not, defaultfalse
- https://www.slack.net/~ant/ (blargg's site)
- https://github.com/GeoffWilson/VGM
- https://github.com/libgme/game-music-emu
make those using service loaderjavax sound spi- vgm after 1.50
- game-music-emu cannot play "Magical Sound Shower"
- MDPlayer can play above
vavi.sound.sampled.emu.TestCase#test5
spi properties for track # etc.