Skip to content

👾 emulator sounds Java Sound SPI powered by game-music-emu (vgm, nsf, gbs, spc)

Notifications You must be signed in to change notification settings

umjammer/vavi-sound-emu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Release Java CI CodeQL Java Parent

vavi-sound-emu

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)

Install

Usage

  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();

properties for target AudioFormat

  • track ... specify track # in the file to play

system properties

  • libgme.endless ... loop audio playing or not, default false

References

TODO

  • make those using service loader
  • javax 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.

About

👾 emulator sounds Java Sound SPI powered by game-music-emu (vgm, nsf, gbs, spc)

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages