Skip to content

Commit

Permalink
feat: add utteranceend event in latest format
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeocodes committed Jan 24, 2024
1 parent e5417da commit 47debed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/types/UtteranceEndEvent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export interface LiveTranscriptionEvent {
type: "UtteranceEnd";
channel: number[];
last_word_end: number;
}
4 changes: 4 additions & 0 deletions src/packages/LiveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export class LiveClient extends AbstractWsClient {
if (data.type === LiveTranscriptionEvents.Transcript) {
this.emit(LiveTranscriptionEvents.Transcript, data as LiveTranscriptionEvent);
}

if (data.type === LiveTranscriptionEvents.UtteranceEnd) {
this.emit(LiveTranscriptionEvents.UtteranceEnd, data as LiveTranscriptionEvent);
}
} catch (error) {
this.emit(LiveTranscriptionEvents.Error, {
event,
Expand Down

0 comments on commit 47debed

Please sign in to comment.