(?) Simple sound in my game

Is there an easy way to put some sound into my application or game? :) If not, please tell me how to get a sound (e.g. beep.wav/mp3) inside my game..
If anyone knows something about MIDI files feel free to post them too, but mostly I'm interested in WAV or MP3...
Thanks :)

If you just want to play a simple .wav or .au file, you can use this:URL url = this.getClass().getResource("nameOfYourClip.wav");
AudioClip clip= Applet.newAudioClip(url);
clip.play(); // play it
clip.stop(); // done ...kind regards,
Jos

Similar Messages

  • How to create a simple spot the difference game

    Hi everyone. I'm new to the forums and relatively new to flash, so bear with me
    I'm looking to do a very simple spot the difference game using flash CS3 and actionscript 2 for a school project.
    As it stands, I have 2 images on separate layers on a timeline in the same frame, which has been paused using the 'stop' command. I am looking to have around 4 differences that, when clicked, will be recorded at the bottom of the screen.
    The problem is, I am unable to find a way to get the differences recorded at the bottom in the order the user finds them, where each one is entered when the user clicks it, leaving gaps for those that haven't been found.
    Being only a basic user, I am only familiar with scenes and basic timeline controls, and i'm hoping there's a relatively simple way of achieving this. However I am perfectly comfortable with using more complex actionscript, having done some programming before.
    Thanks in advance,
    Laurence

    Thanks so much for all your help
    Just one last thing about the 'if' script you gave me, what do i replace 'somemovieclip' with if I've already definied the movie clips I want to be monitored? Also, do I put that script on the frame? If not, where? It just doesn't work properly at the moment (skips straight to the completion frame even though the movie clips are hidden at the start) and i'm not sure about those things ^
    Sorry to be of more trouble
    Laurence

  • No sound when playing games

    hi  i  own an Hp pavilion 6135 dx entertaiment pc beats audio edition
    i have an issue i have recently done a hp factory reset to my laptop and now when i play games i get no audio . i get audio when playin videos and playing music but as soon as i open up a game such as METRO LAST NIGHT or CALL OF JUAREZ :GUNSLINGER i get no audio in neither games my IDT drivers are up to date i have done multiple updates to windows and search for all updates in my hp support assistant which says i am up to date on all drivers. i tried going into bios menu an reseting to default after uninstalinng IDT driver thenreinstall it ... did not work i tried all methods of troubleshooting like testing using headphones i rolling back IDT driver upgrading IDT driver but nothing seems to work... without gaming im lost i need some desperate helphere the games run fine just no audio.i need to fix this. have tried these methods and more
    system info 
    windows 7 64 bit home premium 
    i5 2nd generation 2.3 quad core  
    8 GB ram 
    dx 11

    Hey SorhanDarkOps, 
    I'm sorry you're running into this sound issue. It sounds like you've done a good job troubleshooting already. Let me know which product number you have. You may be able to find it by pressing FN + ESC (if you used the HP Recovery partition to reinstall Windows). You can also find the product number on an HP label on the bottom of the computer (possibly inside the battery compartment). 
    Also, it would be helpful to know which IDT Audio driver version you have. 
    Device Manager > Sound, video and game controllers > IDT > Properties > Driver tab > Driver version number
    When you have a game open, minimize it and check to see which sound device is the default. To do that:
    1. Right-click on the Speaker icon in the System Tray
    2. Click Playback Devices
    3. Let me know which (Speakers & Headphones, Communication Headphoens, etc.) device has the green checkmark on it.
    Do you get sound through headphones in games?

  • How do I convert a Simple Sound file to a .WAV file?

    Since I have a Mac Mini (w/Intel CPU) I don't have a built-in microphone.
    I do, however, have an OS 9.1 Wall Street Powerbook with a built-in mike.
    I'd like to send voicemail to friends who use Windows XP
    I used Simple Sound to record a message on the Powerbook and e-mailed
    it to myself. Now what? IMovieHD will apparently (according to Pogue) convert the sound portion of a movie to .WAV but when I open a New Project in IMovieHD my sound file is ghosted.
    Is there an app in Tiger that will convert the sound (voice) file? Or perhaps some freeware app out there?

    Hi, gwgoldb.
    USB microphones are very inexpensive. I'd suggest getting one of those and simply doing the recording on your new Mac Mini.
    For recording:
    • You could use the previously-suggested freeware Audacity to record and save the recording as .wav. Note Audacity isn't a Universal Binary at this time, so it would run under Rosetta.
    •  Use QuickTime Pro for recording and converting (export) the recording to .wav. Some people balk at paying US$ 29.99 for a QuickTime Pro key, but I find it does a nice job in basic recording, converting audio/video, and basic A/V editing, all with the simplicity of the QuickTime interface.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • I dont get sound for videos, games and music but ringtone still works. When i press volume buttons on side of phone i only get the picture of the nell and no little dots underneath. This is on my iphone 4s and ipad. It happened at the same time.

    I dont get sound for videos, games and music but ringtone still works. When i press volume buttons on side of phone i only get the picture of the nell and no little dots underneath. This is on my iphone 4s and ipad. It happened at the same time.

    Recurring theme with the 4s losing alerts except for the phone ringing.  Most complaints seem to center on the 7.1 upgrade.  The fix is dodgy, putting in a charger, playing a you tube video then pulling out the charger and wiggling it until you get the sound back.  When you get the sound back, the volume buttons start to work again.  Alternate solutions involve cleaning the docking port with a toothbrush, running a pick over the electrodes etc.

  • Sound handling in (game) application

    As my previous question did not receive any answers, I'll try to rephrase it.
    I need to change the volume of sounds during the game (changing pitch would be nice too). I tried to use:
    double currentVolume, volumeGain=.01, newVolume;
    FloatControl gainControl = (FloatControl)clipP1.getControl(FloatControl.Type.MASTER_GAIN);
    currentVolume=Math.log(gainControl.getValue())*Math.log(10.0)/20.0;
    newVolume = currentVolume + volumeGain;
    gainControl.setValue((float)(Math.log(newVolume)/Math.log(10.0)*20.0));The volume increase/decrease itself worked, but it was always delayed about 0.4-1.0 seconds. That is not acceptable.
    Any workarounds or do I have to use another library to achieve this?
    Thank You!

    I know little about the sound library, but I have a chunk of code that was edited from someone else. It might be faster, but I don't know. It also needs to be supported (obviously), so it may not even work (my game's sound was kind of buggy).
    vol is an integer with linear scaling, I believe.
    if (soundClip.isControlSupported(FloatControl.Type.VOLUME)){
        FloatControl volumeControl = (FloatControl) soundClip.getControl(FloatControl.Type.VOLUME);
        volumeControl.setValue(vol);
    }

  • No Sound For Yahoo Games

    I am new to using the Beta version of Safari for Windows. Everything is working fine so far except when I try to play some games in Yahoo there is no sound. The game loads and plays fine, but no sound. I have installed all of the plug-ins as recommended by Apple. I even downloaded DirectX, but that did not help. So far this is the only situation I have encountered where the sound does not work.
    Thanks for all replies.

    wow. i can't even get the java to load right in yahoo games. I have to use the click here option and that takes quite a bit of time to load. I don't know about your sound issue though sorry.

  • Sound in a game!

    Hi guys!
    I'm writing a game for Sony Ericsson K700.
    And i have a problem with a sound. Also i'm working with MIDP 2.0.
    My problem is to play 2 sounds in a game. When i play first sound, it play good, then is playing second sound and i have exception.
    However, can somebody write an example, how to play several sounds in a game.
    Thanks!

    Hi,
    To overcome this problem you can go with multiplayer of Sounds. Multiplayer is like
    creating an array of players.
    Normally this is the way to create a single player
              InputStream is;
    Player player;
              try
                   is = "a".getClass().getResourceAsStream("/abc.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   Sounds are of different types. MIDI, WAV, AMR. The below is the code for creating players
                   depending on their type.
                   player = Manager.createPlayer(is, "audio/midi");
                   player = Manager.createPlayer(is, "audio/wav");
                   player = Manager.createPlayer(is, "audio/amr");
                   player.realize();
                   player.prefetch();
                   is = null;
              catch(Exception e)
                   System.out.println("Exception in loadsound"+e);
                   return false;
    void playSound(){
    stopSounds(); // better to stop any sounds playing
    player.start();
    the above is the code for creating a single player. So, Instead of creating a single Player object ,
    go for the array of Players.

  • I can't here the sounds of the games in my ipad2

    Some days ago when I was playing games in my ipad2 the sounds of the games was working just fine, but now I can't here a sound.
    any help wil be apreciated.

    Make sure the side switch is not set to silent, make sure you don't have a Bluetooth device that the sound is going to. If that's not the case then try restarting your iPad 2 by holding down the on/off and the home buttons at the same time until you see the Apple logo. 

  • Is there a simple sound level meter for iTunes for windows ?

    I'm trying to check the sound level of my music in iTunes and was wondering if there is a simple sound level meter plug-in for iTunes out there.

    HKO,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • No sound effects on games or keyboard sound since downloaded 8.1.3 this morning on iPad airanyone any ideas pl ? 

    no sound effects on games or keyboard click since downloading 8.1.3 this morn. At first no sound on anything then played about in setting and switched off and now no sound effects despite being on full volume. If I reset will I lose my games pl ?

    I Think you have system sounds muted. Don't reset anything just yet.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the control center if you are running iOS 7 or 8. Swipe up from the bottom of the screen to get to control center . Tap on the bell icon and system sounds will return.
    If you are running iOS 5 or iOS 6, the system sound control is in the task bar at the bottom. Double tap the home button and swipe all the way to the right in the task bar to get to the speaker icon on the left side. Tap on that and the sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock can be accessed in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • Recently, I can't get any sound from my game applications.  Sound works fine with video, streaming, etc, but not my game applications.  I've tried powering down and re-booting, but the sound does not return.  Can anyone help me?

    Recently, I can't get any sound from my game applications.  Sound works fine with video, streaming, etc, but not my game applications.  I've tried powering down and re-booting, but the sound does not return.  Can anyone help me?

    Have you got notifications muted ? Only notifications (including games) get muted, so the Music and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad above the volume switch, or via control centre : swipe up from the bottom edge of the screen and it's the right-most of the 5 icons in the middle of it (if the icon is white then it's 'on', tap it to turn it grey and 'off'). The function that isn't on the side switch is set via control centre instead : http://support.apple.com/kb/HT4085

  • TS1702 I lost all sound in my game apps why?

    I lost all sound on all my game apps why?

    Hi,
    Try the following.
    Download the IDT Audio installer on the link below and save it to your Downloads folder.
    IDT Audio Installer - Windows 7.
    When done, open windows Control Panel, open Device Manager and open up Sound, Video and Game Controllers.  Right click the IDT device and select Uninstall - you should also get a prompt to remove the current driver, tick the box to allow this and then proceed with the uninstall.
    When complete, shut down the notebook, unplug the AC Adapter and then remove the battery.  Hold  down the Power button for 30 seconds.  Re-insert the battery and plug in the AC Adapter.
    Tap away at the esc key as you start the notebook to launch the Start-up Menu and then select f10 to enter the bios menu.  Press f5 to load the defaults ( this is sometimes f9, but the menu at the bottom will show the correct key ), use the arrow keys to select 'Yes' and hit enter.  Press f10 to save the setting and again use the arrow keys to select 'Yes' and hit enter.
    Let Windows fully load - it will automatically load an audio driver, but just let this complete.  Then open your Downloads folder, right click on the IDT installer and select 'Run as Administrator' to start the installation.  When this has completed, right click the speaker icon in the Taskbar and select Playback Devices.  Left click 'Speakers and Headphones' once to highlight it and then click the Set Default button - check if you now have audio.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Sound Blaster Audigy Gamer not being recogni

    Hi, I own the Sound Blaster Audigy Gamer. It had been working fine before I needed to update the drivers. When I tried to update the drivers it said that no Audigy Card was being detected and that the Setup would close. The first person at Creative I called told me that all I needed to do was to move the sound card to a different slot. I did, but the problem still occured. The second person told me to do a clean-sweep of the card, as persay of SID72, a KB article. I did that, but also it had the same problem. The third time I called he told me that I should try it in another computer, and I do not have any at the moment. What am I to do? I have checked the IRQ, it has IRQ#5 all to itself. I will try to move the PCI slot again though. Windows asks me every time I boot that I need to install the drivers. Should I do that?
    -Thanks
    Ibrahim

    Hi, I own the Sound Blaster Audigy Gamer. It had been working fine before I needed to update the drivers. When I tried to update the drivers it said that no Audigy Card was being detected and that the Setup would close. The first person at Creative I called told me that all I needed to do was to move the sound card to a different slot. I did, but the problem still occured. The second person told me to do a clean-sweep of the card, as persay of SID72, a KB article. I did that, but also it had the same problem. The third time I called he told me that I should try it in another computer, and I do not have any at the moment. What am I to do? I have checked the IRQ, it has IRQ#5 all to itself. I will try to move the PCI slot again though. Windows asks me every time I boot that I need to install the drivers. Should I do that?
    -Thanks
    Ibrahim

  • Simple Sound File

    How do I play a simple sound file in java? I'm talking extremely simple, just a play button - doesn't matter if it loops continuously or plays only once.

    [http://java.sun.com/docs/books/tutorial/sound/TOC.html]

Maybe you are looking for