refac: rename voice to audio

This commit is contained in:
Timothy J. Baek 2024-02-11 02:21:06 -08:00
parent 2ef4fc1215
commit 3ce8e8a2ae
3 changed files with 14 additions and 14 deletions

View file

@ -148,7 +148,7 @@
} else {
speaking = true;
if ($settings?.voice?.TTSEngine === 'openai') {
if ($settings?.audio?.TTSEngine === 'openai') {
loadingSpeech = true;
const sentences = extractSentences(message.content).reduce((mergedTexts, currentText) => {
@ -179,7 +179,7 @@
for (const [idx, sentence] of sentences.entries()) {
const res = await synthesizeOpenAISpeech(
localStorage.token,
$settings?.voice?.speaker,
$settings?.audio?.speaker,
sentence
).catch((error) => {
toast.error(error);
@ -204,7 +204,7 @@
clearInterval(getVoicesLoop);
const voice =
voices?.filter((v) => v.name === $settings?.voice?.speaker)?.at(0) ?? undefined;
voices?.filter((v) => v.name === $settings?.audio?.speaker)?.at(0) ?? undefined;
const speak = new SpeechSynthesisUtterance(message.content);