From 9597b1a408a3bcf90a2c57cbda118f2f782117df Mon Sep 17 00:00:00 2001 From: Christian Fenzl Date: Mon, 5 Nov 2018 14:06:57 +0100 Subject: [PATCH] Performance for json requests, next->continue - Increases performance for json requests by not loading alsa stuff - Fix splitsentence caching (used Perl 'next' instead of PHP 'continue') --- webfrontend/html/tts.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webfrontend/html/tts.php b/webfrontend/html/tts.php index 35524cb..e81f902 100644 --- a/webfrontend/html/tts.php +++ b/webfrontend/html/tts.php @@ -90,6 +90,10 @@ $t2s_langfile = "t2s-text_".substr($config['TTS']['messageLang'],0,2).".ini"; // language file for text-speech LOGGING("All variables has been collected",6); $soundcard = $config['SYSTEM']['card']; + if(isset($_GET['json'])) { + $soundcard = 'json'; + } + # prüfen ob Volume in syntax, wenn nicht Std. von Config if (!isset($_GET["volume"])) { $volume = $config['TTS']['volume']; @@ -151,6 +155,8 @@ exit; } switch ($soundcard) { + case 'json': + break; case '001': // NULL exit; break; @@ -467,7 +473,7 @@ function create_tts() { LOGGING("Expected filename: $resultmp3", 7); if(file_exists($resultmp3) && empty($_GET['nocache'])) { LOGGING("Text in cache: $text", 6); - next; + continue; } LOGGING("T2S will be called with '$text'", 7);