Skip to content

ORelio/Sound-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SoundManager

SoundManager is free software that makes it easy to create and share Windows sound schemes. All Windows versions from Windows XP SP3 to Windows 11 are supported. Requires .NET 4.0 or greater.

Overview

The main UI allows managing the current sound scheme, as well as defining metadata:

SoundManager main UI

Main features are the following:

  • Load and test sound files for each event
  • Define metadata such as thumbnail, author, description
  • Export and import sound schemes using archive files
  • Import sound schemes created with the Sound applet
  • Auto-convert sounds to WAV format (Windows 7+)
  • Patch startup sound (Admin required, Windows Vista+)
  • Play missing sounds on Windows 8 and greater
  • Load proprietary soundpack archive files

User Manual

See User Manual for more details on how to use the program.

How it works

The SoundManager sound scheme

SoundManager integrates into the system using the built-in sound scheme feature in Registry:

HKEY_CURRENT_USER\AppEvents\Schemes

The SoundManager scheme is automatically created on first launch, pointing to:

C:\Users\<USER>\AppData\Roaming\SoundManager\Media\

Sound files such as Startup.wav, Shutdown.wav and so on are placed here. Since they are automatically played by the system, the SoundManager app is not required to run once the sound scheme has been set, except if you want to restore the startup/shutdown sounds on Windows 8+ (see below).

SoundManager handles registry differences between Windows versions, such as the balloon sound which does not play by default on Windows 7/8 and changes again on Windows 10.

Sound Archives

Sound archive files are simply Zip files having the .ths file extension:

SoundScheme.ths
 |- Scheme.ini
 |- Scheme.png
 |- Startup.wav
 |- Shutdown.wav
 \- <OtherSounds>.wav

SoundManager can associate itself with this file type to conveniently load sound schemes, and you can manually edit them using any file archive utility such as 7-Zip or by renaming them to .zip while displaying file extensions, then using the built-in Windows utility.

Windows Vista+ startup sound

On Windows Vista and greater, the startup sound is no longer customizable by the user, the corresponding WAV file being embedded in C:\Windows\System32\imageres.dll for performance reasons.

SoundManager can optionally patch imageres.dll to update the startup sound:

  • Ownership of imageres.dll is transferred from TrustedInstaller to Administrators
  • If not already done, imageres.dll is backed up to imageres.dll.bak
  • Existing imageres.dll is moved to imageres.dll.old since it is in use by the system
  • imageres.dll.bak is copied to imageres.dll and its WAV resourse is updated

This feature requires administrator privileges. If enabled, SoundManager will show an UAC prompt on launch. Due to imageres.dll files being used by the system, SoundManager might not be able to patch the startup sound more than once between each system reboot. Also, major system updates might revert the startup sound to its original state and/or break the patch mechanism.

Initially implemented using Resource Hacker, SoundManager now patches the DLL directly using the Windows API (BeginUpdateResource, UpdateResource, EndUpdateResource) to replace the startup sound. This allows seamless patching on newer system versions that implement a distinct resource file for the DLL imageres.dll.mun.

Windows 8+ shutdown, login, logoff sounds

On Windows 8, the shutdown sound was removed for further performance reasons, as well as the logon and logoff sounds. SoundManager can emulate the playback of these sounds by launching a background process on logon:

  • Process spawns an invisible window, mandatory for delaying system shutdown
  • Process plays Startup or Logon sound and goes inactive
  • On logoff, process wakes up and sets up a ShutdownBlockReason
  • Process determines if the Logoff or Shutdown sound should be played
  • Sound is played, then ShutdownBlockReason is removed and the process exits

This is typically how explorer.exe was handling the thing on Windows 7, but you'll get yet another process sleeping in background, separate from explorer.exe. As such, this feature can be disabled entierely in the SoundManager settings.

SoundManager also allows patching the startup sound on Windows 8 and greater. When used in combination with the background sound player process, the system itself will play the native startup sound, and the background process from SoundManager will play the other sounds. This helps reducing latency in startup sound playback since the system will play the startup sound with high priority.

Build instructions

In order to maintain support for Windows XP SP3, SoundManager targets .NET Framework v4.0 and builds under Visual Studio 2010. If you want to build without support for Windows XP, you should be able to build using the latest version of Visual Studio Community. The following instructions detail how to build with XP support.

For proper support of newer operating systems such as Windows 10, SoundManager needs APIs such as Task Scheduler 2.0 and ShutdownBlockReason, which aren't present on XP, so building under Windows XP will not work. Building was tested successfully under Windows Vista, 7, 8, 10 and 11 using Visual Studio 2010.

Setting up Visual Studio

  1. Download Visual Studio 2010 Express. This is the free version of Visual Studio 2010 that includes the bare minimum components needed to get started using Visual Studio.
  2. Mount or extract the downloaded ISO file: VS2010Express1.iso
  • On Windows 8 or greater, opening the ISO file in file Explorer will automatically mount it as a virtual DVD drive.
  • On earlier Windows versions, software such as WinCDEmu or Daemon Tools can mount the ISO file.
  • Alternatively, you can use a file archive utility such as 7-Zip to extract the ISO file instead of mounting it.
  1. Open the VCSExpress folder inside the virtual DVD drive or extracted ISO file and launch setup.exe
  2. Follow the on-screen instructions to install Visual C# 2010.

Compiling

This section assumes you already have the Sound-Manager git repository cloned or manually downloaded. In the following instructions, "project folder" refers to the main folder of the Sound-Manager repository, where README.md and SoundManager.sln are housed.

  1. Navigate to the project folder and open SoundManager.sln file
  • If your system isn't configured to show file extensions, you won't see the .sln part of the filename.
  • If VS 2010 doesn't open automatically, select Visual C# 2010 in the "open with" dialog.
  1. Once the project is open, set the build target to Release instead of Debug in the dropdown menu next to the Build button. You can leave Debug while making changes in the code and using the debugger in Visual Studio.
  2. Hit Shift+Control+B to build the entire SoundManager solution. This should only take a few seconds to compile.
  3. Assuming there were no errors during compilation, hit Alt + F4 to close VS 2010.
  4. If everything worked properly, you should see:
  • SoundManager.exe in <ProjectFolder>\SoundManager\bin\Release
  • DownloadSchemes.exe in <ProjectFolder>\DownloadSchemes\bin\Release.
  1. Copy the following items into <ProjectFolder>\SoundManager\bin\Release.
  • <ProjectFolder>\SoundManager\Lang
  • <ProjectFolder>\UserManual\Readme-En.txt
  • <ProjectFolder>\UserManual\Readme-Fr.txt
  • <ProjectFolder>\DownloadSchemes\bin\Release\DownloadSchemes.exe
  1. Finally, check that everything's working by launching <ProjectFolder> \SoundManager\bin\Release\SoundManager.exe.

License

SoundManager is provided under CDDL-1.0 (Why?).

Basically, you can use it or its source for any project, free or commercial, but if you improve it or fix issues, the license requires you to contribute back by submitting a pull request with your improved version of the code. Also, credit must be given to the original project, and license notices may not be removed from the code.