2

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

4

2 回答 2

3

一些应用程序在它们的 AppleScript 字典中有一个属性。

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
于 2012-12-13T08:23:24.993 回答
0

你为什么不改变系统音量呢?以下是 AppleScript:

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

如果你愿意,你可以使用 NSAppleScript 来执行这些单行代码,尽管也应该有一种直接的方法来做到这一点。

于 2012-12-19T00:36:59.467 回答