Change TTS engine in Windows 8 |
|
I have some old code that has been used for years to change the speech engine used in TTS
An extract is:
global:
soSpeechVoice :string='';
soSpeechEngines :TStringList;
uvVoice :ISpeechVoice;
routine:
var
lvLoop :word;
lvSpeechToken :ISpeechObjectToken;
lvSpeechTokens :ISpeechObjectTokens;
lvToken :word;
begin
soSpeechEngines.Clear;
lvSpeechTokens:=uvVoice.GetVoices('','');
lvToken:=0;
for lvLoop:=0 to Pred(lvSpeechTokens.Count) do begin
lvSpeechToken:=lvSpeechTokens.Item(lvLoop);
soSpeechEngines.AddObject(lvSpeechToken.GetDescription(0),TObject(lvSpeechToken));
if lvSpeechToken.GetDescription(0)=soSpeechVoice then begin
lvToken:=lvLoop;
end;
lvSpeechToken._AddRef;
end;
lvSpeechToken:=ISpeechObjectToken(Pointer(soSpeechEngines.Objects[lvToken]));
uvVoice.Voice:=lvSpeechToken;
All has been working ... under Windows 8, all seems ok but the voice is not changed
I am using SAPI 5.1 in Delphi XE.
Any clues?
|