my dog learned polymorphism*
The moose likes Beginning Java and the fly likes How to trigger a sound file in java cmd Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to trigger a sound file in java cmd" Watch "How to trigger a sound file in java cmd" New topic
Author

How to trigger a sound file in java cmd

Micah Glenz
Greenhorn

Joined: Dec 04, 2013
Posts: 17
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

Joined: Jul 26, 2007
Posts: 10486
    
    9

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)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to trigger a sound file in java cmd