Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

c++ - How to programmatically set volume in Windows, Mac and Ubuntu?

I'd like to programmatically set volume in Windows, Mac and Ubuntu using C/C++. Command line also can but C/C++ preferred. Thank you in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just a hint, In windows the 'philosophy' around volume adjustment has changed between XP and Vista/7. Code that would change the master volume on XP will only change the application specific volume setting in the mixer on Vista and 7.

Here is a good blog post by one of the MS audio dev team regarding this: Larry Osterman's Blog

Here are some codeproject pages that might prove useful:

For XP

For Vista +

Also, there are a few powerpoint presentations regarding the new api's here: AMP Summit ppts. The Audio Endpoints in Windows Vista presentation has some good info.

As for OsX and Ubuntu, i have no idea.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...