Starting an Oracle Radio WebSocket Audio Transmission

Send a START message after receiving a talk token to begin an audio transmission.

Permissions and Prerequisites

The WebSocket contract accepts PCM, Opus, AAC, and AMR. The supplied Radio browser application transmits and plays only PCM and Opus. AAC and AMR require a client with the appropriate codec; API acceptance doesn't make a format playable in the browser.

RequirementValue
AuthenticationComplete the supported authentication path for the client before sending this operation. See authentication.
Radio permissionradio.audio.transmit
Channel accessThe user must have talk access to the connection's active channel. The service validates the token and active channel when processing START.
Session stateThe WebSocket connection must be open. First send REQUEST_TALK and receive GRANTED. Use only the talk token granted to the authenticated user, and don't transfer it to another user or client.

Request

Send the START message as a JSON text message. The service validates the supplied token for the connection's active channel.

NameData typeRequiredDefaultConstraintsDescription
typestringYesNoneMust be START.Identifies the start-transmission operation.
tokenstringYesNoneUUID.Valid talk token for the channel.
timestampstringNoNoneISO 8601 date and time.Client-side transmission start time.
formatstringNopcmpcm, opus, aac, or amr.Audio codec format.
sampleRateintegerNo8000Integer value in hertz.Audio sample rate.
channelsintegerNo11 for mono or 2 for stereo.Number of audio channels.
bitrateintegerNo16000Integer value in bits per second.Audio bitrate.
frameSizeintegerNo20Integer value in milliseconds.Audio frame duration.
Note

Encode every binary audio packet by using the values declared in START. Don't change the audio settings during an active transmission.
{
  "type": "START",
  "token": "550e8400-e29b-41d4-a716-446655440000",
  "timestamp": "2024-01-15T10:30:00Z",
  "format": "opus",
  "sampleRate": 8000,
  "channels": 1,
  "bitrate": 16000,
  "frameSize": 20
}

Responses

The following table lists the messages the client can receive and explains their purpose.

Message typeKindDescription
TRANSMISSION_STARTAsynchronous eventNotifies other subscribed connections that audio transmission started and provides the audio settings needed for decoding.
ERRORDirect errorIndicates missing or invalid token, missing Radio permission, denied channel access, or another failure to start.
INTERRUPTEDAsynchronous eventIndicates that another user took the talk floor. Stop sending binary audio.
TOKEN_EXPIREDAsynchronous eventIndicates that the talk token expired. Stop sending binary audio.
TRANSMISSION_TIMEOUTAsynchronous eventIndicates that the transmission exceeded its allowed duration and the token was automatically released.
Note

The initiating session doesn't receive TRANSMISSION_START. After the WebSocket client reports that it successfully sent START, begin sending binary audio messages. If the service sends ERROR, stop sending audio.

TRANSMISSION_START Event for Other Subscribers

The following table describes the event properties, their data types, and whether they are required.

NameData typeRequiredDescription
typestringYesEvent type. The value is TRANSMISSION_START.
channelstringYesChannel receiving the audio transmission.
userstringYesUser transmitting the audio.
senderDisplayNamestringNoDisplay name of the sender.
priorityintegerNoPriority of the talk token.
timestampstringNoTransmission start date and time in ISO 8601 format.
formatstringNoAudio codec format.
sampleRateintegerNoAudio sample rate in hertz.
channelsintegerNoNumber of audio channels.
bitrateintegerNoAudio bitrate in bits per second.
frameSizeintegerNoAudio frame duration in milliseconds.
{
  "type": "TRANSMISSION_START",
  "channel": "operations",
  "user": "dispatcher1",
  "senderDisplayName": "Dispatcher One",
  "priority": 50,
  "timestamp": "2024-01-15T10:30:00Z",
  "format": "opus",
  "sampleRate": 8000,
  "channels": 1,
  "bitrate": 16000,
  "frameSize": 20
}