Skip to content

Commit

Permalink
follow the rabbit to fix potential issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dakai committed Oct 13, 2024
1 parent bcd50b8 commit 67192a7
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions app/components/tts-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export function TTSConfigList(props: {
ttsPlayer.stop();
setSpeechStatus(false);
} else {
var api: ClientApi;
api = new ClientApi(ModelProvider.GPT);
const api = new ClientApi(ModelProvider.GPT);
const config = useAppConfig.getState();
setSpeechLoading(true);
ttsPlayer.init();
Expand Down Expand Up @@ -141,23 +140,25 @@ export function TTSConfigList(props: {
: Locale.Chat.Actions.Speech
}
onClick={() => {
speechStatus
? (ttsPlayer.stop(), setSpeechStatus(false))
: openaiSpeech(
"NextChat,Unleash your imagination, experience the future of AI conversation.",
);
if (speechStatus) {
ttsPlayer.stop();
setSpeechStatus(false);
} else {
openaiSpeech(
"NextChat,Unleash your imagination, experience the future of AI conversation.",
);
}
}}
/>

<Select
value={props.ttsConfig.voice}
onChange={(e) => {
props.updateConfig(
(config) =>
(config.voice = TTSConfigValidator.voice(
e.currentTarget.value,
)),
);
props.updateConfig((config) => {
config.voice = TTSConfigValidator.voice(
e.currentTarget.value,
);
});
}}
>
{DEFAULT_TTS_VOICES.map((v, i) => (
Expand Down

0 comments on commit 67192a7

Please sign in to comment.