win10如何调用小娜进行TXT文本朗读?具体应该怎么操作呢?本篇文章小编给大家分享一下win10调用小娜进行TXT文本朗读方法,对此感兴趣的小伙伴们可以来看看。
1、按下Win+X,选中Windows Powershell(管理员),输入以下命令:
$TTS1 = "HKLM:SOFTWAREMicrosoftSpeech_OneCoreVoicesTokensMSTTS_V110_zhCN_HongyuM"
$TTS1ATTRIB = "HKLM:SOFTWAREMicrosoftSpeech_OneCoreVoicesTokensMSTTS_V110_zhCN_HongyuMAttributes"
$TTS2 = "HKLM:SOFTWAREMicrosoftSpeechVoicesTokensMSTTS_V110_zhCN_HongyuM"
$TTS2ATTRIB = "HKLM:SOFTWAREMicrosoftSpeechVoicesTokensMSTTS_V110_zhCN_HongyuMAttributes"
New-Item -Path $TTS1,$TTS2,$TTS1ATTRIB,$TTS2ATTRIB
New-ItemProperty -Path $TTS1,$TTS2 -Name "(default)" -PropertyType string -Value "Microsoft Hongyu Mobile - Chinese (Simplified, PRC)"
New-ItemProperty -Path $TTS1,$TTS2 -Name LangDataPath -PropertyType string -Value "%windir%Speech_OneCoreEnginesTTSzh-CNMSTTSLoczhCN.dat"
New-ItemProperty -Path $TTS1,$TTS2 -Name LangUpdateDataDirectory -PropertyType string -Value "%SystemDrive%DataSharedDataSpeech_OneCoreEnginesTTSzh-CN"
New-ItemProperty -Path $TTS1,$TTS2 -Name VoicePath -PropertyType string -Value "%windir%Speech_OneCoreEnginesTTSzh-CNM2052Hongyu"
New-ItemProperty -Path $TTS1,$TTS2 -Name VoiceUpdateDataDirectory -PropertyType string -Value "%SystemDrive%DataSharedDataSpeech_OneCoreEnginesTTSzh-CN"
New-ItemProperty -Path $TTS1,$TTS2 -Name 804 -PropertyType string -Value "Microsoft Hongyu Mobile - Chinese (Simplified, PRC)"
New-ItemProperty -Path $TTS1,$TTS2 -Name CLSID -PropertyType string -Value "{179F3D56-1B0B-42B2-A962-59B7EF59FE1B}"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name Version -PropertyType string -Value "11.0"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name Language -PropertyType string -Value "804"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name Gender -PropertyType string -Value "Female"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name Age -PropertyType string -Value "Adult"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name DataVersion -PropertyType string -Value "11.0.2013.1022"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name SharedPronunciation -PropertyType string -Value ""
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name Name -PropertyType string -Value "Microsoft Hongyu Mobile"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name Vendor -PropertyType string -Value "Microsoft"
New-ItemProperty -Path $TTS1ATTRIB,$TTS2ATTRIB -Name PersonalAssistant -PropertyType string -Value "1"
等待命令运行结束后,最小化该窗口,小娜搜索打开控制面板,查看方式更改为大图标,点击语音识别,文本到语音转换
语音选择更改为:Microsoft Huihui Desktop - Chinese (Simplified) ,确定关闭该窗口;
打开Windows Powershell(管理员),输入以下命令:
$Read = Read-Host -Prompt "输入需要朗读文本的路径"
$Voice = New-Object -ComObject SAPI.SpVoice
$Voice.Speak($Read,5)
Read-Host -Prompt "回车退出朗读"
回车执行,输入需要朗读文本的路径,回车朗读!