Skip to content

Commit

Permalink
Merge pull request #36 from AssemblyAI/E07417BDFEA3614F5967B1520F8B2F61
Browse files Browse the repository at this point in the history
Sync from internal repo (2024/02/16)
  • Loading branch information
Swimburger authored Feb 16, 2024
2 parents 5705bfe + 35cec7c commit 7dfb457
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assemblyai",
"version": "4.3.0",
"version": "4.3.1",
"description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.",
"engines": {
"node": ">=18"
Expand Down
12 changes: 6 additions & 6 deletions src/services/realtime/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class RealtimeTranscriber {
private encoding?: AudioEncoding;
private apiKey?: string;
private token?: string;
private end_utterance_silence_threshold?: number;
private endUtteranceSilenceThreshold?: number;
private socket?: WebSocket;
private listeners: RealtimeListeners = {};
private sessionTerminatedResolve?: () => void;
Expand All @@ -58,8 +58,8 @@ export class RealtimeTranscriber {
this.sampleRate = params.sampleRate ?? 16_000;
this.wordBoost = params.wordBoost;
this.encoding = params.encoding;
this.end_utterance_silence_threshold =
params.end_utterance_silence_threshold;
this.endUtteranceSilenceThreshold =
params.endUtteranceSilenceThreshold;
if ("token" in params && params.token) this.token = params.token;
if ("apiKey" in params && params.apiKey) this.apiKey = params.apiKey;

Expand Down Expand Up @@ -130,13 +130,13 @@ export class RealtimeTranscriber {

this.socket.onopen = () => {
if (
this.end_utterance_silence_threshold === undefined ||
this.end_utterance_silence_threshold === null
this.endUtteranceSilenceThreshold === undefined ||
this.endUtteranceSilenceThreshold === null
) {
return;
}
this.configureEndUtteranceSilenceThreshold(
this.end_utterance_silence_threshold
this.endUtteranceSilenceThreshold
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/types/realtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type CreateRealtimeTranscriberParams = {
/**
* The duration of the end utterance silence threshold in milliseconds
*/
end_utterance_silence_threshold?: number;
endUtteranceSilenceThreshold?: number;
} & (
| {
/**
Expand Down Expand Up @@ -68,7 +68,7 @@ type RealtimeTranscriberParams = {
/**
* The duration of the end utterance silence threshold in milliseconds
*/
end_utterance_silence_threshold?: number;
endUtteranceSilenceThreshold?: number;
} & (
| {
/**
Expand Down
2 changes: 1 addition & 1 deletion tests/realtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe("realtime", () => {
const rt = aai.realtime.transcriber({
realtimeUrl,
apiKey: "123",
end_utterance_silence_threshold: 500,
endUtteranceSilenceThreshold: 500,
});
await connect(rt, server);
await expect(server).toReceiveMessage(
Expand Down

0 comments on commit 7dfb457

Please sign in to comment.