To streamline integration with the Riva ASR API, we offer a simple package for seamless interaction within OM1.

Endpoint Access

To minimize latency, the API endpoint utilizes WebSockets for efficient real-time communication.

wss://api-asr.openmind.org?api_key=<YOUR_API_KEY>

Riva ASR Usage

The following example demonstrates how to interact with the Riva ASR API using the OM1 package:

from om1_speech import AudioInputStream

# Initialize the Riva ASR API
ws_client = ws.Client(url="wss://api-asr.openmind.org?api_key=<YOUR_API_KEY>")
audio_stream_input = AudioInputStream(audio_data_callback=ws_client.send_message)

# Start the Riva ASR API
ws_client.start()
audio_stream_input.start()

# Retrieve the Riva ASR API response
ws_client.register_message_callback(lambda msg: print(msg))

while True:
  time.sleep(1)

The expected response from the Riva ASR API will be in the following format:

response
{
  "asr_reply": "hello world"
}

Riva TTS Endpoint

The https://api.openmind.org/api/core/riva/tts endpoint generates speech from text using the Riva Text to Speech (TTS) model.