Every one of us wants to customize their PC (Desktop or Laptop) according to themselves. In this process, a customized login sound is always impressive. In this article, we are going to show how you can change login sound in Windows 7. I have made the below assumption in changing the login sound for my laptop-
- No need to record your voice or to cut any MP-3 song. We will use text to speech (TTS) conversion method.
- We are changing the login sound and not the startup sound (login sound is the sound that plays after login and startup sound is the sound that plays when windows startup and login windows come.)
- We can change many other windows sound using this process.
- Basic knowledge of Windows OS.
- Ready to play with your Windows.
Below is the step by step guide to login sound of your Windows 7 PC.
Making a directory to store different sounds that we will create in this process.
Run the below command in PowerShell and it will create directory name “winsounds” in the present working directory.
New-Item -Path ./winsounds -ItemType directory
Run the below command in Power Shell to add system.Speech class in the current Power Shell session.
Add-Type -AssemblyName System.Speech
- The Add-Type cmdlet lets you define a Microsoft .NET core class in PowerShell session. Please refer the below Microsoft Document for more information and usage of Add-Type command.
- Refer below doc for details about System.Speech class
Next, run the below command to instantiate the object of this class.
You can test if we have done this correctly by running the below command.
$speak.Speak("Hello Sir, the current date andtime is $(Get-Date)")
Keep your PC’s speaker on and you will hear a sound telling the current Date and time.
Now after confirming that our text to speech conversion is working fine, we will redirect this output sound to get stored in a .wav file. I am going to store these files in the directory “winsounds” created in Step-1.
Next, run the command to record the desired text string in .wav file format.
$speak.Speak("Hello $env:USERNAME ,Welcome to The World of Windows")
Again change the output to the default audio device i.e the speaker of your PC.
Now we will change the login sound using Windows GUI. First, confirm that the .wav file is created. To do that go to the folder that you have provided in the first command of STEP-3.
Now go to the Control Panel and first select sounds and second Windows logon from the Program Events list as depicted in the below snap. Click on Browse to select the sound that we want to play at the time of Windows Logon. In this case, this is the custom_sound_01.wav file that we have created using TTS.
Browse and select the file, then test the sound y clicking on “Test” button. If it’s working fine click “OK” and restart your PC.
Try and execute the below commands in PowerShell related to this topic
- To check all the functions and actions that you can perform on $speak object.
$speak | Get-Member
- To increase the audio stream rate.
- To decrease the audio stream rate.
- To set the volume level to max