Where are the sounds in windows 7? How to customize system sounds in Windows? Reading system event data from the registry

In this article we will learn how to change system Windows sounds. Just in case, it is recommended to do backup copy registry before you run our program, which makes changes to the registry.

You may know that in Windows you can set your own accompaniment sounds for various events, such as Logging into Windows, Connection Establishment, Mail Receipt Notification, and so on. We can set our own sounds on the victim's computer to play a prank on a colleague. There are many resources where you can find a good collection of sounds, such as http://www.reelwavs.com/.

Setting up system sounds

If you have access to the victim's computer, you can change the system sounds in the Control Panel by opening the Sound category (Control Panel | Hardware and Sound | Sound | Change system sounds). You can go through all the events and assign your sounds by specifying the file paths.

Software configuration of system sounds

We can programmatically change system sounds using our utility. In addition, the utility will save and restore sound settings and play sounds.

But first, we need to find out where information about system sound files is stored. Like many other things, such information is stored in the registry. You can find this information in a specific location:

Each folder in the Schemes/Apps/.Default section corresponds to a specific event. For example, if you unplugged a USB device, you should hear a system sound associated with the event DeviceDisconnect. A given event like DeviceDisconnect has several folders: .current, .Default, and a folder for additional sound schemes.

The system event has the following structure:

  • .current- contains an empty key with a value containing the path to the sound file that is used in this configuration. For DeviceDisconnect in Windows XP, the current file is "C:\WINDOWS\media\Windows XP Hardware Remove.wav".
  • .Default- Contains an empty value containing the default sound file. If you did not change the sound file, then this value is the same as the .current key.
  • Other Folders - You may have other folders that store sound schemes (custom settings).

Reading and writing audio files for events

Knowing where the necessary settings are stored, you can create a DataSet that will contain system events and the path to the files for these events. Let's start a new Windows Forms project and select "Add New Item..." from the Solution Explorer window, then select the DataSet template. Let's add a DataColumn element SoundName and SoundFile as below:

Reading system event data from the registry

Let's declare two variables in the RegistryWrapper class to store paths.

//these represent the location in the registry with the user sounds string hivePrefix = @"AppEvents\Schemes\Apps\.Default\"; string hiveSuffix = @"\.current";

Next, add a method GetSystemSound() which returns RegSoundDataTable, containing the SoundName and SoundFile values. The first thing we do is get a list of all subkeys for the path we specify when we call the GetSubKeyNames method. The method will return us a list of all system sounds for events. Then, we go through each event, creating a new row for the DataTable until the settings for SoundName for the current event and SoundFile in the registry key contain the path to the file. Note that when we call the GetValue method to get the audio file, we must pass the empty string "" in the key name. We will also add a helper function to connect the two variables declared earlier.

Public RegSound.RegSoundDataTable GetSystemSound() ( //Get the subkey key string values ​​= Registry.CurrentUser.OpenSubKey(hivePrefix).GetSubKeyNames(); RegSound.RegSoundDataTable tb = new RegSound.RegSoundDataTable(); foreach (string s in values) ( //Loop through rows RegSound.RegSoundRow newRow = tb.NewRegSoundRow(); newRow.SoundName = s; newRow.SoundFile = (string)Registry.CurrentUser.OpenSubKey(getRegKeyPath(s)).GetValue("") ; .Add(newRow); ) return tb; ) //adds the full registry key including prefix and suffix private string getRegKeyPath(string s) ( return hivePrefix + s + hiveSuffix; )

Registry entry

To set all the sound events, we'll create another method that takes the RegSound DataTable and the sound files we're changing. We go through each row in the DataTable in a loop and set the value of the key in the registry for the sound using the SetValue method. When calling the SetValue method, we need to know the name of the key (in our case it is empty string""), the key value (path to the sound file), and RegistryKind, which describes the type of the value (we use the string type).

Public void SetSystemSound(RegSound.RegSoundDataTable sounds, string soundPath) ( //loop through all sounds foreach (RegSound.RegSoundRow row in sounds) ( //Set key and value RegistryKey key = Registry.CurrentUser.OpenSubKey(getRegKeyPath(row.SoundName) , true); key.SetValue("", soundPath, RegistryValueKind.String ) )

Backup your current audio settings

When changing the victim's sound patterns, we must provide for the possibility of restoring previous settings. To do this, we will add the SaveSystemSound method, which uses the DataTable to save the file path. We can use the WriteXml method on the DataTable object to save the DataTable as an XML file.

Public void SaveSystemSound(RegSound.RegSoundDataTable sounds, string savePath) ( //Save Sound DataSet sounds.WriteXml(savePath); )

Restoring saved settings

Now let's add a method to restore the settings from the previous step. We need to know where the DataTable was saved and call the ReadXml method to read the data. We now have the ability to loop through each sound event and call the setValue method to set a new value.

Public void RestoreSystemSound(string savePath) ( //Restore Sound DataSet RegSound.RegSoundDataTable sounds = new RegSound.RegSoundDataTable(); sounds.ReadXml(savePath); foreach (RegSound.RegSoundRow row in sounds) ( //Set Key RegistryKey key = Registry .CurrentUser.OpenSubKey(getRegKeyPath(row.SoundName), true); key.SetValue("", row.SoundFile, RegistryValueKind.String) )

Play a sound event

Finally, we will add the ability to play sounds. Sound files are located in the system media folder Windows folders, we need to quickly check if the file path has a backslash ("\") to see if the file contains the path and the file name itself. If not, then we append the path to the filename and play it.

Public void PlayRegistrySound(string soundFile) ( //play sound if there is an associated file if (soundFile != "") ( SoundPlayer sp = new SoundPlayer(); //add default path if there isn"t one int a = soundFile .IndexOf("\\"); if (a != 0) ( soundFile = "%SystemRoot%\\media\\" + soundFile; ) sp.SoundLocation = sp.Play();

Creating a User Interface

We'll start creating the user interface by adding controls to the form:

  • ToolStrip element for the Backup, Restore, Select, and Apply changes buttons.
  • DataGridView, which we can drag and drop by clicking "Data > Show Data Sources," and dragging the RegSound DataGridView element.
  • Two OpenFileDialog elements, one for selecting where to restore settings from, and the second for selecting sound files to replace.
  • SaveFileDialog element for choosing where to save a backup copy of the current system sounds.

Loading Data

So, we are almost all ready for the application. Let's add two more variables. One to represent the RegistryWrapper we described earlier and another to store the RegSoundDataTable data. To fill the DataTable, we will call the GetRegistrySounds method, which in turn will call the GetSystemSound method we created earlier. We call the GetRegistrySounds method when the form is loaded and when we restore sounds or when we apply changes by populating the DataGridView with the current sound settings.

Private void frmMainMenu_Load(object sender, EventArgs e) ( GetRegistrySounds(); ) private void GetRegistrySounds() ( //Call the RegistryWrapper Class sounds = myReg.GetSystemSound(); regSoundDataGridView.DataSource = sounds; )

Setting up DataGridView

Let's deal with the presentation of data in the DataGridView element, changing some properties, for example, setting the property AlternatingRowsDefaultCellStyle in different colors, changing the DefaultCellStyle font to Arial 10, and turning off the ability to add, edit and delete data. We'll also add a "play" image to listen to the current associated sound. To do this, right-click on the DataGridView and select "Edit Columns" to bring up the Edit Column dialog box. Here we will add a new column "Play," set the type to DataGridViewImageColumn, assign the property Image our music image and set the property ImageLayout in "Zoom" so that the images fill the entire cell of the column.

Let's add code to play a sound when we click on the picture. To do this, you need to use the DataGridView CellContentClick event. The sound will play if we click on the third column (the index is based on 0, so for the third column we use #2). To play we need to know the path to the file which we will get by creating DataGridViewTextBoxCell for the SoundFile column and reading its value.

Private void regSoundDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) ( //Represents col #3 the "Play" column if (e.ColumnIndex == 2) ( DataGridViewTextBoxCell cell = (DataGridViewTextBoxCell) regSoundDataGridView.Rows.Cells; //Play Sound myReg. PlayRegistrySound(cell.Value.ToString());

Conclusion

Translation: Vasily Kotov

System sounds are the musical accompaniment that is played during certain actions in the OS. For example, an alert appears, an error appears on the screen, windows rotate, and so on. The user can configure all these short melodies manually.

How to open settings in Windows?

Regardless of issue and edition operating system, the developers left one general method that allows you to customize sounds. To do this, use the following guide:

  1. Find the sound icon on the taskbar.
  2. Right-click on it to open an additional menu.
  3. Now open the "Sounds" section.
  4. The required tab will immediately appear in front of you. Let's take a closer look at its contents.

Sound scheme

Looking ahead, let's focus on sound patterns. The user can combine different sounds and settings, and then save the finished profile. To do this, you need to set the parameters and click on the “Save As” button. Now you need to enter the name of the scheme and click "OK".

You can switch between system sound schemes using a special drop-down list. If you name the blanks as simply and clearly as possible, then you can change the sound design for various tasks in a couple of mouse clicks. For example, turn off all extraneous sounds, except for important notifications, while working, and so on.

Program events

System sounds are only related to what Windows itself is responsible for. From this list, you can select a separate signal for each action from three categories: General Windows, Explorer, and Windows Speech Recognition.

The first category includes events related to system notifications(exclamation, closing the program, account control, critical error, etc.). Those positions that have a musical alert are marked with a megaphone icon on the left.

The "Explorer" category refers to Windows system sounds that are played when performing any actions in folders (moving between categories, emptying the Recycle Bin, moving items, and so on). The third section includes voice notifications on English.

Changing sounds

First, you need to highlight one of the Windows actions accompanied by a notification. After this, the menu for selecting a standard melody will become active at the bottom. Before use, you can listen to the sound by clicking on the "Check" button.

If you didn’t find anything among the standard notifications, then using the “Browse” button you can go to Explorer and select your melody. Please note that only WAV files are supported.

Sometimes, over the years, most users have standard Windows system sounds they become simply boring and probably everyone at least once wanted to change them to their own. As a rule, if this is a pure build of Windows, its system sounds are the same and it does not contain extraneous integrated sound circuits, and sometimes we would really like to change the sound of Windows greeting or shutting down. And so in order to change the standard sound when turning windows on or off to open folders. It will be enough for us ourselves Windows tools, thanks to which we will learn how to change these sound effects without fiddling with the registry and installing third-party programs.

Now I’ll tell you a little about how and what file format we need in order to install it as sounds both when Windows starts and when replacing any other system sounds, including the sounds of opening folders, the effects of emptying the recycle bin or sound effects system error and many others. To do this, we will need any selections of sounds, clippings from our favorite songs or games.

Attention: all sounds that you decide to install as system sounds must have an audio format with WAV resolution; you can make them yourself with any free audio file converter or download collections of such system sounds for free on the Internet. Sometimes, as a rule, they only change the sound to turn windows on or off.

Required to change Windows system sounds.

This method is suitable for almost everyone Windows versions in my case, this is Windows 7. The only difference is the selection of tabs in (Control Panel) for Windows XP - this is (Sounds and audio devices), we will look at the (Sounds) section for Windows 7 in more detail. Most quick way on any personal computer To get to the sounds tab, click on the volume icon next to the hour and select sounds.

Now let's get started, prepare your favorite sounds that we will change in the system. If you are interested, the standard Windows sounds are located along this path in the folder (C:\Windows\Media), you can use them, but since we decided to install our own, we download them from the Internet or cut and convert WAV sounds ourselves. Let's assume you've already prepared the sounds, then it's time to start installing them. To do this, as shown in the picture below, follow the following path (Start), go to (Control Panel) and here select the icon (Sound).

A window will open in which we select the tab (Sounds) and, as shown in the picture below, the upper part of the window in this section allows us to immediately change the entire sound scheme. To do this, under the inscription (Sound schemes), click and in the drop-down window, select any scheme you like, then click (Save as) and at the bottom of the window click OK, thus completely changing all Windows sounds. Well, since we are about to install our system sounds, let's move on.


In the same window, below the sound schemes section, we have access to the names of all the sounds that can be changed. In my case I change the sound to ( Windows Login), in simple terms sound Windows greetings. Select this section below, click (Browse) and in the window that opens, select the sound that was already prepared in advance, and then click OK. If you want, check it here by clicking on the button (Play) if everything is fine, don’t forget to check the box as shown in the picture in the circle (Play melody Windows startup) Finally, click the button (OK) and restart the computer.


My congratulations, what you just did is simple and very the easy way installed your favorite Windows 7 system startup sound. This way you can very quickly replace any sounds. If something is unclear, write a comment or PM me, I’ll be happy to help you. With respect to you!

It probably doesn't need to be said that many Windows users don't like standard melody, played when the system starts. They try to change it, but standard method Changing the sound scheme to do this sometimes proves impossible. Let's look at how to change the Windows 7 greeting sound. As it turns out, this is a fairly simple process, although you will have to dig a little into the system.

How to change the greeting sound in Windows 7: what do you need to know?

Before you start changing the music played at system startup, you should pay attention to the most basic condition.

It is not clear why, but the developers of Windows systems did not make sure that the sound circuits supported the use of different formats. Unfortunately, when installing custom settings, you will have to be content with only the standard WAV audio file type (even MP3 is not accepted, not to mention formats like OGG or FLAC).

Therefore, when solving the problem of how to change the Windows 7 welcome sound, make sure that the file you intend to use is in the appropriate format. You can change it in any audio processing program or using an appropriate converter.

How to Change Windows 7 Welcome Sound: Basic Methodology

The simplest method of changing the sound is to use the list of events, which is presented on the corresponding tab.

Here you need to find an event called “Login to Windows”, and then use the button at the bottom to browse and assign your file. But sometimes such an item may not be on the list.

Then first in the standard “Explorer” we find the file imageres.dll, which is located in the System32 directory of the system root directory (Windows). Next, you should make sure that you are the owner of the file (in the properties menu, this parameter can be changed on the corresponding tab). This object needs to be copied to any location convenient for you, then opened for editing in some resource editor (Restorator, PE Explorer) and replaced with your own WAV component. Next, we simply save the changed file, and then copy it to its original location with replacement (all operations must be performed exclusively with Administrator rights).

If this option seems too complicated to someone, you can install some specialized utility like Startup Sound Changer. When you select your own melody, the program will change the Windows 7 greeting sound automatically and without any editing of the dynamic library. True, the inconvenience is that the application will constantly load when the system starts and work in background. But resource consumption is low.

Instead of a total

As you can see, when deciding how to change the Windows 7 greeting sound, it is better to give preference to installing an additional software product. This option is also useful if the sound scheme does not include playback of a melody when logging into the system. If there is a corresponding item in the list, then there is no need to install additional utilities (you just need to select the desired file).

Often the operating system sound scheme does not suit the user with its default set. And every PC owner would like to add individuality to the operation of the system. And everything is much simpler than you might think...

As I said earlier, there should be no difficulties in installing your own sounds, and you will need to complete two steps:

1. Preparing audio files

To install custom sounds, prepare them because only WAV audio files are required for application.

You can do this in several ways: download ready-made sound schemes, convert an existing sound file other than wav and create a voice file yourself (for example, with a voice recorder or the previously discussed method.

2. Changing the system shutdown sound

Once the sounds are ready for installation, you can proceed directly to changing the system sounds.

Let's look at making changes to the sound circuit using Windows 7 as an example, and change the shutdown sound:

  1. Go to the following path: Start - Control Panel
  2. Then change the display type. To do this, click on the “Categories” item in the upper right corner and change to “Small icons”
  3. From the Control Panel list, select Sound
  4. In the window that appears, go to the “Sounds” tab and find the list of sounds in the middle of the window
  5. Highlight the “Shutdown” sound, after which you can listen to it by clicking the “Check” button at the bottom of the list, or proceed to selecting your own sound file by clicking the “Browse” button

  6. After selecting, click the “Open” button to install the file
  7. Save changes to the sound scheme by clicking the "OK" button at the bottom of the window.

Instead of an afterword

That's all you need to do to change the system sounds. The rest of the sound notifications change in the same way as above.