Skip to content

Commit

Permalink
fix(transcription): Fix invalid language and provider messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lfzawacki committed May 17, 2024
1 parent a7e9a5a commit 547f516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ bbbGW.on('UserSpeechLocaleChangedEvtMsg', (header, payload) => {
const { meetingId, userId } = header;
const { provider, locale } = payload;

if (!['gladia', 'vosk'].includes(provider)) {
Logger.warn("Speech not changed, invalid provider " + userId + ' ' + provider + ' ' + locale);
return;
}

Logger.info("Speech changed " + userId + ' ' + provider + ' ' + locale);

setProvider(userId, provider, () => {
Expand Down Expand Up @@ -236,7 +241,7 @@ const startAudioFork = (channelId, userId) => {

if (provider === 'gladia') {
initialMessage.sample_rate = parseInt(SAMPLE_RATE + '000')
initialMessage.language = language.slice(0,2);
initialMessage.language = language == 'auto' ? language : language.slice(0,2);
initialMessage.partialUtterances = partialUtterances;
initialMessage.minUtteranceLength = minUtteranceLength;
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 547f516

Please sign in to comment.