How to set volume with AudioServicesPlaySystemSound?

I got playing sound with AudioServicesPlaySystemSound working, its quite simple but theres no documentation on how to set volume at all. Is it possible and how?

Did you ever find an answer to this? I need to do the same thing.

Similar Messages

  • "set volume with/without output muted" in Objective-C?

    I have a couple of one-line AppleScript scripts to mute and "unmute" my computer's volume:
    set volume with output muted
    and
    set volume without output muted
    I would like to implement the same functionality in Objective-C, so that I can use it within a Cocoa app.
    I've looked into the reference documentation for (e.g.) CoreAudio, but this is clearly geared to people coding complex audio apps, and I'm quickly swamped by information that looks like far more than I should need to mute/unmute the machine's main volume control.
    Could someone help me focus my search for info on how to implement this task?
    TIA!
    G.

    Normally I'd recommend the Scripting Bridge, but in your case it's very simple so let's keep it simple. Just use NSAppleScript ...
    NSAppleScript* as = [[NSAppleScript alloc] initWithSource:@"set volume 0"];
    [as executeAndReturnError:nil];
    0 will mute, 1 through 10 will set volume unmuted. Or you can use your Applescript's in place of mine.
    Eric

  • How to set volume using Powershell script?

    I would like to know on how to set volume under Window 7 Home 64 bits system using Powershell script.
    Such as 8000 levels as default
    Does anyone have any suggestions?
    Thanks in advance for any suggestions
    Thanks in advance for any suggestions

    Try this.
    Function Set-SpeakerVolume{
    Param (
    [switch]$min,
    [switch]$max,
    [int]$Percent
    $wshShell = new-object -com wscript.shell
    If ($min){
    1..50 | % {$wshShell.SendKeys([char]174)}
    ElseIf ($max){
    1..50 | % {$wshShell.SendKeys([char]175)}
    elseif($Percent){
    1..50 | % {$wshShell.SendKeys([char]174)}
    1..($Percent/2) |% {$wshShell.SendKeys([char]175)}
    Else{
    $wshShell.SendKeys([char]173)
    This works in Windows 8.1.
    Stolen / Modified from
    http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/28/weekend-scripter-cheesy-script-to-set-speaker-volume.aspx, which took me 20 seconds of (apparently) lucky searching.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How use set up with office 2011 for mac as I did keep tried put download but it's always 'update' download. I want get start set up new office 2011 for mac? please help me

    how use set up with office 2011 for mac as I did keep tried put download but it's always 'update' download. I want get start set up new office 2011 for mac? please help me

    You must be using an update CD.  You need the software that has the full version first - install that, then you can use the update one if needed. I know, cuz I made the same mistake - lol

  • How-To Set Up with Uverse Gateway with Airport Extreme

    I just spent hours figuring this out so I thought it would be helpful to someone. Maybe, maybe not. My goal was to get Back to My Mac turned on...but this should also be how you set up your wireless network if you have both an Airport Extreme and a Uverse Gateway.
    As I was trying to setup BTMM, I got a "double NAT" error. To use BTMM, you have to use either Time Capsule or Airport Extreme, so that NAT has to be enabled. That meant I had to figure out how to turn off U-verse's. I looked through the settings but saw nothing about it. Several hours of research--and a useless support call to AT&T--I finally figured it out. Here's the configuration you need, in brief.
    On the Airport Extreme, under Internet > Internet Connections, Connection Sharing must be set to "Share a public IP address". Then under the NAT button, Enable NAT Port Mapping Protocol must be checked.
    Now, unless you doe rest of this configuration, you will get a double DHCP error. So, in the Uverse Gateway settings, you must do this:
    1. Under Wireless, click the option to DISABLE wireless. Click Save.
    2. Under Firewall, click the option with DMZ in the name. On this page, choose your Airport Extreme (whatever you named it). Then scroll down and choose the option that says "Allow All Applications (DMZPlus Mode)". Save that configuration. DO A HARD RESET ON THE AIRPORT EXTREME. Then that should enable a single NAT protocol and BTMM will be on its way. And your wireless network will be set up properly.

    Will the above method work on a set up with a Verizon Modem to a DLink wireless router to a Time Capsule?
    I know of no reason why it would not. Whenever there is another router ahead of the Time Capsule, the Time Capsule must be configured in Briddge Mode. My network has 4 routers. The "main" router is setup to handle DHCP and NAT and the other 3 routers are setup in Bridge Mode. No problems.
    Weird thing is Air Video set up tells me I have a double NAT
    Double NAT occurs when you have two routers on a network both set up to handle DHCP and NAT services. Your Verizon "modem" may be a gateway....a combination modem/router on the same chassis. If that's the case, then every other router on the network must be confgured as a "Bridge".
    If you have the "main" router on the network setup to handle DHCP and NAT, in theory, you can have multiple other routers on the network as long as they are all setup in Bridge Mode. In Bridge Mode, DHCP and NAT are turned off, so the other routers simply pass through the network information from the main router. It's by far the easiest way to configure multiple routers without having to go into special DMZ, port mapping, etc type of configurations.

  • How to set encoding  with xmldom ?

    Hello !
    I have to build an xml file from a query.
    I need to have : <?xml version="1.0" encoding="ISO8859-1"?> on the first line.
    I know how to set the version --> xmldom.setVersion(doc,'1.0'); ... but I don't know how to set the encoding.
    Is there a way to set it ?
    Thanks

    No. It is not possible. Here is an extract of a document I found on metalink :
    (XML Parser for PL/SQL FAQs)
    Q: Is it possible to dynamically set the encoding in the XML document?
    A: No, you must include the proper encoding declaration in your document, as
    per the specification. You cannot use setCharset(DOMDocument) to set the
    encoding for the input of your document. SetCharset(DOMDocument) is used
    with oracle.xml.parser.v2.XMLDocument to set the correct encoding for
    printing of the document.

  • How to set  dbURL with characterEncoding

    hi all,
    How can I add characterEncoding in my JDBC connection, do I need to do that inorder to insert and display Chiness character into mysql db?
    Thank you!

    Hi,
    BTITLE works a lot like TTITLE. See your other thread:
    how to set page number & current date in sqlplus result
    It's not considered nice to post (essentially) the same question more than once.
    If it happens by accident (which is easy to do on this site) then mark one of the duplicate threads as "Answered" right away.

  • HELP!Simple MIDI player based on Sequencer:how to set Volume?

    Hi,i'm Roberto,i'm student and i'm realizing a simple midi player in java (using java1.5 and javax.sound.midi package).....the program has a gui and it can just play midi files,and the player is a class based on a Sequencer object:so the method play() initializes a Sequence object from a file and this is given as parameter to the sequencer,so it runs with Sequencer.start();......
    my BIG problem is:"how can change the volume when playng if the player's class is created as above?","how can i realize a method setVolume(int volume)?"......please help me!!!!!

    Did the previous post fix the problem?
    At what point should the synthesizer and sequencer be opened?
    Can the volume be set at anytime during playback?
    I have a similar problem and i tried both of these solutions and they did not work for me.
    Heres my code:
        /** The midi sequencer */
        private Sequencer sequencer = null;
        /** The synthesizer (for volume control) */
        private Synthesizer synthesizer = null;
        /** The volume (as a percentage) */
        private double gain = 100.0d;
         * Default constructor.
         * @since 1.0
        public MidiPlayer() {
            try {
                 // get the system sequencer
                this.sequencer = MidiSystem.getSequencer();
                // get the system synthesizer
                this.synthesizer = MidiSystem.getSynthesizer();
                // open the sequencer
                this.sequencer.open();
                // open the synthesizer
                this.synthesizer.open();
                // link the sequencer to the synthesizer
                this.sequencer.getTransmitter().setReceiver(this.synthesizer.getReceiver());
                // set this class to list for meta events
                // (end of track event in particular)
                this.sequencer.addMetaEventListener(this);
            } catch (MidiUnavailableException ex) {
                // TODO error handling
                 ex.printStackTrace();
        public void play(Sequence sequence, boolean loop) {
            if (this.sequencer != null && sequence != null && this.sequencer.isOpen()) {
                try {
                     // give the sequencer the sequence
                     this.sequencer.setSequence(sequence);
                    // start the sequencer
                     this.sequencer.start();
                    //set the loop flag
                    this.loop = loop;
                } catch (InvalidMidiDataException e) {
                    e.printStackTrace();
                    // TODO error handling
         public void setGain(double gain) {
              this.gain = gain;
             // change the percent value to a respective gain value
            int value = (int) (127 * (double) (this.gain / 100.0));
             // modify the volume of the sequence
            MidiChannel[] channels = this.synthesizer.getChannels();
            for(int i = 0; i < channels.length; i++) {
                 channels.controlChange(7, value);
              MidiChannel[] channels = this.synthesizer.getChannels();
              for (int i = 0; i < channels.length; i++) {
                   channels[i].controlChange(7, (int) (127 * (this.gain / 100.0)));

  • How to set up with cacheing DNS for local network?

    Our new Lion Server has a static IP Address pointed to over the internet by our registrar's zone file. Planning the Lion Server installation process with the intent of hosting Web, Mail and Open Directory services to a small number of users who are nearly all located off-site. I do also want Lion Server to be a caching DNS Server and DHCP authority on the local network to replace what dnsmasq does on our current Linux server.
    I am looking forward to offloading some of the lower level Linux administration tasks and putting myself in the hands of the Lion Server Setup Assistant and Server App :-) but at the same time don't understand some of  its assumptions and fear having to spend a lot of time experimenting and re-installing.
    So, specifically, I want the Server App to know that my Lion Server has a "Host Name for the Internet" but that the DNS it sets up will not be the DNS for my zone - I will be managing that through my registrar's interfaces.
    Second problem is my fnot understanding what name space devices on the local network will / should use. e.g.  The Linux server will be available for backups etc  on the local intranet (and optionally have a static ip address on the Internet) but MacBooks, PCs, iPads and iPhones will be served ip addresses by the Lion Server's DHCP. So will / should these dynamic devices have their machine names fully qualified by our domain name with RFC 1918 style ip addresses or something like .local?  How do I tell this to Lion's Server App / Setup Assistant? How easy is it to update these initial settings later?

    You do indeed need to have a master zone on lion server.  There's no way to get around that since Open Directory depends on Kerberos and Kerberos depends on the DNS.  LS scripts may see that the rDNS record exists, but I highly doubt that it'll auto configure everything for you... and given the number of possible variables, I bet that even if it worked something would need additional tweaking.
    Sounds like an interesting lab excersize.  You should try it on a test server!
    Again... you just need to folow the set up procedure that Lion Server presents you with. 
    It won't be smart enough to see your external records and use them to configure a key distribution center for your OD. 
    As far as your caching needs...  Could you set up your DHCP server to set the DNS server setting to show your internal server as the first hit, and your external as the second?  That way when the client requests a resolution it'll not get a hit on your local server but will from the external? 
    The question then is how long will it wait for a response from the first server?  Or will the first server respond with "I don't know" sending the client immediately to the second.
    The server set up that I have works similarly.  I have an internal master DNS that is replicated to a secondary.  The first DNS has an A record (community.server.com) that points to the INTERNAL ip address of the secondary server that's also running the web service.  The first server is running DHCP.  It tells the clients to use the first and second servers as it's DNS lookup. 
    Now...  Externally, my registrar hosts an A record for community.server.com that points to the external IP address of my router which then forwards the request to the proper port on the internal network.
    This way, the local clients internally look up and get a response locally when they go for community.server.com.  Externally, clients that look up community.server.com get the external connection to the router in my school.
    Yikes...  I fear that this is as clear as mud!
    -Graham

  • How to set hint with SQL profile

    Hi,
    I need to put a leading hint into a sub-query
    How can I do that ?
    I tried:
    dbms_sqltune.import_sql_profile
    sql_text => 'select ...'
    profile => sqlprof_attr(XXXXX) => I don't know what to set for XXXXX
    name => my_sql_profile
    force_match => true)10.2.0.4
    Thanks for your help

    I need to put a leading hint into a sub-query It doesn't sound like a good idea.
    If you're going to hint - especially using plan stability features - then you need to hint fully otherwise you're asking for trouble.
    See http://jonathanlewis.wordpress.com/2011/06/08/how-to-hint-1/
    The "best" approach to this sort of generic question is to run the sql statement with the single leading hint (if that really is desirable) then extract the full set of hints from that execution (which will have a different sql id) and apply it to your original statement.
    If you have a look at COE_XFR_SQL_PROFILE.SQL in Oracle Support doc id 215187.1 then that will give you a good idea of how to do it.
    That script is not exactly what you want because it uses a sql profile to apply a previously generated plan for that specific sql taken out of AWR or the cursor cache, but the principle is the same.
    This is using SQL Profiles as they were not originally designed - which was vehicles for statistical adjustements - but using them like stored outlines (the latter deprecated in 11.1 onwards).
    SQL Profiles require the tuning pack.
    You have not mentioned version but depending on that, it might be that SQL Plan Baselines are the appropriate mechanism and you can achieve something similar to that mentioned above using dbms_spm.load_plans_from_cursor_cache:
    load_plans_from_cursor_cache 
    (sql_id           IN VARCHAR2,   <---------- the sql id of the manually hinted sql from which to copy the plan
    plan_hash_value  IN NUMBER := NULL,  <-------------- the plan in memory to copy
    sql_text         IN CLOB,  <-------------------- the sql text of the sql to apply the plan above to (get via a direct look up from v$sql or dba_hist_sqltext as necesary)
    fixed            IN VARCHAR2 := 'NO', 
    enabled          IN VARCHAR2 := 'YES') Whichever method you use, avoid any sort of solution involving a single hint directed at a subquery.
    Edited by: Dom Brooks on Nov 26, 2012 9:48 PM
    reworded

  • How to set volume levels in individual apps.

    I know on windows, you can set the volume for programs in the background, how do I do something similar to this on my mac?
    Best Regards,
        Patrick

    No, unfortunately.
    There is no  Volume Mixer / Windows  like utility available in OS X.
    Google it. I do not use any third party utility.
    Best.

  • How to set Volume for Nokia N95(8GB)

    Hey,
    I own a Nokia N95 (8GB)
    works rather well...
    Some how i have managed to damage the Volume Buttons on the side of the phone and my volume for my music is set to the default "Volume Level"...(Which isn't very loud)
    I need some help 'how to higher the volume without using those buttons on the side'
    Please,
    thanks Brad

    Doh!
    You're right! Connect the remote (Like the AD-54) and use the remote to control the volume.
    Message Edited by el_loco on 03-Jun-2008 12:43 AM
    640K Should be enough for everybody
    El_Loco Nokia Video Blog

  • How to set CLASSPATH with makePropertiesObject in WLST

    In Weblogic 9.1 we are using Nodemanager to start the Admin Server in WLST using nmStart. We want to set some memory args for the Admin server and I was told by BEA that you'd use makePropertiesObject to this and pass this object to nmStart, that was fine. We also want to update the admin server classpath and were told makePropertiesObject could also be used for this.
    I'm doing
    arg = "Arguments=\" -client " + jvm_args + "\""
    prps = makePropertiesObject (arg)
    nmStart(targetserver, domain_home, props=prps)
    where jvm_args ="-Xms256m -Xmx512m -XX:MaxPermSize=128m -Djava.class.path=..."
    Also tried
    jvm_args = "-Xms256m -Xmx512m -XX:MaxPermSize=128m -cp ......",
    However, in both cases the Admin Server process is running with default "-Djava.class.path=...", plus a my "-cp myclasspath" or "-Djava.class.path=myclasspath", depending on which method I used. Am I doing something obviously wrong ? When the Admin Sever is started by NM using nmStart how would you set its classpath ? Should another command be used for starting the Admin Server instead ?

    Hello,
    http://edocs.bea.com/wls/docs91/server_start/nodemgr.html#1083353
    This link lists the list of properties that can be specified to start.
    Normally, for managed servers, the admin server collects the values for
    these properties from various config mbeans and sends them to the
    nodmanager. For starting the admin server itself, a properties object
    can be created and the values explicitly populated with desired values
    and passed to nmStart.
    Classpath is one of the properties to send to the nodemanager while
    requesting server start.
    HTH,
    -satya
    BEA Blog:
    http://dev2dev.bea.com/blog/sghattu/
    Get Involved in CodeShare:
    https://wls-console-extensions.projects.dev2dev.bea.com/
    https://wlnav.projects.dev2dev.bea.com/
    https://eclipse-wlst.projects.dev2dev.bea.com/
    https://wlst.projects.dev2dev.bea.com/

  • How to set Updates with 11.3 when using Apple Remote Desktop for installation?

    So for all pre-11.3 versions of Flash Player on OSX, I have just pulled out the "Adobe Flash Player.pkg" installer package from the installer .dmg and used Apple Remote Desktop to deploy Flash to the Macs I manage.
    However, when doing that with Flash 11.3, this leaves the "Updates" setting in the Flash Player System Preference set to "Notify me to install updates".
    I'd like to push something that would set this to "Allow Adobe to install updates".
    Is there a way to modify the .pkg installer to have the System Preference set to that value (or push/copy some other .plist file to the clients to have that setting enabled?)
    Thanks!

    I poked around a bit and the file seems to be:
    /Library/Application Support/Macromedia/mms.cfg
    I'd like to get some confirmation from Adobe that this is the correct file to push, though (it seems like it as it only contains this):
    AutoUpdateDisable=0
    SilentAutoUpdateEnable=1

  • How to set "browser with" to a direct ip open at IE

    Hi all,
    I am using VS2013 Express for web, evertime i browse with IE, it point to localhost. Could i set to http://192.168.8.11 (local ip) for some reason.? 
    I wanna use local iis instead of iis express.
    I am using .net 2.0 file.
    Thanks alot.

    Hi andrewlpchan,
    I am glad that you have solved the problem and thanks for your share us the solution here, so it would be helpful for other members
    who get the same issue.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for