Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to trigger a sound file in java cmd

 
Micah Glenz
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I trigger a sound file(I don't care what type the sound file is) in java when the program is just going to ran in the command prompt? Thanks
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Do you mean play some audio file from your code? If yes, check out http://docs.oracle.com/javase/tutorial/sound/playing.html
In case you just want to draw the user's attention, Toolkit#beep() will emit a beep (internally it will use your underlying OS's beep)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic