Initiate Stream
Initiating a stream creates a bidirectional socket from the client and the Marsview Server. The client will stream Audio data in real-time to the Marsview service endpoint, The Marsview server will send Model Outputs and Transcript back to the client on the same socket connection.
Initiate Stream code in Node.js
The example code below uses socket.io to stream data to and from the Marsview Server.
The above connection is used to establish a websocket connection with the Marsview Realtime API endpoint. When once the connection is established we can user the io_client
object to stream data to and from the Marsview Realtime API endpoint. The websocket call made to startStream
is used to open up an end point that can receive the audio input from the client side.
The input data fed into the stream from the client side will be byte data/byte array the client receives from various sources. The input byte array can be streamed to Marsview using the websocket key binaryData .
Code Block for emitting byte array
This code block would be plugged into a streaming data input. Each time a byte array comes into the client side code this line of code has to be executed. Heredata
is the byte array.
Last updated