Package com.assemblyai.api
Class RealtimeTranscriber
- java.lang.Object
-
- com.assemblyai.api.RealtimeTranscriber
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class RealtimeTranscriber extends java.lang.Object implements java.lang.AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRealtimeTranscriber.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RealtimeTranscriber.Builderbuilder()voidclose()Closes the websocket connection.voidconfigureEndUtteranceSilenceThreshold(int threshold)Configure the threshold for how long to wait before ending an utterance.voidconnect()Establishes connection with the websocket.voidforceEndUtterance()Manually end an utterancevoidsendAudio(byte[] audio)Stream binary audio datavoidsendAudio(java.lang.String audio)Stream base64 encoded audio data
-
-
-
Method Detail
-
connect
public void connect()
Establishes connection with the websocket. Defaults to a 10s timeout.
-
sendAudio
public void sendAudio(byte[] audio)
Stream binary audio data- Parameters:
audio- byte array audio data
-
sendAudio
public void sendAudio(java.lang.String audio)
Stream base64 encoded audio data- Parameters:
audio- base64 audio data string
-
forceEndUtterance
public void forceEndUtterance()
Manually end an utterance
-
configureEndUtteranceSilenceThreshold
public void configureEndUtteranceSilenceThreshold(int threshold)
Configure the threshold for how long to wait before ending an utterance. Default is 700ms.- Parameters:
threshold- The duration of the end utterance silence threshold in milliseconds
-
close
public void close()
Closes the websocket connection.- Specified by:
closein interfacejava.lang.AutoCloseable
-
builder
public static RealtimeTranscriber.Builder builder()
-
-