X-Git-Url: https://git.rvb.name/php.git/blobdiff_plain/06edffc2f7f6324b194bebdd527d2fcecdb13364..refs/heads/master:/festival-php/voice_class_inc.php?ds=sidebyside diff --git a/festival-php/voice_class_inc.php b/festival-php/voice_class_inc.php index 5f49c36..b5ef032 100644 --- a/festival-php/voice_class_inc.php +++ b/festival-php/voice_class_inc.php @@ -12,7 +12,15 @@ class voice function text2Wav($string,$lang = "ru") { - print_r($this); + $redis = new Redis(); + $hash =''; + if ($redis->pconnect('127.0.0.1', 6379, 2.5)) { + $hash="voice-".hash("sha256","$lang-$string"); + $result=$redis->get($hash); + if ($result) { + return $result; + } + } if ($this->mode == 'festival') { @@ -48,6 +56,9 @@ class voice } if (!$proc_result) { + if ($hash) { + $redis->set($hash,$data); + } return $data; } else { return '';