mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🎧 fix(TTS): Improve State of audio playback, hook patterns, and fix undefined MediaSource (#3632)
This commit is contained in:
parent
e3ebcfd2b1
commit
dc8d30ad90
6 changed files with 108 additions and 72 deletions
|
|
@ -7,9 +7,12 @@ interface VoiceOption {
|
|||
label: string;
|
||||
}
|
||||
|
||||
function useTextToSpeechBrowser() {
|
||||
function useTextToSpeechBrowser({
|
||||
setIsSpeaking,
|
||||
}: {
|
||||
setIsSpeaking: (isSpeaking: boolean) => void;
|
||||
}) {
|
||||
const [cloudBrowserVoices] = useRecoilState(store.cloudBrowserVoices);
|
||||
const [isSpeaking, setIsSpeaking] = useState(false);
|
||||
const [voiceName] = useRecoilState(store.voice);
|
||||
const [voices, setVoices] = useState<VoiceOption[]>([]);
|
||||
|
||||
|
|
@ -61,7 +64,7 @@ function useTextToSpeechBrowser() {
|
|||
setIsSpeaking(false);
|
||||
};
|
||||
|
||||
return { generateSpeechLocal, cancelSpeechLocal, isSpeaking, voices };
|
||||
return { generateSpeechLocal, cancelSpeechLocal, voices };
|
||||
}
|
||||
|
||||
export default useTextToSpeechBrowser;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue