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);
}

Similar Messages

  • 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

  • Product name: HP Pavilion 15 Notebook PC.......NO sound in watchdogs game

    sir,
          i recently buy a new pavilion laptop...and now i install the game called "watch dogs" it works good but without any sound....i do my best in incrasing volumes and etc.....but nothing will hapen,so please help me....and this game work well in my friend same model laptop,
                                                                                                            thanyou....

    Hello @loguprasath, welcome to the HP Forums.
    I see that you're having an issue with sound in watchdogs. I will try to help you with this.
    To start off, I have a few questions.
    What's the currently installed operating system?
    What are the model and product numbers?
    Does the sound work in other applications on the notebook?
    I'd recommend making sure all Windows updates have been completed. After that you can update the auto driver with the HP Support Assistant on the notebook.
    Make sure you've tested other programs/applications to see if the sound is working at all.
    I look forward to your reply.
    Thank you for posting on the HP forums.
    I worked on behalf of HP.

  • Can a PowerBook G4 handle this game?

    These are the system requirements of a game I want to get. But can my computer handle this game? I have a standard PowerBook G4 12" running Tiger.
    Operating System: Mac OS X 10.3.9 or later
    CPU Processor: PowerPC G5 or Intel chipset
    CPU Speed: 1.8 GHz or faster
    Memory: 512 MB or higher
    Hard Disk Space: 3.5 GB free disk space
    Video Card (NVidia): GeForce FX 5200 or better
    Video Memory (VRam): 64 MB or higher
    Recommended System Requirements:
    Operating System: Mac OS X 10.4.6 or later
    CPU Processor: PowerPC G5 or Intel chipset
    CPU Speed: 2.0 GHz or faster
    Video RAM: 128 MB
    Do you think the standard PowerBook G4 12" could handle this game? The only things my computer doesn't meet are the CPU speed and the CPU chip set (I'm a G4 at 1.5 GHz). Thanks.
    PowerBook G4 12.1 1.5 GHz 512 MB RAM   Mac OS X (10.4.6)  

    Hi College Caleb,
    I think the game will run on your system, although it might be slow sometimes:
    http://forums.civfanatics.com/archive/index.php/t-176229.html
    There's a patch out now from the makers of the game that apparently fixed the sound issues on all systems. Furthermore, even people running Civ IV on dual 2.5 GHz G5s have been experiencing performance issues. Probably they will come up with another patch to make it run more smoothly on all systems. I think I'll give it a try on my PB G4 soon.
    Good luck.

  • My ipad2 doesn't play sound on most games and apps, what did i do?

    I have no sound on most games and apps. But I have sound on pandora and a few others. What's going on here?

    Here's what happened to me, and how I resolved it. In my settings, (Settings->General), I had "Use the Slide Switch to:" set to the default, "Mute." I had the slide switch in the mute position when I went into settings and changed the control for the slide switch to "Lock Rotation." This caused the slide switch control to change to rotation locking, but it left the volume control in the muted state.
    This is where King_Penguin's response comes in: if the slide switch controls rotation locking, you have to use the home button to get to the mute setting. Double-tap the home button to reveal the application switcher bar at the bottom of the iPad. Then swipe from left to right in that bar to reveal the audio controls. The icon on the far left will be of a speaker. If it has a slash through it, audio is muted. Simply tap the icon to toggle it to a non-muted state. Also, you can verify that the volume level itself is not all the way to the lowest setting. The volume slider is on the right side, next to the Music icon.

  • KeyListener, sound problems with game

    Hi All!
    I'm new to gaming.. I've developed a game called Puyo Puyo using Swings. But its got some problems...
    My game plays well for the first time but doesn't restart.
    Im unable to implement keyListeners.. they simply dont work..
    Can someone tell me how to add sounds to my game?
    When executed, a blank window appears first, then on maximising.. evrything else comes into picture.. how do i rectify this? Please help me out at the earliest wid all ur possible and favourable hints n replies..
    Take Care ya'll!

    Hello...
    I'm trying to develope Puyo Puyo(Variation of tetris) game through Java(Java Console Application). The game is like that we have to display 4 types of smiles & if 4 Similar smilies forms the row or Column then score is increased & that row/column will be removed from Application. Still now I'm abel in generation of random smilies & moving then left/ right.
    But how can I manage to create a array of images & detect whether they forming rows/columns. Plz give me Hints.
    Thanks in Advance

  • Creative sound blaster xtreme gamer

    #c dear frens
    i have installed the sound blaster xtreme gamer in my lenovo desktop dat has dual core as its processor.
    when i play the music, i can hear annoying hissing sound from the speakers and while am operating the other programs the music drags and a point the music breaks..it also happens when i access the internet..plz help me out i tried instaaling all the packages but none worked...i have windows 7 as my OS...
    Thanx in advance !!!

    Moep wrote:
    Why i must use TORRENT?
    Why is this driver not on your page?!
    Please fast help...
    and this is a secure download you mean? ....
    Jeez, calm down already. I never said you HAD to download it, but if you want any of the applications that work in XP to work in Vista then you're going to need that disk; either by downloading it or fromk here,?http://us.creative.com/products/prod...7&product=6743?
    2. ISN'T THIS THE DRIVER FOR ME?! http://forums.creative.com/creativelabs/board/message?board.id=Vista&message.id=7838Message Edited by Moep on 07-3-20070:7 PM
    Maybe you really should take a vallium or something and re-read what I posted, then you may just grasp the fact that that is the exact driver I told you you needed.

  • 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 to handle file on application server without coading?

    HI all,
    can anybody tell me How to handle file on application server without coading? Is there any solution?
    Thanks in advance.

    > can anybody tell me How to handle file on application server without coading? Is there any solution?
    what is that you want to handle. what you do if you don't code ...

  • We just moved from the United States to Costa Rica.  The first two days my mac worked great.  Then all of a sudden I was trying to use a game application and the screen went black and there is a white cursor which I can move around, but I can't escape it

    We just moved from the United States to Costa Rica.  The first two days my mac worked great.  Then all of a sudden I was trying to use a game application and the screen went black and there is a white cursor which I can move around, but I can't escape it. When I restart it seems okay and I see my main screen, but only for a second and then it goes black again. 
    This computer was brand new in June.  Is it the humidity???   What can I do.  Please help!!!!

    No guarantess but try smc and pram resets,

  • Crystal Report: irregular error not handled by the application component

    Hi all,
    The error message u201Cirregular error not handled by the application componentu201D comes up when I run any of the Crystal Report in the SAP Business One.
    But this error happens only in the client Machines, from the Server I can run the report normally.
    Thanks and Regards,
    Alberto Franç

    Hi,
    It seems installation and registration problem, have you tried to other client computers? Try to reinstall  the Crystal Report in client.
    Regards,
    Clint

  • Every time I download a PDF I get a message that says There was a RAISE without a handler. The application will now close. What does this mean?

    I work on a Power Mac G5 running OSX 10.5.8.
    We recently had to upgrade Java.
    Now every time I download a PDF I get the message "There was a RAISE without a handler. The application will now close."
    I downloads the PDF OK, but then Safari closes and I have to start it back up to get to my email.
    What is the message telling me? It did not do this before we upgraded Java.

    I'm having the same issue. Again, unfortunately. And of course you will find through various searches that it is a reoccurring issue, one that Adobe seems to have failed to acknowledge.
    You can delete your preference files. Same thing. RAISE blah blah crash.
    You can even go and do a restore from an uncorrupted backup from over 4 months ago, and yet it still doesn't solve the problem, thus there is a compatibility issue.
    The program is battling with another program (of which there really is no telling) and therefore crashing the moment you open it. The software itself is clean and uncorrupted, yet somewhere deep within OSX there is a problem that won't allow the software to open.
    The only temporary solution i've found to solve the problem is a clean adobe install. Just delete and uninstall all and any traces of Adobe Acrobat, then reinstall to find a working adobe product. For a small while, at least.
    I've never tried creating a new account, but from what others say it works. Not worth my time though.
    If anyone was wondering I have zero third party plugins. Its straight from Adobe CS4. Pro version.
    Someone above mentioned using the drop down menu in acrobat to reset the software. I can't even do that! The "RAISE" window pops up before that actual software! Its ridiculous!
    Its really quite peeving to know that this issue has been around for years and Adobe seems to just ignore it. I know I don't want to pay for a company that fails to meet their customers needs. This is your problem Adobe, not ours to deal with. Fix It.

  • 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.

  • How to handle browser or application crash out of our application in java.

    I am running my application(testing automation tool) through ANT . when i run the same over the remote the browser is getting crashed. so if i need to handle it , i should handle outside my application. my application is written only in pure core java. Plz provide me the solution for handling browser crashes outside our application. so that when i run my application over the remote the browser should not crash.... if i use javascript to handle , how do i communicate java script code with pure core java code......

    this is not directly a security related question, but jars within jars won't be found by the JRE; they won't appear in the classpath.
    Some googling:
    http://forum.java.sun.com/thread.jspa?threadID=740123&messageID=4245964

  • How can we handle in flex application if the server is down?

    how can we handle in flex application if the server is down?

    You and me both. 
    As ambiguous as the original question was, I think he was just asking how to handle a server exception and I would suggest generally just using a Alert.show("your specific message (eg.  The server is currently unavailable)") in the place where you handle the fault return from your service or http call.  I'm sure there are more complicated messaging frameworks or approaches, but that seems to be enough for my apps.

Maybe you are looking for

  • Report to ftp to directory

    hi guys, existing i have a report, which with the output, of sending the data into text file through email to the user when execute. but now, i am requested, to have a new code, to allow to send the text file, ftp to a server directory location, for

  • HT5058 Syncing Exchange Account in iCal with iCloud

    I have successfully added an Exchange account calendar to my iCal. Problem is I can't get my Exchange calendar to sync with iCloud. How do I get my Exchange account calendar to sync with iCloud since they appear in different sections? Thank you.

  • How do I format a table in Pages so that I don't have to keep reformatting every time I go to a new cell?

    how do I format a table in Pages so that I don't have to keep reformatting every time I go to a new cell?

  • Tiff bug in CS6 suite

    Hi, There is a big bug in the CS6 , tiff file format have change, and when i generate a tiff file ( flaterned image with alpha layer) in photoshop CS6 or after effect CS6, the alpha layer can not be used in indesign CS5, i need to open my tiff in pho

  • Where are the installed fonts?

    I did an upgrade from Pagemaker 7.0 to InDesign 5.5. I used my installed fonts in Pagemaker without problems. Now, if I opened a Pagemaker document in InDesign there was missing the font. If I'm using MS Word the font will be avaliable.Also it works