Mega Search
23.2 Million


Sign Up

Make a donation  
Change TTS engine in Windows 8  
News Group: embarcadero.public.delphi.multimedia

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?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 5-Sep-2013, at 4:28 AM EST
From: KEN SCALLEY