Jump to content
Sign in to follow this  
ToyleY

Changing the pitch in text-to-speech app.

Recommended Posts

Here are the SPEAKFLAGS for SAPI 5.1- but the Autoit falls over if they are used.

typedef enum SPEAKFLAGS

{

//--- SpVoice flags

SPF_DEFAULT,

SPF_ASYNC,

SPF_PURGEBEFORESPEAK,

SPF_IS_FILENAME,

SPF_IS_XML,

SPF_IS_NOT_XML,

SPF_PERSIST_XML,

//--- Normalizer flags

SPF_NLP_SPEAK_PUNC,

//--- Masks

SPF_NLP_MASK,

SPF_VOICE_MASK,

SPF_UNUSED_FLAGS

} SPEAKFLAGS;

The SDK gives this example:

hr = pVoice->Speak(L"This sounds normal <pitch middle = '-10'/> but the pitch drops half way through", SPF_IS_XML, NULL );

I'm using this in Autoit:

$o_speech.Speak("This sounds normal <pitch middle = '-10'/> but the pitch drops half way through", SPF_IS_XML);

Can't use the 'NULL' var (channel) in Autoit as that fails, but can use numeric values for SPEAKFLAGS. For example:

$o_speech.Speak("This is a test", 1)

makes the speech engine asyinc (that is, SPF_ASYNC = 1, so you can pause, stop, skip and resume speech.

Anyway, anyone know what the values of the SPEAKFLAGS might be (in particular SPF_IS_XML)?

If not I am going to have to put in values manually and SPF_IS_XML might be a massive number.

Ta

ToyleY

:)

Edited by ToyleY

Share this post


Link to post
Share on other sites

Thanks - no pitch control in that example but I solved it:

$o_speech.Speak("<pitch middle='5'>This text should be spoken at pitch five.<pitch middle='-100'>This text should be spoken at pitch zero.</pitch></pitch>", 3)

It only works with proper 5.1 voices - my lovely (and expensive ATT voice won't play ball - bah!)

The SPF_IS_XML SPEAKFLAGS does in fact = 3 *(it was my ATT voice - which seems to be some hashed SAPI 4.1 that messed me up).

Edited by ToyleY

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...