🗣️ feat: Edge TTS engine (#3358)

* feat: MS Edge TTS

* feat: Edge TTS; fix: STT hook
This commit is contained in:
Marco Beretta 2024-08-07 20:15:41 +02:00 committed by GitHub
parent 01a88991ab
commit b390ba781f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 379 additions and 129 deletions

View file

@ -1,19 +1,25 @@
import { useRecoilState } from 'recoil';
import store from '~/store';
export enum AudioEndpoints {
export enum STTEndpoints {
browser = 'browser',
external = 'external',
}
export enum TTSEndpoints {
browser = 'browser',
edge = 'edge',
external = 'external',
}
const useGetAudioSettings = () => {
const [engineSTT] = useRecoilState<string>(store.engineSTT);
const [engineTTS] = useRecoilState<string>(store.engineTTS);
const externalSpeechToText = engineSTT === AudioEndpoints.external;
const externalTextToSpeech = engineTTS === AudioEndpoints.external;
const speechToTextEndpoint: STTEndpoints = engineSTT as STTEndpoints;
const textToSpeechEndpoint: TTSEndpoints = engineTTS as TTSEndpoints;
return { externalSpeechToText, externalTextToSpeech };
return { speechToTextEndpoint, textToSpeechEndpoint };
};
export default useGetAudioSettings;