Sound in a racing game

Hi, folks.
I'm developing a racing game in MIDP 2.0. I've added some wav sounds to the menu and other UIs, which seems to have a short delay on playing.
Now, I've got another problem! How can I add sound to the race? I need to find a way to synchronize the sound of a motor with the car's rpm. It must be faster and acute when rpm is high and slower and grave when rpm is low. Does anyone have any idea that could help?
My Race class is a GameCanvas implementing Runnable and using a separate object to update the frames by using a separate Thread.
Thx,
Ricardo.

To be able to play existing sounds fragments and play generated tones you can use the Mobile Media API (MMAPI). Check whether your target JVM implementation supports MMAPI.
To be able to play a certain tone you could use something like this:
(check the API specification of the 'javax.microedition.media' package)
Manager.playTone(int note, int duration, int volume)
That should do the trick.
Jasper

Similar Messages

  • Racing Games and MBP 2.2?

    Hello,
    I own a 2.2Ghz Macbook Pro with the Nvidia 8600M GT 128VRAM graphics chip. Recently, I have been gaming more often on my laptop. I like racing games, but unfortunately, I have found that the performance has been poor.
    I downloaded the ToCA race driver 3 demo and was surprised at the initially great performance I was getting. I was running the game at 1440x900 max resolution, but after about 10 or 15 minutes of play, the game started to lag and the sound became garbled. I also noticed the same with the demo of FlatOut 2, another racing game. I tried tweaking the graphics settings on both games, but I am still struggling to get acceptable performance. I have AA turned off for both games.
    I think my graphics chip might be overheating? I have tested it under full load and the chip itself (NOT the heatsink) appears to run at 72 Celsius (160 F). In addition, I am getting XBench scores of 154 (196.034 fps) for the OpenGL test. I am not sure if those are good numbers or not, but I hope that they can provide some evidence to the poor performance I am experiencing.
    Both ToCA and FlatOut call for a minimum of 128VRAM, but I still feel that I should get decent performance, as I do meet the video card requirements and exceed all the other requirements.
    I am running the latest version of OS X: 10.5.6, which I read in the release notes improves gaming performance. Unfortunately, I am not seeing it.
    Any help is greatly appreciated.
    Thanks,
    -MobileGuru

    "CPU and Ram usage went from 10% and 850mb while idle, to 100-120% and 2.3GB when editing pictures." - This is normal. But it dose not mean there are no memory leaks.
    "Is it most likely that aperture 3.0.1 is yet not entirely optimized" - Correct! It is just a quick fix for the most urgent bugs. They did it in just 2 weeks is really good news.
    I think we can not call AP3 as stable until V 3.1.0

  • Sound lag when playing games

    Hi,
    My Z1 compact has sound issues when playing games.
    There is a noticable sound lag of about a second (not much but is quite annoying), not only on newer games but also on the older ones, Angry Birds for example.  My recorded videos or YouTube don't appear to have the same issue.
    The problem seemed to occur after I had installed Worms 2: Armageddon when the phone got extremely hot and crashed. It was after the phone had reset and cooled down that I noticed the sound lag issue and Worms 2 was running at a very slow frame rate.
    I then installed Worms 2 on my ASUS TF201 and it runs perfectly with no sound or heating issues.
    I can't seem to find anyone else with this issue so i'm wondering if my phone is faulty.
    Any help would be much appreciated.

    Hi and welcome to the community! Since you're new please be sure that you have checked out our Discussion guidelines.
    I suggest that you try to repair the phone software using PC Companion..
    Before repairing your device you may want to backup your information first. Check out this topic for more information on how to.
    How to backup?
    If the issue should still remain I think that this needs to be examined and fixed at a repair center. For more information about how to submit your phone for repair and where, contact your local support team.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • How to make a 2nd player in this racing game.

    I'm using this tutorial to learn how to make games in Flash for a class, but it doesn't say how to make a 2nd player.
    If somebody can show me the code to make alternative controls (W,S,A,D) for a 2nd car that'd be fantastic!
    Thanks a lot,
    Dd
    http://www.emanueleferonato.com/2007/05/15/create-a-flash-racing-game-tutorial/

    if (_root["car"+who].code == "player") {           
    if (Key.isDown(Key.DOWN)) {
                   this["speed"+who] -= _root.backSpeed;
              //steer left - well, we could simply add or subtract a fixed angle (in degrees) to/from the car's rotation, but that's not good enough. In order to simulate a natural movement, steering must depend on speed, otherwise you will be able to rotate your car even if it's almost stopped and it will look like a propeller
              if (Key.isDown(Key.LEFT) && this["speed"+who]>0.3) {
                   _root["car"+who]._rotation -= _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
              //steer right - you already know what happens here
              if (Key.isDown(Key.RIGHT) && this["speed"+who]>0.3) {
                   _root["car"+who]._rotation += _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
    You basically have to make a second conditional clause that starts:
    if (_root["car"+who].code == "player2") {           
    if (Key.isDown(/*Insert KeyCodeValue of the Key you want to use*/)) {....
    The AS2 keycodes can be found here:
    http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001136.html

  • Sound quit on my game apps

    I cannot hear the sound when I play my game apps.  The side volume button is all way up and the sound bar on the sound scale (when tapping the home button twicw) is in the middle.  What could be the cause?  I have the new iPad.

    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    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 task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • Odd sound change in some games

    Background: I recently installed Windows XP, and updated the drivers using the Creative Updater on the support site. since then whenever i run a specific game (DiabloII in this situation) the sound automatically gets louder and degraded. Previously I was running windows 98 with the .vxd version drivers without any issues. This occurs regardless of whether EAX/AudioHQ is installed or not. Originally I tried a driver upgrade installation, since then I've also tried a clean installation of the drivers with the same results..
    sound card: Soundblaster Audigy (not mp3, platinum, gamer etc...) / 5.2.5.44 version drivers.
    I've seen a couple of posts regarding the EAX control panel and settings while running some games. In the posts I've read, when AudioHQ is installed there is no ability to change the EAX settings while the game runs. Previous posts have suggested a clean installation of the drivers to remedy the issue, which does not seem to work in this case.
    Mostly this is affecting me due to the fact i run a minidisc player on the line in jack. Even though I change the source of the line in settings, so that the line in doesn't use the master settings, the line in is still affected. In windows 98, if a game attempted to override the eax settings this was the fix i used.
    Any suggestions are appreciated.

    Is it all apps or just some games. Some games have their own sound settings. If it is all apps, you may have system sounds muted.
    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    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 task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • How do I get sound to work  for games...?

    How do I get sound to work for game apps, when I have sound for other items on ipad2?

    Have you got notifications muted ? Only notifications (including games) get muted, so the iPod 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, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085

  • How do I get sound to work on games?

    How do I get sound to work on games, sound work on everything else exept when I play app games since I got the phone, any ideas how to get to work?

    Have you got notifications muted ? Only notifications (including games) get muted, so the iPod 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, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085

  • How do I stop a sound file that is playing while Firefox is open that sounds like a PacMan Game?

    How do I stop a sound file that is playing while Firefox is open that sounds like a PacMan Game? It started when I downloaded the current Adobe DLM, but continues when disable. It begins playing each time I open FireFox, but gets interferred with when opening a web page.
    == This happened ==
    Every time Firefox opened
    == 1520 hours, Central Time

    See [[Firefox makes random sounds]]

  • After recent download of update to iPad, I now have no sound and all my games are slow.What happened?

    I recently downloaded the offered update to iPad.  Now I have now sound and all my games are slow.  Plus, anything with a video while surfing can't be viewed. Does anyone know hat happened and how to fix it?

    1. Close all apps in the Task Bar. Double-click the Home button and hold apps down for a second or two. Tap the minus sign to close app.
    2. Hold the Sleep and Home button down until you see the Apple Logo.

  • Can't hear sounds in videos and games

    Can't hear sounds in videos and games? Hello. I have some problem with my SB Li've!. I'm using a Sound Blaster Li've! 5. Digital (it writes Model: SB0220 on it) sound card, attached on a Gigabyte Intel 945 S-Series motherboard. And I've installed the driver and software from the cd that i got out of the SB Li've!'s original box (Creative SB Li've! series, Release 5.2.3.296), and also installed my motherboard's onboard sound card driver (Realtek High Definition Audio Driver, Release: 5.0.0.5567). I'm running Microsoft Windows XP Professional SP3, using 4. Creative speakers.
    I'm okay when listening mp3's or Windows system sounds, but when it comes to play a game or watch a video;
    I cannot properly (or sometimes completely) hear sounds, if my EAX Equalizer is set up to something else from "No Effects",
    I can hear every sound properly if my EQ is set up "No Effects".
    Can anybody tell why this happens? I can give more information about my hardware and software if needed. Thanks so much for your time =)

    Nothing, this link in message box is inactive:
    But I freely can buy Apps, Books, Music and other from App Store...

  • TS3274 I lost sound to all my games what do I do?

    I Lost sound to al my games..how o I get it back

    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    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 task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • Sound quit working with game apps?

    Sound quit working with my game apps and email.
    Radio, facetime & music work fine.
    Has anyone had this issue?
    I did not change any settings.
    It worked fine yesterday and today no sound.

    If you lost sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    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 task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • Working Accelerometer Racing Games for Nokia 500 i...

    I have bought  Nokia 500 Belle just a few weeks ago.......and just recently i got to know that it does not have 3D GPU..............so no great games..........now i am just asking for some Racing Games which work on Accelerometer..........i am lukin 4wrd for sum of 'em........
    Asphalt HD games, NFS HD games won't........any other ideas.....plz

    hai brother,i am also facing this problem,but i downloaded asphalt 4 its supports in my nokia 500

  • I don't have any sound on my iPad games. How do I fix this?, I don't have any sound on my iPad games. How do I fix this?

    I don't get sound on my iPad 2 games purchased from the App Store like mine raft, mega run, and order up!  My speakers work because there is sound when using YouTube, music, Netflix, and videos.  How can I get the sound for my games back?

    You have system sounds muted.
    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    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 task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

Maybe you are looking for