$text = str_replace(array_keys($replace), array_values($replace), $text);
$text = CubeIT_Text::cleanUTF8($text, '');
- $voiceInfos = $data['voice'] ?: $this->book->parametres->audiodescriptionVoice;
+ $voiceInfos = $data['voice'] ?? $this->book->parametres->audiodescriptionVoice;
if ($voiceInfos) {
$hash = hash('sha256', $voiceInfos . '_^_' . $text);
$api = new \Cubist\Azure\TTS\Api('28fdfcdcc7f141b29cd9db4afc5779c5');
$api->textToSpeech($text, $locale, $gender, $voiceName, $output);
} catch (Exception $e) {
- dd($e);
+
}
}
if ($ext === 'txt') {
$file = $this->wdir . '/' . $link['to'];
if (file_exists($file)) {
- $this->audioDescriptionTextsList[$link['page']] = file_get_contents($file);
+ $this->audioDescriptionTextsList[$link['page']] = ['text' => file_get_contents($file)];
}
} else {
- $this->config->audiodescription[$link['page']] = $link['to'];
+ $this->config->audiodescription[$link['page']] = ['text' => $link['to']];
$this->copyLinkFile($link['to'], 'data/audiodescription/');
}
}
}
}
- $res=['dir' => $dir, 'fdir' => $fdir];
+ $res = ['dir' => $dir, 'fdir' => $fdir];
return $res;
}