public function textToSpeech($text, $locale, $gender, $voiceName, $saveToFile)
{
- if (stristr('|', $locale)) {
+ if (stristr($locale, '|')) {
$e = explode('|', $locale);
$locale = $e[1];
}
$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',