mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
* WIP: message audio refactor * WIP: use MessageAudio by provider * fix: Update MessageAudio component to use TTSEndpoints enum * feat: Update useTextToSpeechBrowser hook to handle errors and improve error logging * feat: Add voice dropdown components for different TTS engines * docs: update incorrect `voices` example changed `voice: ''` to `voices: ['alloy']` * feat: Add brwoser support check for Edge TTS engine component with error toast if not supported --------- Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
18 lines
521 B
TypeScript
18 lines
521 B
TypeScript
import { useMemo } from 'react';
|
|
import { useRecoilValue } from 'recoil';
|
|
import store from '~/store';
|
|
|
|
const useGetAudioSettings = () => {
|
|
const engineSTT = useRecoilValue<string>(store.engineSTT);
|
|
const engineTTS = useRecoilValue<string>(store.engineTTS);
|
|
|
|
const speechToTextEndpoint = engineSTT;
|
|
const textToSpeechEndpoint = engineTTS;
|
|
|
|
return useMemo(
|
|
() => ({ speechToTextEndpoint, textToSpeechEndpoint }),
|
|
[speechToTextEndpoint, textToSpeechEndpoint],
|
|
);
|
|
};
|
|
|
|
export default useGetAudioSettings;
|