[solved] change Matlab speech tongue

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

Respuestas (1)

Edu Benet Cerda
Edu Benet Cerda el 20 de Feb. de 2020
Movida: Walter Roberson el 5 de Ag. de 2025
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 comentario

bryan
bryan el 20 de Feb. de 2020
Movida: Walter Roberson el 5 de Ag. de 2025
thank you for your answer.
it works perfectly (I have 1 french and 2 english voices installed), so I could swap

Iniciar sesión para comentar.

Categorías

Productos

Etiquetas

Preguntada:

el 13 de Feb. de 2020

Movida:

el 5 de Ag. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by