Ce site web est utilisé par de grosses nationales et multi-nationales donc à mon avis, ne partira pas d'aussi tôt, il est aussi utilisé par un lecteur de donations twitch.tv, je parle là de plusieurs dizaines de streams français.
La synthèse est beaucoup plus naturelle que celles que j'ai pu testé jusqu'à présent, et le nombre de voix utilisable juste ouf ^^
Mais je rejoins jl56 les voix risquent fort de ne plus être en libre accès
En tous cas, pour le moment c'est fun et efficace ! Merci !
voila comment je l'ai personnellement intégré à un de mes projets, comme je n'avais pas besoin d'utiliser plusieurs voix à la fois, j'ai préféré raccourcir l'appel de la fonction ^^
PS: Sorciere et Melodine testez les et essayez de ne pas rire ...
Exemple météo
Exemple tout simple :
Code : Tout sélectionner
global $str = ""
_VoicePlay("Bonjour " & @UserName & ", Il fait beau aujourd'hui, que dirais tu que je te serves un petit coktel ?")
_VoicePlay("Bonjour " & @UserName & ", Il fait pas beau aujourd'hui, que dirais tu que je te serves une petite vodka ?")
Func _VoicePlay($text)
$str &= $text
$text = _VoiceFormat($str)
local $voice = "Moussa" ;Moussa Electra Sorciere Becool Melodine Loic
local $file = @tempdir & "\temp.mp3"
FileDelete($file)
$url = "https://www.voxygen.fr/sites/all/modules/voxygen_voices/assets/proxy/index.php?" & _
"method=redirect&text=" & $text & "&voice=" & $voice
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", $url)
$oHTTP.Send()
$sData = $oHTTP.ResponseBody()
$oHTTP = 0
FileWrite($file, $sData)
SoundPlay($file, 1)
FileDelete($file)
$str = ""
EndFunc
Func _VoiceFormat($str)
Local $a[18][2] = [ _
[" ", "+"], _
["!", "%21"], _
["'", "%27"], _
[",", "%2C"], _
["-", "%2D"], _
[".", "%2E"], _
["?", "%3F"], _
["à", "%C3%A0"], _
["â", "%C3%A2"], _
["ç", "%C3%A7"], _
["è", "%C3%A8"], _
["é", "%C3%A9"], _
["ê", "%C3%AA"], _
["î", "%C3%AE"], _
["ô", "%C3%B4"], _
["ù", "%C3%B9"], _
["û", "%C3%BB"], _
["ü", "%C3%BC"]]
For $i = 0 to 17
$str = StringReplace($str, $a[$i][0], $a[$i][1])
Next
Return $str
EndFunc
Exemple avec météo:
Code : Tout sélectionner
#include <InetConstants.au3>
#include <MsgBoxConstants.au3>
#include <Inet.au3>
#include <String.au3>
#include <IE.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
global $voicestr = ""
_Weather()
Func _VoicePlay($text)
$voicestr &= $text
$text = _VoiceFormat($voicestr)
local $voice = "Moussa" ;Moussa Electra Sorciere Becool Melodine Loic
local $file = @ScriptDir & "\temp.mp3"
FileDelete($file)
$url = "https://www.voxygen.fr/sites/all/modules/voxygen_voices/assets/proxy/index.php?" & _
"method=redirect&text=" & $text & "&voice=" & $voice
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", $url)
$oHTTP.Send()
$sData = $oHTTP.ResponseBody()
$oHTTP = 0
FileWrite($file, $sData)
SoundPlay($file, 1)
FileDelete($file)
$voicestr = ""
EndFunc
Func _VoiceFormat($voicestr)
Local $a[18][2] = [ _
[" ", "+"], _
["!", "%21"], _
["'", "%27"], _
[",", "%2C"], _
["-", "%2D"], _
[".", "%2E"], _
["?", "%3F"], _
["à", "%C3%A0"], _
["â", "%C3%A2"], _
["ç", "%C3%A7"], _
["è", "%C3%A8"], _
["é", "%C3%A9"], _
["ê", "%C3%AA"], _
["î", "%C3%AE"], _
["ô", "%C3%B4"], _
["ù", "%C3%B9"], _
["û", "%C3%BB"], _
["ü", "%C3%BC"]]
For $i = 0 to 17
$voicestr = StringReplace($voicestr, $a[$i][0], $a[$i][1])
Next
Return $voicestr
EndFunc
Func _Weather()
While 1
Local $queryURL = "https://www.google.fr/?gfe_rd=cr&ei=mDZYV5fCOcbEaOmfm6gM#q=meteo"
Local $oIE = _IECreate($queryURL,0,0,1)
Local $obj1 = _IEGetObjById($oIE, "wob_loc")
$city = _IEPropertyGet($obj1,"innertext")
Local $obj2 = _IEGetObjById($oIE, "wob_dc")
$description = _IEPropertyGet($obj2,"innertext")
Local $obj3 = _IEGetObjById($oIE, "wob_tm")
$temp = _IEPropertyGet($obj3,"innertext")
Local $obj4 = _IEGetObjById($oIE, "wob_hm")
$humi = _IEPropertyGet($obj4,"innertext")
Local $obj5 = _IEGetObjById($oIE, "wob_ws")
$vent = _IEPropertyGet($obj5,"innertext")
$ventok = _StringExplode($vent," ", 0)
_IEAction($oIE,"quit")
if $city <> "0" Then
ExitLoop
EndIf
Sleep(1000)
WEnd
_VoicePlay("Le temps est " & $description & ", à " & $city & ", avec une température de " & $temp & "degrés, ainsi qu'une humidité de " & $humi & ", et des vents allant jusqu'à " & $ventok[0] & " kilomètres heure")
EndFunc