[solved] change Matlab speech tongue

7 ビュー (過去 30 日間)
bryan
bryan 2020 年 2 月 13 日
移動済み: Walter Roberson 2025 年 8 月 5 日
Hello
I use thiese commands to have Matlab read text:
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, 'text français uniquement' );
I live in France, I want to have it speak english text, but it only reads french correclty
I tried to change the narrator in Windows 10 but seems to have no effect
My question: how to set the tongue to english when it is french?
thank you

回答 (1 件)

Edu Benet Cerda
Edu Benet Cerda 2020 年 2 月 20 日
移動済み: Walter Roberson 2025 年 8 月 5 日
The Speech Synthesizer will have access to any language installed in the computer. Hence, assuming that you have English installed, you should be able to change the voice such that it gets and English speaker.
You can run the code below in MATLAB to get a list of all the installed voices:
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
voices = obj.GetInstalledVoices;
for i = 1 : voices.Count
voice = Item(voices,i-1);
voice.VoiceInfo.Name
end
and then you should be able to select the voice by doing:
obj.SelectVoice('Microsoft David Desktop') % You need to add here the string corresponding to the right voice. This is just the one I had installed.
obj.Speak('text français uniquement')
However, for further information I would recommend you reaching to Microsoft since they are the ones developing that package.
  1 件のコメント
bryan
bryan 2020 年 2 月 20 日
移動済み: Walter Roberson 2025 年 8 月 5 日
thank you for your answer.
it works perfectly (I have 1 french and 2 english voices installed), so I could swap

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by