]> _ Git - cubist_azuretts.git/commitdiff
wip #7977 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 5 Feb 2026 16:12:35 +0000 (17:12 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 5 Feb 2026 16:12:35 +0000 (17:12 +0100)
src/Api.php

index f3fb96583b9315d5278867ae0e5096c66f2af04f..2ab6902a4b72d90a9e4ada14de32552116da912f 100644 (file)
@@ -45,7 +45,7 @@ class Api
 
     public function textToSpeech($text, $locale, $gender, $voiceName, $saveToFile)
     {
-        if (stristr('|', $locale)) {
+        if (stristr($locale, '|')) {
             $e = explode('|', $locale);
             $locale = $e[1];
         }
@@ -55,7 +55,7 @@ class Api
         $ssml .= htmlspecialchars($text, ENT_XML1 | ENT_SUBSTITUTE | ENT_QUOTES);
         $ssml .= "</voice></speak>";
 
-        Log::info('TTS ' . mb_strlen($text) . ' chars // ' . $locale . ' // ' . $gender . ' // ' . $voiceName . ' :: ' . $ssml);
+        Log::info('TTS ' . mb_strlen($text) . ' chars // ' . $locale . ' // ' . $gender . ' // ' . $voiceName . ' :: ' . htmlspecialchars($ssml));
 
         $this->_call('/v1', 'post', [
             'X-Microsoft-OutputFormat' => 'audio-48khz-192kbitrate-mono-mp3',