29 Nov 2015 @ 7:32 AM 

On a recent Forum post, I was intrigued by the idea of being able to control the Windows Master Volume Programmatically. In that particular case, the intent was to allow scripting of the volume for user login and logoff.

The result was a rather straightforward program intended for use on the command line for setting and retrieving the current master system volume. I’ve made the source Available on Github and also put up an installer download here.

My initial investigations ended up with code that was able to retrieve the volume, but not set it. The approach taken in that case defined only a single interface method for the interface in question, with a strange “vtable skip” type of method. I’m not sure if that is a special syntax or what, but I ended up looking elsewhere after a few attempts to add the appropriate method to set the system volume.

In my searches, I found a library intended to wrap the Core Audio API to allow it to be accessed from a .NET program, which can be found on CodePlex as well as a (seemingly more recent, based on commit messages) Github.

Once I had that in place, it was merely a case of wiring it all together. Thankfully, since the program is relatively straightforward it is small enough (IMO) to slap it right here for convenience:

Basically it takes the default EndPoint and changes or sets it’s volume. Nothing too fancy. Ideally, I would clean it up code-wise and also implement additional features- such as manipulating the audio of other programs – which could make it useful for certain scripting uses.

Have something to say about this post? Comment!

Posted By: BC_Programming
Last Edit: 29 Nov 2015 @ 07:32 AM

EmailPermalink
Tags
Categories: .NET, C#, Programming


 

Responses to this post » (None)

 
Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Tags
Comment Meta:
RSS Feed for comments

 Last 50 Posts
 Back
Change Theme...
  • Users » 45017
  • Posts/Pages » 369
  • Comments » 105
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

PP



    No Child Pages.

Windows optimization tips



    No Child Pages.

Software Picks



    No Child Pages.