Preserve audio volume and mute in RES One Workspace

 

Note: This blogpost is also posted on the PepperCrew website.

 

RES One Workspace has a lot of great options to preserve your settings between sessions. But some settings are not as easy to capture because there’s no file or registry setting for them. One of these troublemakers is the volume of the audio. If you’ve adjusted the volume in a session to be less than 100% or even muted the audio completely you’ll find yourself having to do this each time you start a new session (unless you’re on a dedicated persistent client of course). 

So how can we remedy this situation? There are tools available like the Citrix Audio Volume Persistence Tool, although I’ve heard reports that this doesn’t work well with the Mute option. But the best tool is already installed in your image: PowerShell. I will share a building block with you that contains the following:

  • An Execute Command task that runs a PowerShell script to save the volume level and mute status in the registry. It runs at logoff before other actions so the registry values can be captured.
  • A global User Setting named Audio Volume that preserves the registry settings created by the previous script task.
  • An Execute Command task that runs a PowerShell script to restore the volume level and mute status from the registry. It runs at logon after other actions so the captured registry settings will have been restored.

The PowerShell scripts are not that straight forward as audio control is not a native functionality in PowerShell, so I had to use the Add-Type command to add some C# code in order to be able to create Audio objects. But it works like a charm. Since I’m not a C# guru (yet) I borrowed the code from a blogpost on DeployHapiness.com.

And now, without further ado, the link to the building block: Github. If you prefer to use a RES Hub package, here’s the link to that: RESHub. Import it, test it and drop me a line in the comments.

Advertisements

About MicaH

I'm a Technical Specialist at PepperByte BV (the Netherlands).
This entry was posted in RES Workspace Manager and tagged , , , , , . Bookmark the permalink.

2 Responses to Preserve audio volume and mute in RES One Workspace

  1. Hans Straat says:

    Werkt zeer goed, dank voor het uitzoeken. Maak er dankbaar gebruik van

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s