Adjusting sound volume from inside the game???

hi there all,
how can i adjust the pc volume from the game?? like in options menu....
TiA

Use something like this to set the volume for the Clip. Then play it.
If you need to access it in an option menu, save the value (mute)0..100 (load) and allow the user to select the volume from a cobmo box or list box containing 0, 10, 20 ... , 100.
  public static void setVolume(Clip clip,int volumePercent)
    try
      if (clip.isControlSupported(FloatControl.Type.VOLUME))
        FloatControl volumeControl = (FloatControl) clip.getControl(FloatControl.Type.VOLUME);
        volumeControl.setValue((float) (volumePercent / 100.0));
      else if (clip.isControlSupported(FloatControl.Type.MASTER_GAIN))
        float value = (float)(volumePercent / 100.0);
        FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
        float dB = (float)(Math.log(value == 0.0 ? 0.0001 : value)/Math.log(10.0)*20.0);
        gainControl.setValue(dB);
    catch (Exception exception)
      println("Problem in Media.setVolume");
      exception.printStackTrace();
  }

Similar Messages

  • Targeting the EdgeID object from inside the animation

    I've been working on an animation that displays content pulled in from json files.  The height of the content pulled in is determined and then the Stage height is adjusted to fit the total content. This works well by itself. See http://www.jomariworks.com/edge-json (Only west coast links are live. Project files http://www.jomariworks.com/edge-json/edge-json.zip)
    Now I'm embedding the animation in a page using the oam insert feature, which creates an object with a fixed size.  When the animation adjusts the stage height, the object window size does not change. When the content is longer than the object window, the content scrolls.
    Is there a way I can target the height of the object (id is EdgeID) during the execution of the animation?
    The live version of this can be viewed at  http://reconnectingamerica.org/spacerace/index.php.  The project files at http://www.jomariworks.com/edge-json/edge-json.zip are the same as far as functionality goes.
    Thanks in advance for any help.

    After being unable to discover how to target the height of the object containing the embedded edge animation, I have gone back to having the entire page part of the animation file.
    The final web page is online at http://reconnectingamerica.org/spacerace
    There are big disadvantages of this:
    The full web page has more than 7000 lines of HTML.  Making changes in Edge Animate is a VERY slow process.
    Edge Animate corrupts the HTML in the file. This file contains complex TABLEs.  After making changes in Edge Animate and saving those changes, the TABLE headers are all corrupted (e.g. closing THEAD tags are moved above the head content and several closing TR tags are relocated. For the record, I checked.and the original HTML is syntactically valid.).  To deal with this I removed the tables when editing in Edge Animate and after making changes and publishing the Edge Animate version of the HTML I restored the tables.
    Working separately on the animation and then embedding is clearly the better workflow in this situation. Unfortunately, I needed to be able to resize the embedded animation's object container in the same way I was able to adjust the Stage from inside the animation.  Not being a jQuery wizard I couldn't figure out how to target the height of the animation's parent container.  Still interested in finding out how to do that if anyone can help.
    Message was edited by: jomariworks

  • Whenever I use the trackpad on my 17" Macbook Pro (2010 model) there is a small, trebly processor sound coming from within the enclosure.

    Whenever I use my trackpad, there is a whirring, trebly sound coming from within the computer itself. It happens also when webpages are loaded or programs are compiled, but not when I use the keyboard or when the computer is in disuse. It has become louder over time, and it is obvious that when the computer senses input from the trackpad and must translate it, the sound is produced. Is there any way to reset the firmware or an option on the Settings menu that could perhaps help? I am concerned that it is a symptom of a larger problem. Thanks.

    The question mark means the computer cannot find a bootable volumes so can;t do anything, That, combined with annoying sounds, strongly suggests a failed hard drive.
    You can ask a "genius" at an Apple Rtail Store to test it but I'm pretty sure the drive is kaput. I'm hoping you had your data backed up.

  • Can I import HTMLs from inside the project and use as portlet page ?

    As you know, I am using Java Studio Creator 2 Update 1 for my current portal project. I have created JSR-168 JSF Portlet Project for my portlet development.
    As I have some html pages ready for my development,
    Can I import HTMLs from inside the project and use as portlet page for my project?
    I did the followings steps:
    1: In side the project - File -> Add Existing Item -> Web Page ( imported test.html page from my local folder)
    2: Let it convert some of the tags for me ( so now it becomes - �test.jsp� )
    3: Set it to initial view.
    4. A default portlet page � newPortletPage.jsp is still there with no initial view.
    Now after doing this, No Visual Designer and Properties window available to for that �test.jsp� page. Though it allowed me to �build� the project successfully.
    When I build and run the portlet application, got the error message �Error occurred in portlet!� on Pluto Portal. Please advice.

    You do not open fcpproject files. You don't double click or anything else. The files have to be in the correct folder structure in the Final Cut Projects folder and the application opens them automatically. Can you post screen shots of the Final Cut Projects folder and its location.

  • I have the 4th generation iPod touch and my friend changed the iPod passcode and she cant remember it. Im on the iPod, Im not locked out. Im wondering if there is a way to change the passcode from inside the ipod settings or something?

    My friend cant remember the password. Can I change it from inside the iPod settings or something?

    Your friend could only have changed it if they had your original passcode - you have to be able to enter the current passcode to change it to a new one.  Once you restore it now, I would then change it and NOT give it out to people.
    P.S. if you have a backup from when it still had your passcode on it, just restore from that backup and it should set the passcode back to what you had.
    Without that backup, you will have to restore as new, and set everything up again from scratch.

  • I want to purchase from within the game and show me what is the solution of this letter: Please advise and thank you (Your purchase could not be completed. For assistance, contact itunes support at)

    I want to purchase from within the game and show me what is the solution of this letter: Please advise and thank you (Your purchase could not be completed. For assistance, contact itunes support at)

    You need to click here and ask the iTunes Store staff for assistance.
    (100508)

  • How to retrieve data from inside the folders in SharePoint SSRS

    Hi ,
    How to get the data from inside the folders and subfolders.
    How can I do that.
    https://social.msdn.microsoft.com/Forums/en-US/15451351-4ee2-428c-a0b7-135810e4cbfa/action?threadDisplayName=ssrs-reports-sharepoint-list-datasource-how-to-retrieve-items-from-subfolders
    Here the information is not given.
    Regards
    Vinod

    Hi Vinodaggarwal87,
    According to your description, you want to retrieve data from sharepoint list in a sub folder. Right?
    In this scenario, we should select the XML data source type and in the connection string provide the
    List.asmx service URL when creating data source. Then we need to use the List web Service and specify "recursive" for ViewAttribute in Lists.asmx. For detail steps, please refer to the links below:
    Generate SSRS report on SharePoint List with folders using List Service.
    SSRS: how to specify ViewAttributes when creating a report against a SharePoint's list
    If you want to set the ViewAttribute on CAML query level. You need add the view tag outside of query tag:
    <View Scope="RecursiveAll">
        <Query>
            <Where>...</Where>
        </Query>
    </View>
    Reference:
    View Element (List)
    ViewAttributes Recursive Scope not working SharePoint 2013 CAML Query to fetch all files from document library recursively
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • My account is charged $ 50, and I can not purchase from within the game clash of clans

    My account is charged $ 50, and I can not purchase from within the game Clash Of klans I hope to solve the problem

    contact iTunes support http://www.apple.com/support/itunes/contact/, we are just fellow users and can not resolve this issue for you.

  • How to copy/access a string from inside the driver

    is there any equivalent to strncpy() to use inside
    the driver for copying user sent data to local buffer .
    i used I_STRioctl and assigned struct to strioctl.ic_dp
    as shown below..
    char * buf;
    struct user-data
    int minor;
    char* data;
    struct user_data u_data;
    buf="hello world"
    u_data.minor=0;
    u_data.data=buf;
    strioctl.ic_dp=&u_data;
    strioctl.ic_len=sizeof(struct user_data);
    ioctl(fd,I_STR,&strioctl);
    when i tried to copy/access the string sent by the user application from inside the driver, machine gets into
    booting ...
    here what i did was
    in wput routine
    struct user_data *u_data;    
    u_data =(struct user_data*)mp->b_cont->b_rptr;      
    cmn_err(CE_NOTE,"minor= %d",u_data->minor);
    till here working well..
    where as..
    cmn_err(CE_NOTE,"data= %s",u_data->data);
    causing panic to the system...booting happens.
    please help me out ..
    thank u all
    ss vasu

    looks like the data pointed to by 'data' is not copied from user space to kernel space.
    u_data.data=buf, just makes pointer assignment, does not copy data pointed to by buf.
    two solutions:
    1. Declare data as a array(char data[10] or something
    2. Copy buf after the structure and point data to it. strioctl.ic_len should be set to sizeof(struct) +
    data size.
    -Vijay
    is there any equivalent to strncpy() to use inside
    the driver for copying user sent data to local buffer
    i used I_STRioctl and assigned struct to
    strioctl.ic_dp
    as shown below..
    char * buf;
    struct user-data
    int minor;
    char* data;
    struct user_data u_data;
    buf="hello world"
    u_data.minor=0;
    u_data.data=buf;
    strioctl.ic_dp=&u_data;
    strioctl.ic_len=sizeof(struct user_data);
    ioctl(fd,I_STR,&strioctl);
    when i tried to copy/access the string sent by the
    user application from inside the driver, machine gets
    into
    booting ...
    here what i did was
    in wput routine
    struct user_data *u_data;
    u_data =(struct user_data*)mp->b_cont->b_rptr;
    r;
    cmn_err(CE_NOTE,"minor= %d",u_data->minor);
    till here working well..
    where as..
    cmn_err(CE_NOTE,"data= %s",u_data->data);
    causing panic to the system...booting happens.
    please help me out ..
    thank u all
    ss vasu

  • Editing track order FROM INSIDE the iPhone

    Is it possible to edit the tags on the tracks from inside the actual phone? I don't have access to iTunes right now, and an album I'm listening to is horribly out of order. Is there any way to get it to play in the proper order by just using the resources on the actual phone?

    The only way I know of is to use the on the go playlist feature (covered on page 66 of the manual):
    http://manuals.info.apple.com/enUS/iPhone_UserGuide.pdf

  • I received a replacement Ipod 4th generation and want to retore from backup the games

    I received a replacement Ipod 4th generation and want to retore from backup the games that we had on the previous I-pod touch but nothing happens

    It also will not let me hook up to our WIFI,..

  • My account is charged $ 50, and I can not purchase from within the game Clash Of klans I hope to solve the problem iPad, iOS 6.1.2

    My account is charged $ 50, and I can not purchase from within the game Clash Of klans I hope to solve the problem
    iPad, iOS 6.1.2

    Hi Ssgtn,
    Contact iTunes Support:
    https://expresslane.apple.com/Issues.action
    Cheers,
    GB

  • Execute binary from inside the app?

    Hello! I'm working on a Mac App that on the push of a button, will execute a binary file from inside the .app file. But I don't know where to place the binary so i can access it, and how to execute it.
    Thanks,
    Andrei

    Hello,
         We are able to use the Java Gui directly from the mac without any problems.
    We are recieving the following error from the Mac Console when we execute the Iview from with the portal.
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] ### MRJPlugin:  getPluginBundle() here. ###
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] ### MRJPlugin:  CFBundleGetBundleWithIdentifier() succeeded. ###
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] ### MRJPlugin:  CFURLGetFSRef() succeeded. ###
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] _NSJVMLoadLibrary: NSAddLibrary failed for /System/Library/Frameworks/JavaVM.framework/Versions/(null)/Libraries/libjvm.dylib
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] JavaVM FATAL: Failed to load the jvm library.
    Were the (null) is located in the error log above we presently have version 1.4.1, 1.4.2, 1.5.0, 1.6.0.   So it looks as if it isn't getting the version of java from the Transaction_configuration file that it should be pointed to.
    Any suggestions.

  • I have a problem when buying from within the game

    I have a problem when buying from within the game
    i used visa..

    All games? Settings > General > Restrictions has an option to prevent In-App Purchases. Is that on?

  • Adjust sound volume with as2

    Hello,
    I am working on a project with background music.  Is there a way to adjust the sound volume?  My project is using AS2 and I would like to keep it an AS2 project.  Is there a script that I can put in my actions panel to adjust by percentage? 
    thanks,
    Mark.

    what timeline contains the code and what's the relationship between that timeline and the one that contains the sound?

Maybe you are looking for

  • Help needed very urgent

    I have problem in downloading a file through a servlet. Let me put my points clearly. When a client requests my servlet using setcontenttype, setheader methods I prompt for the 'save' option. The client can choose the file and save in his local direc

  • SAML2 Service Provider not writing artifact key to cache

    I have been following http://biemond.blogspot.com/2009/09/sso-with-weblogic-1031-and-saml2.html to attempt to get Single Sign On working. I created 2 new WebLogic 10.3.3 domains using an RDBMS Security Store (They are both pointing to the same RDBMS

  • 0 bytes file free on curve 8320??

    All, Please help, I got stuck with my 8320. Device is "thinking" very often and impact to my activities and also the battery. When I check Status on option, File free is 0 bytes.. but when i restart (take off the batt), file free is have some bytes a

  • Trouble opening photoshop elements after download.

    I am having trouble opening photoshop elements. When I get done downloading it, it opens up as a text document in textedit.

  • Data Transfer Objects Design Pattern

    Hi All, Could anyone tell me more about this DTO design pattern, as such when one should prefer it. Second is this pattern transaction safe or one would have to implement the same manually. Any updates would prove benefecial to me.