If you want to use text to Mandarin, at least you need to have Chinese character installed on Windows. If you can type Chinese character in Notepad, you should be able to get this.
The MATLAB has command to call Microsoft NET, you can type "help System.Speech" to get more details, you should not need any toolbox to do this.
In case you could not get it running, please view the included MP4 video, see how it works, and leave a feedback, so we can help to update code.
Pink_panther (2021). Text to Speech Mandarin Demo (Can mix Chinese with English) (https://www.mathworks.com/matlabcentral/fileexchange/86148-text-to-speech-mandarin-demo-can-mix-chinese-with-english), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
@Hsiung, you can also try this, change "Hanhan" to "Huihui", I just tried installing additional language simplified CN, I gained Huihui Voice.
So basically if you installed Traditional, you get Hanhan, and with Simplified, you get Huihui. Thanks
Dear Hsiung, I assume you can hear default male English voice. Please run the following code,
(I only have traditional language installed on my Windows 10)
----------------------------------------------------------
% Check what voices installed on your PC
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
% You should have David, it is default Male English voice
Speak(obj,'This is a Test')
voices = obj.GetInstalledVoices;
for i = 1 : voices.Count
voice = Item(voices,i-1);
disp(voice.VoiceInfo.Name);
end
--------------------------------------------
this is what I got in return:
>> matlab_check_installed_voices
Microsoft David Desktop
Microsoft Zira Desktop
Microsoft Hanhan Desktop
when I tried to run this --> obj.SelectVoice('Microsoft Hanhan Desktop') %Hanhan 講中文
I got the following error ??
obj.SelectVoice('Microsoft Hanhan Desktop') %Hanhan 講中文
Message: Cannot set voice. No matching voice is installed or the voice was disabled.
Source: System.Speech
HelpLink:
Please download the zipfile, which includes a short demo video, in case your PC can not type Chinese, you can still hear what the Mandarin Female voice sounds like.