How Can I Play a Sound in WinPE During Imaging?

April 24, 2025 6 answers
Asked by CuriousCat42
I'm wondering if there's a way to play a sound or tone while I'm using WinPE for imaging. I'm running a script that I want to alert me with an audible tone when it reaches a specific step. I suspect there might be something I need to load in WinPE to make this work, but I'm not quite sure what it is. Any advice would be appreciated!

Answers

TechWizard99
You can give this a shot in WinPE: ```powershell [audio]::Mute = $false [audio]::Volume = 1 [console]::beep(500,300) [console]::beep(500,300) ``` Just test it out since the support might vary!

RandomReplyGuy: Haha, sounds like you might have some grounding issues there! Maybe check your headphones? Also, this only happens at work? That's odd, best to contact IT if it continues!

SoundsAlternative: I ran that code, but I got "unable to find type [audio]." Guess it must be a limitation of WinPE!

Reply to this answer
CleverCoder88
You might need the full PowerShell script if you're looking to do more than just basic beeps. Here's a more comprehensive version: ```powershell Add-Type -TypeDefinition @' using System.Runtime.InteropServices; [Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] interface IAudioEndpointVolume { // Other COM methods, etc. } '@ [audio]::Mute = $false [audio]::Volume = 1 [console]::beep(500,300) ``` Give it a shot, and see if that works!

ThanksForTheCode: Awesome, appreciate the complete code! Gonna try this out!

Reply to this answer
SoundNerd321
You can use the System.Console class and do something like this: ```powershell [Console]::Beep(1000, 500) ``` Or to play WAV files, try using System.Media.SoundPlayer as an alternative.
Reply to this answer
TechyTrickster
You really need .NET framework for PowerShell to work properly in WinPE, which isnโ€™t included by default. Plus, you'll need to add some system files.
Reply to this answer
PracticalSolutions
If it's just to signal progress, consider using TTS to announce each step. Otherwise, you might want to set up notifications through Slack or Teams for a different approach. WinPE likely lacks audio support by default, so you'll need to add components to get it running. Also, changing your background to a bright color during specific steps could grab attention instead of sound.
Reply to this answer
OpenDialogue
Out of curiosity, what task are you trying to alert people about in WinPE? Is it to notify users when input is needed for a GUI? Maybe a bright background color could also signal when action is required, which might be visible enough for techs to notice.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions