Skip to content

Instantly share code, notes, and snippets.

@Nolwennig
Last active November 10, 2025 19:07
Show Gist options
  • Save Nolwennig/bbe70f5b20ea5b49b15494e81ac6dd06 to your computer and use it in GitHub Desktop.
Save Nolwennig/bbe70f5b20ea5b49b15494e81ac6dd06 to your computer and use it in GitHub Desktop.
Windows Subsystem for Linux (WSL)
powershell.exe -c "
[console]::beep(392,300); Start-Sleep -Milliseconds 50;
[console]::beep(392,300); Start-Sleep -Milliseconds 50;
[console]::beep(440,300); Start-Sleep -Milliseconds 50;
[console]::beep(392,300); Start-Sleep -Milliseconds 50;
[console]::beep(523,500); Start-Sleep -Milliseconds 50;
[console]::beep(494,700); Start-Sleep -Milliseconds 300;
[console]::beep(392,300); Start-Sleep -Milliseconds 50;
[console]::beep(392,300); Start-Sleep -Milliseconds 50;
[console]::beep(440,300); Start-Sleep -Milliseconds 50;
[console]::beep(392,300); Start-Sleep -Milliseconds 50;
[console]::beep(587,500); Start-Sleep -Milliseconds 50;
[console]::beep(523,700);
"
say() {
if [ -z "$1" ]; then
echo "Usage: say 'text to speech'"
return 1
fi
local text="$*"
powershell.exe -ExecutionPolicy Bypass -Command "Add-Type -AssemblyName System.Speech; \$speak=New-Object System.Speech.Synthesis.SpeechSynthesizer; \$speak.Speak('$text')"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment