Skip to content

Commit

Permalink
Performance for json requests, next->continue
Browse files Browse the repository at this point in the history
- Increases performance for json requests by not loading alsa stuff
- Fix splitsentence caching (used Perl 'next' instead of PHP 'continue')
  • Loading branch information
christianTF committed Nov 5, 2018
1 parent c09c98c commit 9597b1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webfrontend/html/tts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -151,6 +155,8 @@
exit;
}
switch ($soundcard) {
case 'json':
break;
case '001': // NULL
exit;
break;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 9597b1a

Please sign in to comment.