Playing sound over the PC Speaker

  2 posts   Feedicon  
Replies: 1 - Last Post: December 22, 2009 03:53
by: dmkoelle
« Older Topic » Newer Topic
showing 1 - 2 of 2
 
Posted: November 19, 2009 01:09 by rosalux
That’s probably a geeky question, but … i just finished reading the interesting article Simplify Native Code Access with Java Native Access (JNA). One example is to use the windows API to controll the PC speaker … and since there’s already a Midi2Wav Converter for JFugue, i wondered if it would be possible to use the PC speaker as a output sink for JFugue … it would be both funny, geeky and a good proof for the expandability of JFugue to play Soft Kitty over the PC speaker Wink.
 
Posted: December 22, 2009 03:53 by dmkoelle
That would be pretty cool! To use the PC Speaker as an output sink for JFugue, you'd need to implement something like a PCSpeakerRenderer which would implement ParserListener and tell the PC speaker how to play each of the various musical events - instrument changes, note events, etc. For the PC speaker, you would probably just care about note events, in which case you could extend ParserListenerAdapter to simplify your class.

You can then hook up any parser to your parser listener. This means that you could send JFugue music to the PC speaker, or you could send MIDI music, or anything else for which a Parser exists (or could exist) in JFugue.

Have fun!

-David

Replies: 1 - Last Post: December 22, 2009 03:53
by: dmkoelle
« Older Topic » Newer Topic
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close