Skip to content

Commit

Permalink
Merge pull request #99 from deepgram/toggle-numerals-mid-stream
Browse files Browse the repository at this point in the history
Added toggleNumerals function
  • Loading branch information
briancbarrow authored Jan 31, 2023
2 parents 5aa33c8 + 3eecacf commit 4967b17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/transcription/liveTranscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import EventEmitter from "events";
import querystring from "querystring";
import WebSocket from "ws";
import { ConnectionState, LiveTranscriptionEvents } from "../enums";
import { LiveTranscriptionOptions } from "../types";
import { LiveTranscriptionOptions, ToggleConfigOptions } from "../types";
import { userAgent } from "../userAgent";

export class LiveTranscription extends EventEmitter {
Expand Down Expand Up @@ -48,6 +48,15 @@ export class LiveTranscription extends EventEmitter {
};
}

public configure(config: ToggleConfigOptions): void {
this._socket.send(
JSON.stringify({
type: "Configure",
processors: config,
})
);
}

/**
* Returns the ready state of the websocket connection
*/
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export * from "./scopeList";
export * from "./search";
export * from "./sentence";
export * from "./summary";
export * from "./toggleConfigOptions";
export * from "./topic";
export * from "./topicGroup";
export * from "./transcriptionSource";
Expand Down
3 changes: 3 additions & 0 deletions src/types/toggleConfigOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type ToggleConfigOptions = {
numerals: boolean;
};

0 comments on commit 4967b17

Please sign in to comment.