Search code examples
c#windowstext-to-speechsapi

How to control third-party text-to-speech voices using SAPI 5?


Windows includes the SAPI 5 API that lets you control TTS voices. However I'm using Acapela Peter and it does not show up in the window TTS dialog. So I cannot use this voice with the typical .NET APIs (for example this codeproject app). However the voice shipped with this text file : VoiceDescriptions.txt which seems like variables that I can feed into the SAPI engine to help it detect this voice. So my question is : How do I use this voice metadata to generate speech with SAPI? I have all of the referenced files installed with the voice. I found the SpVoice Win API but it does not mention any way of loading metadata from text.

[LANG,British]
@=eng.tml
PHOTREE=eng.trx
PROSO=eng.oso
F0=eng.f0r
DICTIONARY=eng.bab.dca
LDI=eng.bab.ldi
BNF=eng.bnx
BNFNOTAG=eng.notag.bnx
POST=eng.pst
GRI=eng.gri
GRO=eng.gro
SPD=180
Language=British
Info=eng.nfo


[VOICE,Peter22k,British,British]
Base=Peter22k.nuul
Coeff=Peter22k.coef
Database=Peter22k.vco
Info=Peter22k.nfo
Pitch=110
Speed=100
Freq=22050

Solution

  • It looks like Acapela has a separate product that adds a SAPI interface layer.

    If you want to roll it yourself, you could write a SAPI engine interface to the Acapela TTS engine, but that's a significant undertaking (probably 2-3 dev months to create).