Skip to content

Commit 7dfb457

Browse files
authored
Merge pull request #36 from AssemblyAI/E07417BDFEA3614F5967B1520F8B2F61
Sync from internal repo (2024/02/16)
2 parents 5705bfe + 35cec7c commit 7dfb457

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "assemblyai",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"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.",
55
"engines": {
66
"node": ">=18"

src/services/realtime/service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class RealtimeTranscriber {
4848
private encoding?: AudioEncoding;
4949
private apiKey?: string;
5050
private token?: string;
51-
private end_utterance_silence_threshold?: number;
51+
private endUtteranceSilenceThreshold?: number;
5252
private socket?: WebSocket;
5353
private listeners: RealtimeListeners = {};
5454
private sessionTerminatedResolve?: () => void;
@@ -58,8 +58,8 @@ export class RealtimeTranscriber {
5858
this.sampleRate = params.sampleRate ?? 16_000;
5959
this.wordBoost = params.wordBoost;
6060
this.encoding = params.encoding;
61-
this.end_utterance_silence_threshold =
62-
params.end_utterance_silence_threshold;
61+
this.endUtteranceSilenceThreshold =
62+
params.endUtteranceSilenceThreshold;
6363
if ("token" in params && params.token) this.token = params.token;
6464
if ("apiKey" in params && params.apiKey) this.apiKey = params.apiKey;
6565

@@ -130,13 +130,13 @@ export class RealtimeTranscriber {
130130

131131
this.socket.onopen = () => {
132132
if (
133-
this.end_utterance_silence_threshold === undefined ||
134-
this.end_utterance_silence_threshold === null
133+
this.endUtteranceSilenceThreshold === undefined ||
134+
this.endUtteranceSilenceThreshold === null
135135
) {
136136
return;
137137
}
138138
this.configureEndUtteranceSilenceThreshold(
139-
this.end_utterance_silence_threshold
139+
this.endUtteranceSilenceThreshold
140140
);
141141
};
142142

src/types/realtime/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type CreateRealtimeTranscriberParams = {
2626
/**
2727
* The duration of the end utterance silence threshold in milliseconds
2828
*/
29-
end_utterance_silence_threshold?: number;
29+
endUtteranceSilenceThreshold?: number;
3030
} & (
3131
| {
3232
/**
@@ -68,7 +68,7 @@ type RealtimeTranscriberParams = {
6868
/**
6969
* The duration of the end utterance silence threshold in milliseconds
7070
*/
71-
end_utterance_silence_threshold?: number;
71+
endUtteranceSilenceThreshold?: number;
7272
} & (
7373
| {
7474
/**

tests/realtime.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe("realtime", () => {
162162
const rt = aai.realtime.transcriber({
163163
realtimeUrl,
164164
apiKey: "123",
165-
end_utterance_silence_threshold: 500,
165+
endUtteranceSilenceThreshold: 500,
166166
});
167167
await connect(rt, server);
168168
await expect(server).toReceiveMessage(

0 commit comments

Comments
 (0)