Ahmed Ibrahim
Ahmed Ibrahim

Reputation: 23

Application sound volume mac os

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

Upvotes: 2

Views: 1051

Answers (2)

Mark
Mark

Reputation: 2435

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.

Upvotes: 0

Lri
Lri

Reputation: 27633

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

Upvotes: 3

Related Questions