Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Directshow, how to set volume?

This topic is 5266 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, all my attempts at setting volume in my directshow music player have failed. Could anyone please post me some code or suggestions, thanks!

Share this post

Link to post
Share on other sites
Query for a IBasicAudio interface from the graph builder.

m_pGraphBuilder->QueryInterface( IID_IBasicAudio, reinterpret_cast( &m_pBasicAudio ) )

With this interface you can simply change the volume by doing:

m_pBasicAudio->put_Volume( iVolumeRange[dwVolume] );

Careful, put_Volume uses dB in the range of 0 to -10000. You can also set the panning with put_Balance.
Don''t forget to release the interface again.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!