Learn how to transcribe streaming audio in Java.
YOUR_API_KEY
with your copied API key.sample_rate
is the number of audio samples per second, measured in hertz (Hz). Higher sample rates result in higher quality audio, which may lead to better transcripts, but also more data being sent over the network.We recommend the following sample rates:8_000
(8 kHz)16_000
(16 kHz)48_000
(48 kHz)pcm_s16le
(PCM signed 16-bit little-endian) encoded, with a sample rate of 16_000
. The sample rate needs to be the same value as you configured on the real-time transcriber.interrupted()
method returns true
when the current thread is interrupted. In this example, you will use it to stop the transcriber and recording when the user presses the ENTER
key.