Reputation: 51
Trying to make Russian language flashcards with pronounciation using Delphi 2010. I can make it work on English. I have Russian installed as Text2Speech language on Win10, but I do not know how to switch the language.
This speaks: SpVoice1.Speak('Hello, what's up', SVSFDefault);
This is silent: SpVoice1.Speak('Привет, как дела', SVSFDefault);
Upvotes: 2
Views: 1756
Reputation: 51
Since this was hard to find, I reply to my own thread with what I found by dissecting someone else's code. I put this in the OnCreate
event to change the voice:
procedure TForm1.FormCreate(Sender: TObject);
var
AllVoices: ISpeechObjectTokens;
begin
AllVoices := SpVoice1.GetVoices('', '');
SpVoice1.Voice := AllVoices.Item(2);
end;
It works, since on my machine the Russian voice happens to be 2, so obviously I still need to figure out how to make this work properly. But it is a start...
Upvotes: 2