Little SAPI4 and SAPI5 UserLibrary to test
Library Updated
After digging a lot in the SAPI 5.1 SDK finally found the way to get ALL the events working while speaking to a .wav file... by looking for the things the SDK doesn't explain!
(Microsoft guys really keep some details for themselves.)
Well, now you can get informed of the progress of encoding for all the engines installed in your system, independently of the SAPI version.
There's also a new function, TTSEngLang(). It retrieves the language description of the voices.
You can get PureTTS here:
http://geocities.com/esteban1uy/My_drive.html
Just look for the last release.
(Microsoft guys really keep some details for themselves.)
Well, now you can get informed of the progress of encoding for all the engines installed in your system, independently of the SAPI version.
There's also a new function, TTSEngLang(). It retrieves the language description of the voices.
You can get PureTTS here:
http://geocities.com/esteban1uy/My_drive.html
Just look for the last release.
This is great!
It is working fine here ! (win 2000 sp4, AMD 2100)
I have not seen any thing before that can work with both SAPI 4 & 5. Very Clever work.
It is working fine here ! (win 2000 sp4, AMD 2100)
I have not seen any thing before that can work with both SAPI 4 & 5. Very Clever work.
Ziltch - http://www.youtube.com/user/OZiltch
to Ziltch:
Thank you very much for testing it.
The idea is to have a set of functions that works the same way for SAPI 4 AND 5. This is not very original, there are a lot of commercial products that allow to do the same thing as this userlibrary, but I found those dlls or activex components not very reliable (some of them just a piece of... you know, and there are guys that want to make a couple of bucks with them). For most peoples SAPI 5 is enough, but there are still many free SAPI 4 voices (engines) all around the web. For example, IBM voices are very accurate, they write to a .wav at incredible speed, are available in many languages, and are SAPI 4 compliant!!!
Thank you very much for testing it.
The idea is to have a set of functions that works the same way for SAPI 4 AND 5. This is not very original, there are a lot of commercial products that allow to do the same thing as this userlibrary, but I found those dlls or activex components not very reliable (some of them just a piece of... you know, and there are guys that want to make a couple of bucks with them). For most peoples SAPI 5 is enough, but there are still many free SAPI 4 voices (engines) all around the web. For example, IBM voices are very accurate, they write to a .wav at incredible speed, are available in many languages, and are SAPI 4 compliant!!!
If you're still looking, free SAPI4 French male and female voices can be downloaded at:Gansta93 wrote:But the problem is that fweil's voices don't apeare in voices list. If someone knows where we can find french voices which apear, please say where.
http://activex.microsoft.com/activex/co ... ttsfrf.exe
Regards,
Eric
Thx. I understand... It is voices for SAPI 4... And My computer doesn't like them argh... It seams to be impossible to have SAPI 4 and 5 to be installed on my computer and add thes voices without crash. It does it just with PureTTS because when I want to use SAPI with VBScript and have thes voices installed, it doesn't crash... strange.
to Gansta93:
Can you provide some debugging information?
Which engines have you installed, which SAPI version are they, does TTSInit() return any initialization codes?
Maybe we can test the initialization steps one by one to find what's going wrong.
First of all, give a try to this:
Best regards
Esteban1
Can you provide some debugging information?
Which engines have you installed, which SAPI version are they, does TTSInit() return any initialization codes?
Maybe we can test the initialization steps one by one to find what's going wrong.
First of all, give a try to this:
Code: Select all
Enumeration
#ST_DEFAULT = 0
#ST_KEEPUNDO = 1
#ST_SELECTION = 2
#CLSCTX_INPROC_SERVER = $1
#CLSCTX_INPROC_HANDLER = $2
#CLSCTX_LOCAL_SERVER = $4
#CLSCTX_REMOTE_SERVER = $10
#CLSCTX_ALL = (#CLSCTX_INPROC_SERVER|#CLSCTX_INPROC_HANDLER|#CLSCTX_LOCAL_SERVER|#CLSCTX_REMOTE_SERVER)
EndEnumeration
CoInitialize_(0)
If CoCreateInstance_(?CLSID_SpVoice, 0,#CLSCTX_ALL, ?IID_ISpVoice, @a)=0
MessageRequester("Success!", "You have SAPI 5 installed!", #MB_OK|#MB_ICONINFORMATION)
Else
MessageRequester("Failure!", "You don't have SAPI 5 installed!", #MB_OK|#MB_ICONWARNING)
EndIf
If CoCreateInstance_(?CLSID_ITextToSpeech, 0,#CLSCTX_ALL, ?IID_ITextToSpeech, @b)=0
MessageRequester("Success!", "You have SAPI 4 installed!", #MB_OK|#MB_ICONINFORMATION)
Else
MessageRequester("Failure!", "You don't have SAPI 5 installed!", #MB_OK|#MB_ICONWARNING)
EndIf
CoUninitialize_()
DataSection
CLSID_SpVoice:
Data.l $96749377
Data.w $3391,$11D2
Data.b $9E,$E3,$00,$C0,$4F,$79,$73,$96
IID_ISpVoice:
Data.l $269316D8
Data.w $57BD,$11D2
Data.b $9E,$EE,$00,$C0,$4F,$79,$73,$96
CLSID_ITextToSpeech:
Data.l $EEE78591
Data.w $FE22,$11D0
Data.b $8B,$EF,$00,$60,$08,$18,$41,$DE
IID_ITextToSpeech:
Data.l $EEE78590
Data.w $FE22,$11D0
Data.b $8B,$EF,$00,$60,$08,$18,$41,$DE
EndDataSection
Esteban1
to Gansta93:
Are you sure you are terminating the speech support with TTSEnd()?
The problem sounds a little weird, if TTSInit() is not the source of trouble, then you can use TTSSpeak() and every other function in the library!!!
First you said that TTSInit() gave you a "big crash", but now the crash is at the end of the program.
Could you please post some code to show what's wrong and help you to find the solution?
Esteban1
Are you sure you are terminating the speech support with TTSEnd()?
The problem sounds a little weird, if TTSInit() is not the source of trouble, then you can use TTSSpeak() and every other function in the library!!!
First you said that TTSInit() gave you a "big crash", but now the crash is at the end of the program.
Could you please post some code to show what's wrong and help you to find the solution?
Esteban1
PureTTS update
PureTTS userlibrary was updated for compatibility with PB 4.00
Please download it at:
http://www.geocities.com/esteban1uy/My_drive.html
Sorry for the delay :roll:
Esteban1
Please download it at:
http://www.geocities.com/esteban1uy/My_drive.html
Sorry for the delay :roll:
Esteban1
hello !
@ Esteban1 :
est-ce possible d'avoir le code source
de ta librairie ?
Merci d'avance ..
google translate :
is this possible to have the source code of your lib? TTS
Thanks ..
voici le dernier code de mon lecteur de press-papier en date !!
il gere la vitesse de lecture, et sauvegarde cette vitesse
ainsi que la voix choisi dans un fichier text "init.txt"
maintenant la nationalité apparait dans la liste des voix ..
voici le code (si vous avez installé les voix il doit marcher niquel)
il filtre les smileys !!
on peu regler le pitch sur les voix sapi4
le volume sur toute les voix (sapi4,5)
la vitesse de diction
google translation
here the last code of my press-paper reader in date!! it manages the reading rate, and safeguards this speed as well as the voice chosen in a file text “init.txt” maintaining nationality appears in the list of the voices. here the code (if you installed the voices it must walk niquel) it filters the smiley!! one little to regulate the pitch on the voices sapi4 volume on all the voice (sapi4,5) the speed of diction
@ Esteban1 :
est-ce possible d'avoir le code source
de ta librairie ?
Merci d'avance ..

google translate :
is this possible to have the source code of your lib? TTS
Thanks ..

voici le dernier code de mon lecteur de press-papier en date !!
il gere la vitesse de lecture, et sauvegarde cette vitesse
ainsi que la voix choisi dans un fichier text "init.txt"
maintenant la nationalité apparait dans la liste des voix ..
voici le code (si vous avez installé les voix il doit marcher niquel)
il filtre les smileys !!
on peu regler le pitch sur les voix sapi4
le volume sur toute les voix (sapi4,5)
la vitesse de diction
google translation
here the last code of my press-paper reader in date!! it manages the reading rate, and safeguards this speed as well as the voice chosen in a file text “init.txt” maintaining nationality appears in the list of the voices. here the code (if you installed the voices it must walk niquel) it filters the smiley!! one little to regulate the pitch on the voices sapi4 volume on all the voice (sapi4,5) the speed of diction
Declare MyStopEvent()
Declare MyStartEvent()
Declare MyPositionEvent(letter.l)
Enumeration
#fenetre
#liste
#bouton_parle
#text
#text2
#text3
#text4
#vitesse
#fichier
#volume
#pitch
EndEnumeration
type=TTSInit(0,0,0) ; First we initialize the tts support.
Debug type
voices.l = TTSEngCount() ; Get the highest voice index.
If voices > -1 ; If there are any voice installed...
Debug "There are " + Str (voices+1)+ " voices installed in your system"
;Remember that voice index starts from 0
For i=0 To voices
name$=TTSEngName(i) ; Retrieve each voice name.
Debug "Voice index = " + Str (i)+ " , Voice name = " +name$
Next i
Else
MessageRequester ( "erreur" , "je ne trouve pas de voix" + Chr (10)+ "installé sur le system" , #PB_MessageRequester_Ok )
End
EndIf
CallDebugger
;{**********lit le reglage*****************
OpenFile ( #fichier , "init.txt" )
param$= ReadString ( #fichier )
vitesse$= ReadString ( #fichier )
vitesse= Val (vitesse$)
volume$= ReadString ( #fichier )
volume= Val (volume$)
pitch$= ReadString ( #fichier )
pitch= Val (pitch$)
Debug param$
CloseFile ( #fichier )
voix= Val (param$)
Debug voix
;}***************************
TTSSelect(voix) ; choisi la voix sauvé
TTSSpeak( "Bonjour" ) ; Speak!
OpenWindow ( #fenetre , 374, 121, 200, 170,name$, #PB_Window_SystemMenu | #PB_Window_TitleBar )
SetWindowPos_ ( WindowID ( #fenetre ), -1, 230, 230, 0, 0, #SWP_NOSIZE )
;{ ***** dessin de l'interface **********************
; bouton parle/stop
CreateGadgetList ( WindowID ( #fenetre ))
ButtonGadget ( #bouton_parle , 5, 25, 120, 40, "Parle" )
Resultat = ComboBoxGadget ( #liste , 5, 2, 150, 150 )
; liste des voix
For i=0 To voices
name$=TTSEngName(i) ; Retrieve each voice name.
language$ = TTSEngLang(i) ; arg1.l = voice index
AddGadgetItem ( #liste , -1, language$ ) ; ajoute dans la liste les noms trouvé+nationalité
Next i
name$=TTSEngName( voix) ; cherche le nom
language$ = TTSEngLang(voix) ; cherche le nom+nationalité
SetGadgetState ( #liste , voix) ; active la voix lu par defaut dans la liste
SetWindowTitle ( #fenetre , name$) ; change le titre de la fenetre
; tracbar horizontal (vitesse de la voix)
TextGadget ( #text2 , 2,70, 50, 15, "Vitesse" )
Resultat = TrackBarGadget ( #vitesse , 40, 65, 100, 50, 0, 20, #PB_TrackBar_Ticks )
SetGadgetState ( #vitesse , vitesse)
; tracbar horizontal (volume de la voix)
TextGadget ( #text3 , 2,120, 50, 15, "Volume" )
Resultat = TrackBarGadget ( #volume , 40, 110, 100, 50, 0,100 , #PB_TrackBar_Ticks )
SetGadgetState ( #volume , volume)
CallDebugger
; tracbar vertical (pitch)
TextGadget ( #text4 , 160,145, 50, 30, "pitch" )
Resultat = TrackBarGadget ( #pitch , 160, 50, 50, 100, 0,20, #PB_TrackBar_Vertical )
SetGadgetState ( #pitch , pitch)
TextGadget ( #text , 2,155, 50, 15, "By Dobro" , #PB_Gadget_FrontColor )
SetGadgetColor ( #text , #PB_Gadget_FrontColor , RGB ($42,$42,$FF))
Result.l = TTSInit(@MyStartEvent(),@MyStopEvent(),@MyPositionEvent())
;} ***************************************************
Repeat
EventID = WaitWindowEvent ()
Select EventID
Case #PB_Event_Gadget
Select EventGadget ()
Case #bouton_parle ; apuis sur le bouton parle
If Result ; If the SAPI enviroment is initialized...
TTSSelect(voix) ; You can choose the voice index you like.
text$ = GetClipboardText ()
SetGadgetText ( #bouton_parle , "Parle" )
If lit=1
lit=0
TTSStop()
Goto fin
EndIf
lit=1
SetGadgetText ( #bouton_parle , "Stop" )
pitch= GetGadgetState ( #pitch )
pitch2=pitch-10
volume= GetGadgetState ( #volume )
TTSSetVolume( volume)
vitesse= GetGadgetState ( #vitesse )
vitesse2=vitesse-10
TTSSetSpeed(vitesse2) ; vitesse de diction -50=lent ; +50= tres rapide
TTSSetPitch(pitch2)
; virginie parle
text$ = RemoveString (text$, "Very Happy" ,1)
text$ = RemoveString (text$, "Crying or Very sad" ,1)
text$ = RemoveString (text$, "Smile" ,1)
text$ = RemoveString (text$, "Sad" ,1)
text$ = RemoveString (text$, "Surprised" ,1)
text$ = RemoveString (text$, "Shocked" ,1)
text$ = RemoveString (text$, "Confused" ,1)
text$ = RemoveString (text$, "Cool" ,1)
text$ = RemoveString (text$, "Laughing" ,1)
text$ = RemoveString (text$, "Mad" ,1)
text$ = RemoveString (text$, "#Mad" ,1)
text$ = RemoveString (text$, "Razz" ,1)
text$ = RemoveString (text$, "Embarassed" ,1)
text$ = RemoveString (text$, "#evil" ,1)
text$ = RemoveString (text$, "Twisted Evil" ,1)
text$ = RemoveString (text$, "Rolling Eyes" ,1)
text$ = RemoveString (text$, "Wink" ,1)
text$ = RemoveString (text$, "Exclamation" ,1)
text$ = RemoveString (text$, "Question" ,1)
text$ = RemoveString (text$, "Idea" ,1)
TTSSpeak(text$) ; Speak!
EndIf
Case #vitesse
Case #liste ; choix dans la liste combo
voix = GetGadgetState ( #liste )
name$=TTSEngName( voix) ; cherche le nom
SetWindowTitle ( #fenetre , name$)
fin:
EndSelect
EndSelect
Until EventID = #PB_Event_CloseWindow
If Result ; Once again, if the SAPI is initialized...
;{**********Sauve le reglage*****************
If OpenFile ( #fichier , "init.txt" )<>0
WriteStringN ( #fichier , Str (voix))
WriteStringN ( #fichier , Str (vitesse))
WriteStringN ( #fichier , Str (volume))
WriteStringN ( #fichier , Str (pitch))
Debug voix
CloseFile ( #fichier )
Else
MessageRequester ( "erreur" , "je ne peux pas sauver les paramêtres" , #PB_MessageRequester_Ok )
End
EndIf
;}***************************
TTSSelect(voix) ; choisi virginie
TTSSpeak( "Au Revoir ." ) ; Speak!
Delay (1000)
TTSEnd() ; Free SAPI resources.
EndIf
End
Procedure MyStopEvent() ; And this will fire when...
SetGadgetText ( #bouton_parle , "Parle" )
EndProcedure
Procedure MyStartEvent() ; This procedure will fire when...
SetGadgetText ( #bouton_parle , "stop" )
EndProcedure
Procedure MyPositionEvent(letter.l) ; This one will fire at...
EndProcedure
Bien, il y a long temps puisque j'ai rendu PureTTS userlibrary. Je pense que vous pouvez effectuer bien mieux un travail employant juste le nouveau PureDispHelper userlibrary et les COM de SAPI. Jetez un coup d'oeil à http://www.purebasic.fr/english/viewtopic.php?t=26744dobro wrote:hello !
@ Esteban1 :
est-ce possible d'avoir le code source
de ta librairie ?
Merci d'avance ..![]()
Esteban1 wrote: Bien, il y a long temps puisque j'ai rendu PureTTS userlibrary. Je pense que vous pouvez effectuer bien mieux un travail employant juste le nouveau PureDispHelper userlibrary et les COM de SAPI. Jetez un coup d'oeil à http://www.purebasic.fr/english/viewtopic.php?t=26744
******************in French :**********************
Merci pour ta réponse

effectivement , PureDispHelper est interressant, mais
c'est dommage , j'aimais bien ta lib, avec la possibilité de tout regler facilement (vitesse de diction,hauteur de diction,choix de la voix ect ...)
et surtout le fait qu'elle soit spécifique a la synthese vocale !!
j'ai peur qu'un jour tu ne mette plus a jour ta librairie ...
j'ai fais moi meme un synthetiseur vocale, et ta librairie, m'a simplifié
beaucoup la vie

*****************************************************
google translate :
PureDispHelper is interressant, but it is a pity, I liked your lib, with the possibility all of regulating easily (speed of diction, height of diction, choice of the voice ect…) and especially the fact that it is specific to the voice synthesis!! I am afraid which one day you does not put up to date any more your librairie… I have make me same a voice synthesizer, and your bookshop, simplified me much life
********************************************************
in span :

Gracias para tu respuesta:D efectivamente, PureDispHelper es interressant, pero c'est daño, j'aimais bien tu lib, con la posibilidad de re fácilmente (velocidad de dicción, altura de dicción, elección con la voz ect...) y sobre todo el hecho qu'elle o sea específico tiene la síntesis vocal!! j'ai miedo qu'un día ti no ponga ya al día tu librería... j'ai me hace mismo me un synthetiseur vocal, y tu librería, m'a simplificado mucho la vida
************************************************************
vraiment dommage les lib c'est mieux quand le source est disponible ..
si Purebasic évolue encore, avons nous l'espoir
que tu fasse la mise a jour dans le futur ?
ton code est Top secret ?
tu compte vendre ta lib ?
je peux m'en passer, mais ce serai cool de partager tes sources non ?
google translate
**************************************************
really damage the lib it is better when the source is available.
if Purebasic still evolves/moves, have us to it hope what you makes the update in the future?
your code is Top secret ?
you want to sell your lib?
I can do some, but they will be cool to share your sources not?
si Purebasic évolue encore, avons nous l'espoir
que tu fasse la mise a jour dans le futur ?
ton code est Top secret ?
tu compte vendre ta lib ?
je peux m'en passer, mais ce serai cool de partager tes sources non ?

google translate
**************************************************
really damage the lib it is better when the source is available.
if Purebasic still evolves/moves, have us to it hope what you makes the update in the future?
your code is Top secret ?
you want to sell your lib?
I can do some, but they will be cool to share your sources not?
