Take the 2-minute tour ×

I want to know if there is any way to get the sound volume of a specific application and change it, or to get all the applications that have a sound output in mac.

I want to know if i can do that using objective-c, C, or C++.

I have tried applescripts but i found it hard to depend on applescripts, because not all applications give that access through applescript, and even if so, i will not be able to treat all applications in the same way, because that will depend on how the applescript was written.

I do not want an exact answer, i just want a clue or a way i can search in

Thanks in advance

share|improve this question
If an application uses NSBeep, that's a sound output. Can you be more specific? –  trudyscousin Dec 11 '12 at 23:00
Yes, i mean every application that has a sound output, so that i can access each of them to control its sound volume –  Ahmed Ibrahim Dec 11 '12 at 23:05
You could ask the guys from www.prosofteng.com because their application 'hear' does already what you ask. With AppleScript this can't be done and you need C (and/or it's supersets) to achieve this. –  dj bazzie wazzie Dec 12 '12 at 13:23
add comment

2 Answers

Some applications have a property for it in their AppleScript dictionaries.

tell application "iTunes"
    sound volume -- 0 to 100
end tell

tell application "QuickTime Player"
    audio volume of document 1 -- 0.0 to 1.0
end tell
share|improve this answer
First i would like to thank u for your answer, But there is a problem with applescripts is that they are not applicable for all applications, another problem is that the way to change the volume thorough applescript (if an application support that) will be different from one app to another depending on how that applescript was written. –  Ahmed Ibrahim Dec 13 '12 at 20:47
add comment

Why wouldn't you change the system sound volume instead? The following is AppleScript:

set volume output volume 40
return output volume of (get volume settings)

If you want, you could use NSAppleScript to execute these one-liners, although there should also be a direct way to do it.

share|improve this answer
I Want to change volume for specific app, not system volume –  Ahmed Ibrahim Dec 19 '12 at 19:05
In that case, I suggest you mark Lauri's answer as accepted, because I don't think there is a solution besides AppleScript and with each new version of OSX Apple is making it more difficult to let apps interact with each other. –  Mark Dec 20 '12 at 19:27
add comment

Your Answer


