{"id":17688323,"url":"https://github.com/jonelo/unlock-win-tts-voices","last_synced_at":"2026-04-11T20:39:04.670Z","repository":{"id":63141766,"uuid":"365842106","full_name":"jonelo/unlock-win-tts-voices","owner":"jonelo","description":"Unlocks the Microsoft Windows TTS voices for use with other x64 applications such as PowerShell","archived":false,"fork":false,"pushed_at":"2022-11-13T16:30:14.000Z","size":40,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T21:30:46.686Z","etag":null,"topics":["batch-script","hack","numericalchameleon","powershell","powershell-script","speech-to-text","tts","windows"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-09T20:28:58.000Z","updated_at":"2025-03-12T09:54:21.000Z","dependencies_parsed_at":"2022-11-13T20:47:30.539Z","dependency_job_id":null,"html_url":"https://github.com/jonelo/unlock-win-tts-voices","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonelo/unlock-win-tts-voices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Funlock-win-tts-voices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Funlock-win-tts-voices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Funlock-win-tts-voices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Funlock-win-tts-voices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonelo","download_url":"https://codeload.github.com/jonelo/unlock-win-tts-voices/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Funlock-win-tts-voices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279325420,"owners_count":26148880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-script","hack","numericalchameleon","powershell","powershell-script","speech-to-text","tts","windows"],"created_at":"2024-10-24T11:44:09.750Z","updated_at":"2025-10-17T10:16:57.388Z","avatar_url":"https://github.com/jonelo.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unlock-win-tts-voices.bat\nThis batch script is for end users and unlocks the Microsoft Windows TTS voices for use with other x64 applications such as PowerShell. You can call the batch as often as needed.\n\n## What does it?\nThe batch prints a list of TTS voices that powershell can see. Then the batch asks the user whether the TTS voices should be unlocked. After the acutal action, the batch prints again a list of TTS voices powershell can see.\n\n### Running the script\nOpen a PowerShell (using normal permissions), and change to the directory where you have stored the batch file. On my computer I have stored it to Applications\\bin. Launch it simply by typing `.\\unlock-win-tts-voices.bat`:\n\n\u003cimg width=\"80%\" src=\"https://raw.githubusercontent.com/jonelo/unlock-win-tts-voices/main/docs/images/powershell_unlock-win-tts-voices.png\" alt=\"unlock_win_tts-voices in action\" style=\"vertical-align:top;margin:10px 10px\" /\u003e\n\n## Development details\n### How the unlock works\nThere is a small PowerShell script on the web (see credits) that simple copies a particular registry tree to another. Actally that action enables other applications to use the OS TTS voices.\n\n### Circumvent the powershell hurdles \nThe problem with powershell scripts is that they have an ExecutionPolicy applied which makes it difficult to run for end users. Also the powershell script requires admin priviledges because the script wants to modify the registry. \n\nI have solved those problems by cascading two powershell commands. The first powershell is being called with the verb RunAs which enables the user to allow Admin priviledges and the second powershell is being called by the first one using Start-Process which executes the actual powershell script with a hidden Windows style and Unrestricted ExecutionPolicy. Also, in order to avoid trouble with escaping the script calls the powershell script as a UTF16le/base64 encoded command.\n\nHere ist the final code line in batch syntax:\n```\npowershell.exe -Command \"Start-Process -WindowStyle Hidden -FilePath powershell.exe -ArgumentList \\\"-ExecutionPolicy Unrestricted -EncodedCommand JABzAG8AdQByAGMAZQBQAGEAdABoACAAPQAgACcASABLAEwATQA6AFwAcwBvAGYAdAB3AGEAcgBlAFwATQBpAGMAcgBvAHMAbwBmAHQAXABTAHAAZQBlAGMAaABfAE8AbgBlAEMAbwByAGUAXABWAG8AaQBjAGUAcwBcAFQAbwBrAGUAbgBzACcAOwAgACQAZABlAHMAdABpAG4AYQB0AGkAbwBuAFAAYQB0AGgAIAA9ACAAJwBIAEsATABNADoAXABTAE8ARgBUAFcAQQBSAEUAXABNAGkAYwByAG8AcwBvAGYAdABcAFMAcABlAGUAYwBoAFwAVgBvAGkAYwBlAHMAXABUAG8AawBlAG4AcwAnADsAIABjAGQAIAAkAGQAZQBzAHQAaQBuAGEAdABpAG8AbgBQAGEAdABoADsAIAAkAGwAaQBzAHQAVgBvAGkAYwBlAHMAIAA9ACAARwBlAHQALQBDAGgAaQBsAGQASQB0AGUAbQAgACQAcwBvAHUAcgBjAGUAUABhAHQAaAA7ACAAZgBvAHIAZQBhAGMAaAAoACQAdgBvAGkAYwBlACAAaQBuACAAJABsAGkAcwB0AFYAbwBpAGMAZQBzACkAIAB7ACAAJABzAG8AdQByAGMAZQAgAD0AIAAkAHYAbwBpAGMAZQAuAFAAUwBQAGEAdABoADsAIABjAG8AcAB5ACAALQBQAGEAdABoACAAJABzAG8AdQByAGMAZQAgAC0ARABlAHMAdABpAG4AYQB0AGkAbwBuACAAJABkAGUAcwB0AGkAbgBhAHQAaQBvAG4AUABhAHQAaAAgAC0AUgBlAGMAdQByAHMAZQAgAH0A\\\" -Verb RunAs\"\n```\n\n### Wait, how did you encode the powershell script?\n```\nX:\\\u003epowershell\nPS X:\\\u003e $command = '$sourcePath = ''HKLM:\\software\\Microsoft\\Speech_OneCore\\Voices\\Tokens''; $destinationPath = ''HKLM:\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens''; cd $destinationPath; $listVoices = Get-ChildItem $sourcePath; foreach($voice in $listVoices) { $source = $voice.PSPath; copy -Path $source -Destination $destinationPath -Recurse }'\nPS X:\\\u003e echo $command\n$sourcePath = 'HKLM:\\software\\Microsoft\\Speech_OneCore\\Voices\\Tokens'; $destinationPath = 'HKLM:\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens'; cd $destinationPath; $listVoices = Get-ChildItem $sourcePath; foreach($voice in $listVoices) { $source = $voice.PSPath; copy -Path $source -Destination $destinationPath -Recurse }\n\nPS X:\\\u003e $bytes = [System.Text.Encoding]::Unicode.GetBytes($command)\nPS X:\\\u003e echo $bytes\n36\n0\n115\n0\n111\n0\n117\n0\n114\n....\n\nPS X:\\\u003e $encodedCommand = [Convert]::ToBase64String($bytes)\nPS X:\\\u003e echo $encodedCommand\nJABzAG8AdQByAGMAZQBQAGEAdABoACAAPQAgACcASABLAEwATQA6AFwAcwBvAGYAdAB3AGEAcgBlAFwATQBpAGMAcgBvAHMAbwBmAHQAXABTAHAAZQBlAGMAaABfAE8AbgBlAEMAbwByAGUAXABWAG8AaQBjAGUAcwBcAFQAbwBrAGUAbgBzACcAOwAgACQAZABlAHMAdABpAG4AYQB0AGkAbwBuAFAAYQB0AGgAIAA9ACAAJwBIAEsATABNADoAXABTAE8ARgBUAFcAQQBSAEUAXABNAGkAYwByAG8AcwBvAGYAdABcAFMAcABlAGUAYwBoAFwAVgBvAGkAYwBlAHMAXABUAG8AawBlAG4AcwAnADsAIABjAGQAIAAkAGQAZQBzAHQAaQBuAGEAdABpAG8AbgBQAGEAdABoADsAIAAkAGwAaQBzAHQAVgBvAGkAYwBlAHMAIAA9ACAARwBlAHQALQBDAGgAaQBsAGQASQB0AGUAbQAgACQAcwBvAHUAcgBjAGUAUABhAHQAaAA7ACAAZgBvAHIAZQBhAGMAaAAoACQAdgBvAGkAYwBlACAAaQBuACAAJABsAGkAcwB0AFYAbwBpAGMAZQBzACkAIAB7ACAAJABzAG8AdQByAGMAZQAgAD0AIAAkAHYAbwBpAGMAZQAuAFAAUwBQAGEAdABoADsAIABjAG8AcAB5ACAALQBQAGEAdABoACAAJABzAG8AdQByAGMAZQAgAC0ARABlAHMAdABpAG4AYQB0AGkAbwBuACAAJABkAGUAcwB0AGkAbgBhAHQAaQBvAG4AUABhAHQAaAAgAC0AUgBlAGMAdQByAHMAZQAgAH0A\n```\n\n\n## Credits\n- https://stackoverflow.com/questions/55695930/listing-and-selecting-installed-voice-for-text-to-speech\n- https://support.microsoft.com/en-us/topic/how-to-download-text-to-speech-languages-for-windows-10-d5a6b612-b3ae-423f-afa5-4f6caf1ec5d3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonelo%2Funlock-win-tts-voices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonelo%2Funlock-win-tts-voices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonelo%2Funlock-win-tts-voices/lists"}