mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-04 19:21:58 +00:00
fix stt/tts regoin on wrong position (#380)
* fix stt/tts regoin on wrong position * wip * fix speech credentials does not choose default model * fix speech credentials does not choose default model
This commit is contained in:
@@ -287,7 +287,8 @@ export const Player = ({ call }: PlayerProps) => {
|
||||
const buildWavesurferRegion = () => {
|
||||
if (jaegerRoot) {
|
||||
const spans = getSpansFromJaegerRoot(jaegerRoot);
|
||||
const startPoint = spans[0];
|
||||
const start = getSpansByNameRegex(spans, /background-record:listen/);
|
||||
const startPoint = start ? start[0] : null;
|
||||
// there should be only one startPoint for background listen
|
||||
if (startPoint) {
|
||||
const gatherSpans = getSpansByNameRegex(spans, /:gather{/);
|
||||
|
||||
@@ -375,6 +375,12 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
||||
).then(({ json }) => {
|
||||
if (json.models) {
|
||||
setTtsModels(json.models);
|
||||
if (
|
||||
json.models.length > 0 &&
|
||||
(vendor === VENDOR_ELEVENLABS || vendor === VENDOR_WHISPER)
|
||||
) {
|
||||
setTtsModelId(json.models[0].value);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -597,13 +603,6 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
||||
setRegion("");
|
||||
setApiKey("");
|
||||
setGoogleServiceKey(null);
|
||||
if (
|
||||
ttsModels.length > 0 &&
|
||||
(e.target.value === VENDOR_ELEVENLABS ||
|
||||
e.target.value === VENDOR_WHISPER)
|
||||
) {
|
||||
setTtsModelId(ttsModels[0].value);
|
||||
}
|
||||
}}
|
||||
disabled={credential ? true : false}
|
||||
required
|
||||
|
||||
Reference in New Issue
Block a user