Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Jan 6, 2024
1 parent 9f28b2f commit d6c1874
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/tasks/transcribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class TaskTranscribe extends SttTask {
const opts = this.setChannelVarsForStt(this, this.sttCredentials, this.data.recognizer);
switch (this.vendor) {
case 'google':
bugname = `${this.bugname_prefix}google_transcribe_${channel}`;
bugname = `${this.bugname_prefix}google_transcribe`;
this.addCustomEventListener(ep, GoogleTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep, GoogleTranscriptionEvents.NoAudioDetected,
Expand All @@ -153,7 +153,7 @@ class TaskTranscribe extends SttTask {

case 'aws':
case 'polly':
bugname = `${this.bugname_prefix}aws_transcribe_${channel}`;
bugname = `${this.bugname_prefix}aws_transcribe`;
this.addCustomEventListener(ep, AwsTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep, AwsTranscriptionEvents.NoAudioDetected,
Expand All @@ -162,19 +162,19 @@ class TaskTranscribe extends SttTask {
this._onMaxDurationExceeded.bind(this, cs, ep, channel));
break;
case 'microsoft':
bugname = `${this.bugname_prefix}azure_transcribe_${channel}`;
bugname = `${this.bugname_prefix}azure_transcribe`;
this.addCustomEventListener(ep, AzureTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep, AzureTranscriptionEvents.NoSpeechDetected,
this._onNoAudio.bind(this, cs, ep, channel));
break;
case 'nuance':
bugname = `${this.bugname_prefix}nuance_transcribe_${channel}`;
bugname = `${this.bugname_prefix}nuance_transcribe`;
this.addCustomEventListener(ep, NuanceTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
break;
case 'deepgram':
bugname = `${this.bugname_prefix}deepgram_transcribe_${channel}`;
bugname = `${this.bugname_prefix}deepgram_transcribe`;
this.addCustomEventListener(ep, DeepgramTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep, DeepgramTranscriptionEvents.Connect,
Expand All @@ -187,12 +187,12 @@ class TaskTranscribe extends SttTask {

break;
case 'soniox':
bugname = `${this.bugname_prefix}soniox_transcribe_${channel}`;
bugname = `${this.bugname_prefix}soniox_transcribe`;
this.addCustomEventListener(ep, SonioxTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
break;
case 'cobalt':
bugname = `${this.bugname_prefix}cobalt_transcribe_${channel}`;
bugname = `${this.bugname_prefix}cobalt_transcribe`;
this.addCustomEventListener(ep, CobaltTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));

Expand Down Expand Up @@ -222,7 +222,7 @@ class TaskTranscribe extends SttTask {
break;

case 'ibm':
bugname = `${this.bugname_prefix}ibm_transcribe_${channel}`;
bugname = `${this.bugname_prefix}ibm_transcribe`;
this.addCustomEventListener(ep, IbmTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep, IbmTranscriptionEvents.Connect,
Expand All @@ -232,13 +232,13 @@ class TaskTranscribe extends SttTask {
break;

case 'nvidia':
bugname = `${this.bugname_prefix}nvidia_transcribe_${channel}`;
bugname = `${this.bugname_prefix}nvidia_transcribe`;
this.addCustomEventListener(ep, NvidiaTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
break;

case 'assemblyai':
bugname = `${this.bugname_prefix}assemblyai_transcribe_${channel}`;
bugname = `${this.bugname_prefix}assemblyai_transcribe`;
this.addCustomEventListener(ep, AssemblyAiTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep,
Expand All @@ -250,7 +250,7 @@ class TaskTranscribe extends SttTask {

default:
if (this.vendor.startsWith('custom:')) {
bugname = `${this.bugname_prefix}${this.vendor}_transcribe_${channel}`;
bugname = `${this.bugname_prefix}${this.vendor}_transcribe`;
this.addCustomEventListener(ep, JambonzTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
this.addCustomEventListener(ep, JambonzTranscriptionEvents.Connect, this._onVendorConnect.bind(this, cs, ep));
Expand All @@ -265,7 +265,7 @@ class TaskTranscribe extends SttTask {
}
}
// save dedicated bugname for each endpoint
ep.transcribe_bugname = bugname;
ep.transcribe_bugname = `${bugname}_${Date.now()}`;
/* common handler for all stt engine errors */
this.addCustomEventListener(ep, JambonzTranscriptionEvents.Error, this._onJambonzError.bind(this, cs, ep));
await ep.set(opts)
Expand Down

0 comments on commit d6c1874

Please sign in to comment.