Page 1 of 1

PurESpeak, an ESpeak wrapper

Posted: Fri Jul 20, 2012 12:13 pm
by erion
Hi all,

I have finished creating a wrapper for ESpeak, a free and open source speech synthesizer.
Features include speak on a selected audio device, into a wave file, or even a PureBasic sound object. Change speed, volume, pitch, word gap, voice, add variants.
Info and the download link: http://erion.tdrealms.com/software/pb/purespeak

Sample:

Code: Select all

 initspeak(".") ;Initialize ESpeak. Use a full datapath, or . for current directory.
 speaktext("Hello, world! This is ESpeak from PureBasic!") ;speak some text. 2nd parameter can be path/filename.
delay(5000) ;wait 5 secs
closeSpeak() ;free up resources
Audio works the same way, except 'SpeakMemory' returns a pointer that you can use to catch the sound from. Remember to free up this memory block afterwards.

Cheers,
Erion

Re: PurESpeak, an ESpeak wrapper

Posted: Fri Jul 20, 2012 12:49 pm
by electrochrisso
8) , Thanks for sharing. :)

Re: PurESpeak, an ESpeak wrapper

Posted: Fri Jul 20, 2012 3:55 pm
by Kwai chang caine
Thanks works good !! 8)

Re: PurESpeak, an ESpeak wrapper

Posted: Sun Jul 22, 2012 2:22 pm
by SFSxOI
Good job.

How do you set the voice to female?

Re: PurESpeak, an ESpeak wrapper

Posted: Sun Jul 22, 2012 2:42 pm
by erion
Thanks everyone.
Voice switching works by specifying the language+variant. So, for instance switching to the first female english voice you would say

Code: Select all

SetVoiceName("en+f1")
, before calling SpeakText.

Erion

Re: PurESpeak, an ESpeak wrapper

Posted: Sun Jul 22, 2012 4:10 pm
by rsts
Very nice :)

Thanks for sharing.

Re: PurESpeak, an ESpeak wrapper

Posted: Sun Jul 22, 2012 4:45 pm
by SFSxOI
erion wrote:Thanks everyone.
Voice switching works by specifying the language+variant. So, for instance switching to the first female english voice you would say

Code: Select all

SetVoiceName("en+f1")
, before calling SpeakText.

Erion

Ahhh, ok. Thanks.

Re: PurESpeak, an ESpeak wrapper

Posted: Mon Jul 23, 2012 6:28 am
by dige
Wow, sounds good even with the German language!
SetVoiceName("de+m1")
Thx erion!

Re: PurESpeak, an ESpeak wrapper

Posted: Tue Jul 24, 2012 10:53 pm
by erion
It seems I have a small problem. I'm trying to implement a stop procedure, but the program completely hangs at waveOutReset_(). I suspect this is an API level freeze, and despite the many topics about this on the internet I did not manage to find a definite answer. Does anyone know why this is happening? This is the Stop code:

Code: Select all

Procedure Stop()
    eSpeak_cancel()
waveOutPause_(hDevice)
waveOutReset_(hDevice) ;Hangs here
EndProcedure
Erion