Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Sounds to play during action performed

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sounds to play during action performed

    Hi Folks,

    I have a uni assignment to create a One Armed Bandit Fruit Machine.

    It's been a struggle but so far I have got everything to work, apart from getting sounds to play(i.e. when the player wins the jackpot and when the reels spin).

    Can anyone enlighten me to the process of adding sound to play when an action is performed.

    I've looked online but have been slightly overwhelmed by what I found.

    Any help would be much appreciated.

    Chris


  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Sounds to play during action performed

    The easiest way to make a program make a sound is
    Toolkit.getDefaultToolkit().beep();
    If you're not happy with that, search the net for examples of playing MIDI in Java. For example
    Loading and Playing Midi Audio : SoundDevelopment ClassJava


    db

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Sounds to play during action performed

    Got it all sorted.

    Thanks for your reply!
    Last edited by smithyboy; November 20th, 2010 at 04:45 PM.

Similar Threads

  1. Action button HELP?
    By utoptas in forum Java Theory & Questions
    Replies: 8
    Last Post: August 27th, 2010, 03:32 PM
  2. image and sounds mp3 database
    By Stefan_Lam in forum JDBC & Databases
    Replies: 0
    Last Post: May 7th, 2010, 05:30 AM
  3. Audioclip play makes applets slow
    By Marcus in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 19th, 2010, 01:20 PM
  4. Java refuses to play sound on my machine
    By DDgeva in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: January 31st, 2010, 08:58 AM
  5. Need Help Action Listener....
    By vhizent23 in forum AWT / Java Swing
    Replies: 2
    Last Post: October 9th, 2009, 01:46 PM