"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

Similar Messages

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

  • I can't get volume on Main Output to work correctly with controllers on my keyboard. It's either all on or all off. Works fine for individual instruments (thought it lumps them all together) but not for main volume output on concert. Thanks for any help.

    I can't get volume on Main Output to work correctly with controllers on my keyboard. It's either all on or all off. Works fine for individual instruments (thought it lumps them all together) but not for main volume output on concert. Thanks for any help.

    Hi
    frodojon wrote:
    I either didn't do the correct mapping sequence before or I'm starting to wonder if it has something to do with my keyboard which has the expression pedal set to the same volume control as the mod wheel.
    All this sounds like you are confused about the general nature of MIDI Continuous Controllers (MIDI CC). The MIDI specification allows for 128 different CC's: CC0 to CC127. Some are typically "preallocated" to 'standard functions: CC1= Modulation, CC7=Volume, CC10+Pan, CC11= 'Expression'. Some act as switches such as 'Sustain' CC64.
    frodojon wrote:
    Everything appears to be scaled from -63 to +64 if that's what you mean by scaling?  What do you mean by MIDI CC7?
    Mainstage works with MIDI CC's generally in a number of ways:
    Some standard ones are automatically passed through to all MIDI/Instrument channels unless you specifically block them. Others are not passed through unless you specifically map them to something.
    This mapping can be done basically two ways (with MS 2.2):
    a) Make a Screen Control in Layout mode, and assign it to a particular incoming MIDI CC message. Then, you can map this Screeen Control to a variety of parameters such as the volume of a particular channel strip.
    b) With MS 2.2, you can do the above Assign and Mapping directly, without the need for Screen Controls as an 'intermediary'.
    frodojon wrote:
    something to do with my keyboard which has the expression pedal set to the same volume control as the mod wheel.  I
    Yes.
    It sounds to me like you have an issue where you have several hardware controls on your Keyboard set up to transmit the same MIDI CC. This is probably not a good idea, and it would be much better if you assigned them to transmit different CC messages (CC1 for Modulation and probably CC11 for the Expression (though you may want to set the pedal to some other number instead.
    Once you are transmitting different CC messages, you will be able to Assign and Map much more flexibly:
    for example, you could one to control the overall output volume at Concert Level in MS, whilst the other controls the volume of a specific channel within a Patch.
    Your issue of layered patches is one of "Scaling": one Screen Control (assigned to an incoming MIDI CC message) needs to alter the ranges of different channel strips to different amounts. You can set this up by using multiple mappings for one Control, each set to work over a particular range (for example a goes from -20 to 0 whilst b goes from -30 to -20 etc.).
    hth
    CCT

  • I think things would have been better without this icloud mess......  someone help me like it again.   1). i have more than 1 account set up with icloud. so i deleted 1 account from the settings on my iphone to try and switch to the other account and ever

    i think things would have been better without this icloud mess......
    someone help me like it again.
    1). i have more than 1 account set up with icloud. so i deleted 1 account from the settings on my iphone to try and switch to the other account and everything became a huge mess. (on my iphone i LOST some of my contacts, all of my reminders are gone, and nothing is showing up on the ical on my iphone, and only some notes are showing).......
    2). everything is still shown on my macbook pro.... but when i tired to go and sync it..... nothing is transfering to my phone........
    3). when i log into the 2 icloud accounts i have with icloud(.com) nothing is showing up in there also......
    whats is going on..... this is a huge mess for me. i want to go back the way is was like 1-2 years ago. when you can just sync things from the computer to the phone and not have to go through icloud....... ive been struggling with icloud but today just me hate it to the max.
    ANY HELP ON HOW I CAN FIX ALL OF THIS.....
    THANK YOU VERY MUCH!

    the version im using is 10.7.5
    im not sure what you mean by you second statement. when i open those application on my macbook its on my macbook but when i sign into icloud. i have those option selected.
    maybe my problem is im using the wrong ID...... lol.
    is there away you can delete or change icloud accounts/ ID's???

  • Hi, I want to use my Capsule just as a back up via wireless. How do I set this up without connecting it with an ethernet cable to either a router or the iMac??

    Hi, I want to use my Capsule just as a back up via wireless. How do I set this up without connecting it with an ethernet cable to either a router or the iMac??

    I misunderstood what Time Capsule is and had hoped for a wireless backup device that didn't have to be connected to the router.
    The TC is a wireless backup device.. it does not need to be connected to the main router..
    The problem is the computer.. not the TC.. the computer has only one wireless card.. if your current internet is by wireless.. then you must choose.. internet or backup.
    But my other suggestion will work.. get a wireless USB stick compatible with Mac OS.. there are plenty and cheap.. since you are in the same room as the TC they will work fine.. plug it in and load the driver.. taint hard.
    You should do the first backup by ethernet though.. wireless is too slow.. once you have that, you will do fine.
    Search ebay for wireless n usb.. Mac compatible..
    http://www.ebay.com/itm/New-EDUP-Mini-Wireless-11N-300M-USB-LAN-Card-WiFi-Adapte r-Nano-Card-Soft-AP-/150864362939?pt=US_USB_Wi_Fi_Adapters_Dongles&hash=item2320 377dbb#ht_3553wt_1165
    As you can see.. they are getting smaller and neater.
    I have no idea if it works .. haven't tried one.. but I have used USB wireless stick on the Mac to overcome this issue.
    You will need to set static IP .. not hard but you need to set specifics if you do buy one post again for the setup.

  • Spare and Repair aviation engineering parts/objects to be set into video and posted online.  Need to know what integrating software will I need to accomplish:  interactivity with cursor to rotate these objects for viewing analysis?

    GOAL:  Present video demonstrations of aviation engineering spare and repair objects for re-engineering and Request for Quotes.
    SPECIFICS:  Would like to present with interactivity capable to rotate objects.
    CURRENT SOFTWARE:  entire CC Master Collection
    EXPERIENCE:
         Photoshop CC (Advanced)
         Illustrator CC (Advanced)
         InDesign & Copy CC (Advanced)
         Dreamweaver CC (Advanced)
         Flash with ActionScripting CC (10 years ago -- still retain some knowledge but would need a Refresher Learning Curve)
         Premiere Pro CC     (Beginning)
         After Effects CC      (Beginning)
         Audition CC            (Beginning)
         Speed Grade CC     (Beginning)
    QUESTION:   What integrated media software will allow me to accomplish GOAL?   . . . currently strategizing learning curve for production plan.
    Please, advice.  Sincerely, Idaglia Florez

    you could do that with javascript and html.
    but it would be more work unless you used a tool like flash to create those files.  i'm not sure what the security issues with flash are, but i can't see any security issues with javascript and html either whether created by flash or done without a tool (like flash or edge etc).

  • Is it possible working with screen without UDO and No object

    Hi All ,
             we can develop screens  without using User Defined Object and No object
    If yes ,tell me how
    Thanks in Advance
    Vivek

    Hello,
    Yes, you can develop forms without UDT and Object.
    It is not easy, you should program every standard procedure like, find, add, update, delete, navigation (first, last, next previous).
    In some previous versions, while the UDO was not present i was using this...
    For UDT you can use databrowser, and you can bind data to the UDT tables.....
    Good luck.
    János

  • Reading the output from a object running in the local machine.

    Reading the output from a object running in the local machine.
    By using a signed applet i am lunching a small application that returns an image object, how to read that without storing it in the hard disk.
    Which means i need to read the image object return by the local application using applet or jsp .
    i am using tomacat and an html page with an applet with it to lunch the application.

    You can write that image in a binary format using OutputStream for System.out and then read it in your applet.

  • No longer mount NFS volumes with 2010.q1 release:

    Has anyone else seen this? I can no longer mount any of my NFS volumes with root squash since upgrading to 2010.q1. I have a ticket open with Sun (72644622), but everyone is apparently off/away.
    Before they all went off, Sun Eng. suggested setting max supported NFS version to 3, but this of course did not work. Hosts trying to mount the volumes error out with:
    call_verify: server HOST_IP_HERE requires stronger authentication.
    I have double checked that the atuh is set to sys (not krb), but it looks like the nfsd is not respecting this.
    Of course this has knocked all our VMware mounts offline as well, and using krb for these is out of the question....
    Had to update to support the new FC card...which works great...but me needs me nfs shares....
    Fishworks doods, stop yelling at drives and help a brother out ;)

    I wish I could tell you, but it seems we lost a CIM card. Worse yet, this failure was completely SILENT. Not a single "problem" listed in the logs. However, when attaching another J4400, I noticed an alarm LED on the failed CIM and verified that the storage was only seen by 1 path. Kind of disconcerting that availability could be reduced significantly without so much as an email.
    I'll let you know if we can get to the new release later this week.
    Charles

  • Invalid filename from Format Payment Instruction with Text Output conc prog

    hi there
    we are using EBS 12.1.3 and when producing an EFT file using the Format Payment Instruction with Test Output concurrent program, we are getting a file with an extra ".out" extension
    for exampe DE_CE_o81527.out.out.
    Seems like the IBY Payments Engine is using the concurrent program output file name and appending it to the prefix we have given.
    Anybody know of bug or patch for this. I have looked and looked in Meta-link without success. Its geting urgent now. Any help will be appreciated.
    here is an extract of logfile:
    length of the output - baos::488
    After formatting, periodicSeq is null or empty.{}Timestamp: Tue Mar 12 14:21:15 EST 2013
    length of the output - baos::488
    Exit: iby.scheduler.FDFormatProgramUtils.doExtractAndFormatCommon()Timestamp: Tue Mar 12 14:21:15 EST 2013
    Saving format output.
    Enter: iby.scheduler.FDExtractAndFormatting.queryFileSysAttributes
    Querying file system output attributes
    ppDir: null
    ppExt: null
    ppPre: null
    File system output settings that override the concurrent program default: {}
    Exit: iby.scheduler.FDExtractAndFormatting.queryFileSysAttributes
    Enter: iby.scheduler.FDFormatProgramUtils.saveToFileSystem()
    Concurrent request output file name: /u02/oracfg/EZCFGEBS/inst/apps/EZCFGEBS_ezi-cfg-ebs-001/logs/appl/conc/out/o881527.out
    Opened file in append mode: /u02/oracfg/EZCFGEBS/inst/apps/EZCFGEBS_ezi-cfg-ebs-001/logs/appl/conc/out/o881527.out
    Exit: iby.scheduler.FDFormatProgramUtils.saveToFileSystem()
    While savingoutput - m_instructionID : 11362
    Enter: iby.scheduler.FDExtractAndFormatting.saveFormatOutput()
    Mar 12, 2013 2:21:15 PM oracle.adf.share.config.ADFConfigFactory findOrCreateADFConfig
    INFO: oracle.adf.share.config.ADFConfigFactory No META-INF/adf-config.xml found
    ENTER
    Getting attached document ID
    Parameters passed ...
    pkValues[0] : 11362
    Returned values ...
    attachedDocId : -99
    Format output not exist. Saving it.
    Before savingoutput - m_instructionID : 11362
    ENTER
    Saving document as attachment
    Parameters passed ...
    pkValues[0] : 11362
    fileName : o881527.out
    Returned values ...
    attachedDocId : 60328
    EXIT
    After savingoutput - m_instructionID : 11362
    Saved attachment doc id: 60328
    Exit: iby.scheduler.FDExtractAndFormatting.saveFormatOutput()
    After buildingoutput - m_instructionID : 11362
    End Timestamp::Tue Mar 12 14:21:16 EST 2013
    Exit: iby.scheduler.FDExtractAndFormatting.doExtractAndFormat()
    Instruction status was CREATED, the instruction is set to transmit immediately and the transmission configuration is available. Starting transmission.
    Enter: iby.scheduler.FDExtractAndFormatting.doTransmission()
    Enter: iby.scheduler.FDFormatProgramUtils.getCPFilename()
    got CP outfile_name: /u02/oracfg/EZCFGEBS/inst/apps/EZCFGEBS_ezi-cfg-ebs-001/logs/appl/conc/out/o881527.out
    Exit: iby.scheduler.FDFormatProgramUtils.getCPFilename()
    Enter: iby.scheduler.FDFormatProgramUtils.doTransmission()
    Created ByteArrayInputStream containing the format output.iby.scheduler.FDFormatProgramUtils.doTransmission()
    Start transmission.iby.scheduler.FDFormatProgramUtils.doTransmission()
    Exit: iby.scheduler.FDFormatProgramUtils.doTransmission()
    Transmission successful. So setting result status to TRANSMITTED
    Enter: iby.scheduler.FDExtractAndFormatting.postResults()
    Executing BEGIN IBY_FD_POST_PICP_PROGS_PVT.post_results(:1, :2, :3, :4); END;
    Successfully executed PL/SQL.
    Exit: iby.scheduler.FDExtractAndFormatting.postResults()
    Exit: iby.scheduler.FDExtractAndFormatting.doTransmission()
    Exit: iby.scheduler.FDExtractAndFormatting.runMainLogic()
    End of Main logic: Tue Mar 12 14:21:16 EST 2013

    I had logged an SR on this, Oracle was able to reproduce and created bug 17483136 . It's still being worked on my development.

  • How to overwrite expired volumes with lower sequence number?

    I test expiration policy.
    I have a tape library with two volumes.
    I defined expiration policy after some time when write windows closed.
    lsv -L test_lib
    in 1: volume mf_test-000001, barcode e61bcfea534e10281bb000b5df3a54e, 4148676704 kb remaining, expired
    in 2: volume mf_test-000002, barcode e6251c26534e10281bb000b5df3a54e, 4148657504 kb remaining, expires 2011/04/28.11:49
    How to make OSB overwrite 1st expired volume when writewindow closed on the 2nd volume (with lower sequence number)?
    Is it possibly without rotation policy?
    If not how to set the policy in my case?
    Thanks!

    Thanks, Rich!
    But I have now following situation:
    ob> lsv -a
    VOID OOID Seq Volume ID Barcode Family Created Attributes
    104 104 1 mf_test-000001 b927cfe85411102ab8e000b5df3a54e mf_test 04/29.10:53 expired
    107 107 1 mf_test-000004 b93699ec5411102ab8e000b5df3a54e mf_test 04/29.13:32 closed; expires 04/29.14:32
    ob> lsj -l
    oracle/11:
    Type: database emgc (dbid=1838014073)
    Scheduled time: none
    State: processed; Oracle job(s) scheduled
    Priority: 100
    Run on host: (administrative server)
    Attempts: 0
    oracle/11.1:
    Type: datafile backup
    Backup piece: 2jmb0c82_1_1
    Family: mf_test
    Encryption: awaiting job completion
    Scheduled time: none
    State: pending resource availability
    Priority: 100
    Run on host: dbsora98
    Deferred because: a required device is not available
    Attempts: 2
    ob> catxcr --tail 100 oracle/11.1
    2011/04/29.14:19:49 ______________________________________________________________________
    2011/04/29.14:19:49
    2011/04/29.14:19:49 Transcript for job oracle/11.1 running on dbsora98
    2011/04/29.14:19:49
    2011/04/29.14:19:49 ---
    2011/04/29.14:19:49 No volume could be found in vl_test (for drive vd_test_2) to use for job oracle/11.1.
    2011/04/29.14:19:49 A volume usable for media family mf_test is needed to perform a backup.
    2011/04/29.14:21:24 ______________________________________________________________________
    2011/04/29.14:21:24
    2011/04/29.14:21:24 Transcript for job oracle/11.1 running on dbsora98
    2011/04/29.14:21:24
    2011/04/29.14:21:24 ---
    2011/04/29.14:21:24 No volume could be found in vl_test (for drive vd_test_1) to use for job oracle/11.1.
    2011/04/29.14:21:24 A volume usable for media family mf_test is needed to perform a backup.
    Edited by: OraSun on 29.04.2011 1:38
    I'm sorry, that's ok. other job is holding the 1st volume.

  • Raising The Subwoofer Volume with 2.1 Speakers? (A Good EQ Should Do

    Greetings, and happy New Year.
    I've been trying to raise the volume of my subwoofer in my 2. speaker set up (2 satelites and a subwoffer). I'm using an Audigy 2 Value card. Now, when I open the Surround Mixer and go to Speaker Settings > Base Management, the subwoofer volume sliders are greyed out; the card doesn't seem to recognize the woofer. However, the woofer works fine with the computer- I can hear (er... feel) it just fine- but I can't seem to adjust the volume on it. How can I set up my sound card so it recognizes my woofer and so I can adjust its volume?
    I tried raising the "Bass" slider in the surround mixer, but that also raises the Bass of the satelites, which I DON'T want- I only want the volume of the Bass in the woofer raised.
    Many Thanks.
    P.S. My subwoofer has a volume control on it, but its maxed out- if I could find an EQ that adjusted the 20-20 HZ range, I'd be in good shape, but I can't seem to. If anyone know of one, let me know. The EQ from the card only goes down to 20HZ, and I need to adjust lower frequencies.Message Edited by VermilionMartyr on 0-0-2006 08:6 PMMessage Edited by VermilionMartyr on 0-0-2006 08:27 PM

    Just set the audio to output stereo to full range speakers: go to configuration screen, select "show small/big icons", tap on the "audio" or "sound" icon. In the new screen that pops up, select "speakers" (that conexant device) and click "configure". Click next and you'll see an option to select "full range speakers", and select the front ones. Click next again and save the settings.
    In that same audio tab, select preferences of the conexant device. In the new tab that opens, go to the 3D headphone setting and turn it off.
    If you wish, you can also turn off the Dolby settings, they don't improve anything.

  • Can't control external monitor volume with macbook keyboard

    I just picked up a new LG display that I am connected to my haswell rMBP through Thunderbolt. Everything is working great but I can't control the volume of the monitor with the macbook keys, it is all grayed out.
    I have set up an multi-output device in audio midi setup and so I am getting volume from the monitor and the macbook at the same time for great sound, but I would love to be able to control it from the volume keys on my rMBP.
    I have googled and tried soundflower but there doesn't seem to be a current app for Mavericks.
    I can command click on the volume icon and divert back to rMBP to bump volume down, but that is more steps than I need.
    Any help would be appreciated.

    I have the same problem.

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

  • Using usb mic with logic output stops

    using usb mic with logic output stops

    Aggregate devices are setup in the Audio/Midi setup of OSX Utilities, (Not in Logic). It gives you a way of having for than one audio i/o device. Once you have set up your aggregated devices in Audio/Midi, when you start Logic you will need to go into Audio preferences and choose the Aggregate device.

Maybe you are looking for