]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5793 @0:05
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 8 Mar 2023 17:01:06 +0000 (18:01 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 8 Mar 2023 17:01:06 +0000 (18:01 +0100)
app/Jobs/FluidbookCompiler.php

index 020acd1dcb3818435a8bd9ff41eb78b03b6cec9e..4890e78d1ac0ac8bef2024d1a281df466eb7f180 100644 (file)
@@ -1573,21 +1573,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
                 $file = $dir . $fname;
 
                 if (!file_exists($file) || filesize($file) === 0) {
-                    if ($engine == 'festival') {
-                        $tmp = Files::tempnam() . '.wav';
-                        $tmptext = Files::tempnam() . '.txt';
-
-                        file_put_contents($tmptext, $text);
-                        $cmd = "text2wave -o $tmp $tmptext -eval \"($voice)\"";
-                        `$cmd`;
-
-                        `lame $tmp $file`;
-                        unlink($tmp);
-                        unlink($tmptext);
-                    } else if ($engine == 'readspeaker') {
-                        $e = explode('/', $voice);
-                        $this->_readSpeaker($text, $e[1], $e[0], $file);
-                    } else if ($engine == 'azuretts') {
+                    if ($engine == 'azuretts') {
                         $e = explode('/', $voice);
                         $this->_azureTTS($text, $e[0], $e[1], $e[2], $file);
                     }
@@ -1615,43 +1601,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         }
     }
 
-    protected function _readSpeaker($text, $language, $voice, $output)
-    {
-        $text_to_read = urlencode($text);
-        // Your API key here
-        $apikey = 'e9c321908f2dd016f6a0c34d2d786aff';
-
-        // File path and file name
-        $filepath = $output;
-
-        // API URL of text-to-speech enabler
-        $api_url = 'https://tts.readspeaker.com/a/speak';
-
-        // Compose API call url
-        $url = $api_url . '?key=' . $apikey . '&streaming=0&lang=' . $language . '&voice=' . $voice . '&text=' . $text_to_read;
-
-        // Initiating curl
-        $ch = curl_init($url);
-
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
-
-        $data = curl_exec($ch);
-
-        $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-
-        if ($status == 200 && !curl_errno($ch)) {
-            // Everything is fine, close curl and save file
-            curl_close($ch);
-            file_put_contents($filepath, $data);
-        } else {
-            // Cannot translate text to speech because of text-to-speech API error
-            error_log(__FILE__ . ': API error while text-to-speech. error code=' . $status);
-            curl_close($ch);
-        }
-
-    }
-
     protected function _writeIndex($page)
     {
         if (!isset($this->seo->pages[$page])) {