From a9edbdbd26cfc2657ec3eae6d22db8c6c3f42c03 Mon Sep 17 00:00:00 2001 From: EgleH Date: Wed, 16 Nov 2022 16:18:28 +0100 Subject: [PATCH] Add deepgram as STT (#151) * add deepgram as stt * add all languages * remove unused types * temporary remove Flemish * apply review comments Co-authored-by: eglehelms --- .../internal/views/applications/form.tsx | 5 +- .../internal/views/speech-services/form.tsx | 54 ++++---- src/vendor/index.tsx | 8 ++ .../deepgram-speech-recognizer-lang.ts | 126 ++++++++++++++++++ src/vendor/types.ts | 9 +- 5 files changed, 177 insertions(+), 25 deletions(-) create mode 100644 src/vendor/speech-recognizer/deepgram-speech-recognizer-lang.ts diff --git a/src/containers/internal/views/applications/form.tsx b/src/containers/internal/views/applications/form.tsx index 90cd4fb..b60f0de 100644 --- a/src/containers/internal/views/applications/form.tsx +++ b/src/containers/internal/views/applications/form.tsx @@ -19,6 +19,7 @@ import { VENDOR_AWS, VENDOR_WELLSAID, useSpeechVendors, + VENDOR_DEEPGRAM, } from "src/vendor"; import { postApplication, @@ -368,7 +369,9 @@ export const ApplicationForm = ({ application }: ApplicationFormProps) => { id="synthesis_vendor" name="synthesis_vendor" value={synthVendor} - options={vendors} + options={vendors.filter( + (vendor) => vendor.value != VENDOR_DEEPGRAM + )} onChange={(e) => { const vendor = e.target.value as keyof SynthesisVendors; setSynthVendor(vendor); diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index f107067..92215b5 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -24,6 +24,7 @@ import { VENDOR_MICROSOFT, VENDOR_NUANCE, VENDOR_WELLSAID, + VENDOR_DEEPGRAM, } from "src/vendor"; import { MSG_REQUIRED_FIELDS } from "src/constants"; import { getObscuredSecret } from "src/utils"; @@ -137,7 +138,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { access_key_id: vendor === VENDOR_AWS ? accessKeyId : null, secret_access_key: vendor === VENDOR_AWS ? secretAccessKey : null, api_key: - vendor === VENDOR_MICROSOFT || vendor === VENDOR_WELLSAID + vendor === VENDOR_MICROSOFT || + vendor === VENDOR_WELLSAID || + vendor === VENDOR_DEEPGRAM ? apiKey : null, client_id: vendor === VENDOR_NUANCE ? clientId : null, @@ -264,26 +267,30 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { {vendor && (
- - + {vendor !== VENDOR_DEEPGRAM && ( + + )} + {vendor !== VENDOR_WELLSAID && ( + + )}
)} {vendor === VENDOR_GOOGLE && ( @@ -379,8 +386,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { /> )} - {/* Single API key state var is used for both Microsoft and WellSaid */} - {(vendor === VENDOR_MICROSOFT || vendor === VENDOR_WELLSAID) && ( + {(vendor === VENDOR_MICROSOFT || + vendor === VENDOR_WELLSAID || + vendor === VENDOR_DEEPGRAM) && (