diff --git a/src/lib/types/LiveTranscriptionEvent.ts b/src/lib/types/LiveTranscriptionEvent.ts index 31d07ac7..c4f5e534 100644 --- a/src/lib/types/LiveTranscriptionEvent.ts +++ b/src/lib/types/LiveTranscriptionEvent.ts @@ -8,7 +8,7 @@ export interface LiveTranscriptionEvent { channel: { alternatives: { transcript: string; - confidence: boolean; + confidence: number; words: { word: string; start: number; diff --git a/src/lib/types/SyncPrerecordedResponse.ts b/src/lib/types/SyncPrerecordedResponse.ts index be53c667..81d0a6cc 100644 --- a/src/lib/types/SyncPrerecordedResponse.ts +++ b/src/lib/types/SyncPrerecordedResponse.ts @@ -18,6 +18,7 @@ interface Channel { search?: Search[]; alternatives: Alternative[]; detected_language?: string; + language_confidence?: number; } interface Entity { diff --git a/src/packages/LiveClient.ts b/src/packages/LiveClient.ts index ebc1e861..2522e4f1 100644 --- a/src/packages/LiveClient.ts +++ b/src/packages/LiveClient.ts @@ -35,17 +35,6 @@ export class LiveClient extends AbstractWsClient { }; this._socket.onclose = (event: any) => { - /** - * changing the event.target to any to access the private _req - * property that isn't available on the WebSocket.CloseEvent type - **/ - const newTarget: any = event.target; - - if (newTarget["_req"]) { - const dgErrorIndex = newTarget["_req"].res.rawHeaders.indexOf("dg-error"); - event.reason = newTarget["_req"].res.rawHeaders[dgErrorIndex + 1]; - } - this.emit(LiveTranscriptionEvents.Close, event); };