views:

310

answers:

2

I'm migrating from XP to Windows 7 64 bit. My app which I compiled on my XP machine works properly on XP. However when I run the exe on my W7 machine, the list of voices returned by GetVoices is as follows:
Microsoft Anna
Microsoft Mary
Microsoft Mike
Sample TTS Voice.

Checking the W7 Speech Properties dialog shows that only Microsoft Anna is loaded on the machine. Checking the registry at HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Speech/Voices confirms this.

Recompiling my app on my new Windows 7 development machine creates an exe that duplicate the above behavior. (The XP compiled code and the W7 compiled code reproduce the same error when executed under W7)

I'm developing in Delphi 7 on Windows 7 64 bit and I'm using the Microsoft Speech Object Library (Version 5.4) (note: 5.4 is what shows in the Import Type Library list).

I installed SpeechSDK51.exe onto my W7 machine. This came from:

http://www.microsoft.com/downloads/details.aspx?FamilyID=5e86ec97-40a7-453f-b0ee-6583171b4530&DisplayLang=en

The following code produces the list of 4 voices on Windows 7 even though there should only be one voice:

procedure TForm1.FormCreate(Sender: TObject);  
var  
    i: integer;  
    SOToken: ISpeechObjectToken;  
    SOTokens: ISpeechObjectTokens;  
begin  
    cbbVoices.Clear;  
    SOTokens := SpVoice1.GetVoices('', '');  

    for i := 0 to SOTokens.Count - 1 do begin  
        SOToken := SOTokens.Item(i);  
        cbbVoices.AddItem( SOToken.GetDescription(0), TObject(SOToken) );  
        SOToken._AddRef;  
    end;  
end;  

Any suggestions on how to deal with this problem?

thanks,
shawnh

A: 

Unconfirmed yet, but I think that Microsoft Sam, Microsoft Mike and Microsoft Mary do not work on Windows Vista and later.

I guess you could install them with the 5.1 SDK, so they are reported back when you query the voices, but being possibly not compatible with the 5.4 engine, they cannot be used.

You may want to filter GetVoices with the EngineProperties attribute to limit what is returned.

Disclaimer: all this is untested/guesswork/doc-reading....

François
Thanks Francois. I guess I didn't explain the problem clearly enough. The problem is not that Mike and Marry don't work on W7 (I don't know - I haven't tried them). The problem is that GetVoices shows that they ARE installed on the machine but they are not. If the user selects Mary from the list of voices returned from GetVoices, we get an error because that voice is not actually installed on the machine.
+1  A: 

Microsoft Anna is the only 64-bit voice you have the other ones are 32-bit engines. Your system can only use the 64-bit engine(Anna) so only this one can be selected in the panel. But the other ones are installed as well. If you open this file: /%Windows%/SystemWOW64/Speech/SpeechUX/sapi.cpl you will see a dialog similar to the one for the control panel but now you will be able to select any one of those voices as the standart voice.

Pascal