@@ -91,6 +91,7 @@ public void connect() {
91
91
92
92
/**
93
93
* Stream binary audio data
94
+ *
94
95
* @param audio byte array audio data
95
96
*/
96
97
public void sendAudio (byte [] audio ) {
@@ -99,6 +100,7 @@ public void sendAudio(byte[] audio) {
99
100
100
101
/**
101
102
* Stream base64 encoded audio data
103
+ *
102
104
* @param audio base64 audio data string
103
105
*/
104
106
public void sendAudio (String audio ) {
@@ -144,7 +146,7 @@ public static final class Builder {
144
146
private String apiKey ;
145
147
private Integer sampleRate ;
146
148
private List <String > wordBoost ;
147
- private Optional <Integer > endUtteranceSilenceThreshold ;
149
+ private Optional <Integer > endUtteranceSilenceThreshold = Optional . empty () ;
148
150
private Consumer <SessionBegins > onSessionBegins ;
149
151
private Consumer <PartialTranscript > onPartialTranscript ;
150
152
private Consumer <FinalTranscript > onFinalTranscript ;
@@ -154,6 +156,7 @@ public static final class Builder {
154
156
155
157
/**
156
158
* Sets api key
159
+ *
157
160
* @param apiKey The AssemblyAI API Key
158
161
* @return this
159
162
*/
@@ -164,6 +167,7 @@ public RealtimeTranscriber.Builder apiKey(String apiKey) {
164
167
165
168
/**
166
169
* Sets sample rate
170
+ *
167
171
* @param sampleRate The audio sample rate. Defaults to 16_000
168
172
* @return this
169
173
*/
@@ -174,6 +178,7 @@ public RealtimeTranscriber.Builder sampleRate(int sampleRate) {
174
178
175
179
/**
176
180
* Sets word boost
181
+ *
177
182
* @param wordBoost An array of words to boost
178
183
* @return this
179
184
*/
@@ -184,6 +189,7 @@ public RealtimeTranscriber.Builder wordBoost(List<String> wordBoost) {
184
189
185
190
/**
186
191
* Configure the threshold for how long to wait before ending an utterance. Default is 700ms.
192
+ *
187
193
* @param threshold The duration of the end utterance silence threshold in milliseconds
188
194
* @return this
189
195
*/
@@ -195,6 +201,7 @@ public RealtimeTranscriber.Builder endUtteranceSilenceThreshold(int threshold) {
195
201
196
202
/**
197
203
* Sets onSessionStart
204
+ *
198
205
* @param onSessionStart an event handler for the start event. Defaults to a noop.
199
206
* @return this
200
207
* @deprecated use {@link #onSessionBegins(Consumer)} instead.
@@ -206,6 +213,7 @@ public RealtimeTranscriber.Builder onSessionStart(Consumer<SessionBegins> onSess
206
213
207
214
/**
208
215
* Sets onSessionBegins
216
+ *
209
217
* @param onSessionBegins an event handler for the start event. Defaults to a noop.
210
218
* @return this
211
219
*/
@@ -216,6 +224,7 @@ public RealtimeTranscriber.Builder onSessionBegins(Consumer<SessionBegins> onSes
216
224
217
225
/**
218
226
* Sets onPartialTranscript
227
+ *
219
228
* @param onPartialTranscript an event handler for the partial transcript event. Defaults to a noop.
220
229
* @return this
221
230
*/
@@ -226,6 +235,7 @@ public RealtimeTranscriber.Builder onPartialTranscript(Consumer<PartialTranscrip
226
235
227
236
/**
228
237
* Sets onPartialTranscript
238
+ *
229
239
* @param onFinalTranscript an event handler for the final transcript event. Defaults to a noop.
230
240
* @return this
231
241
*/
@@ -236,6 +246,7 @@ public RealtimeTranscriber.Builder onFinalTranscript(Consumer<FinalTranscript> o
236
246
237
247
/**
238
248
* Sets onTranscript
249
+ *
239
250
* @param onTranscript an event handler for any transcript event (partial or final). Defaults to a noop.
240
251
* @return this
241
252
*/
@@ -246,6 +257,7 @@ public RealtimeTranscriber.Builder onTranscript(Consumer<RealtimeTranscript> onT
246
257
247
258
/**
248
259
* Sets onError
260
+ *
249
261
* @param onError an event handler for an error event. Defaults to a noop.
250
262
* @return this
251
263
*/
@@ -256,6 +268,7 @@ public RealtimeTranscriber.Builder onError(Consumer<Throwable> onError) {
256
268
257
269
/**
258
270
* Sets onClose
271
+ *
259
272
* @param onClose an event handler for the closing event. Defaults to a noop.
260
273
* @return this
261
274
*/
0 commit comments