Skip to main content

AOQ Client SDK iOS API reference

AOQ Client SDK iOS API reference, covering engine lifecycle, audio/video device management, codec configuration, media stream control, audio file playback, external audio streams, real-time messaging, frame callbacks, delegate protocols, and data types and enumerations.

API index

Engine lifecycle

APIDescription
createEngineCreate an engine instance (singleton)
destroyDestroy the engine instance
getVersionGet the SDK version
connectConnect to the Relay server
disconnectDisconnect from the server

Audio device management

APIDescription
startAudioCaptureOpen the audio capture device (microphone)
stopAudioCaptureClose the audio capture device
muteAudioCaptureMute or unmute audio capture
startAudioPlayerStart audio rendering (remote audio playback)
stopAudioPlayerStop audio rendering
pauseAudioPlayerPause audio rendering, with optional fade-out
resumeAudioPlayerResume audio rendering, with optional fade-in
interruptAudioPlayerInterrupt the current audio session
enableSpeakerphoneSwitch audio output between the speaker and earpiece
isSpeakerphoneEnabledCheck whether audio output uses the speaker
setAudioSessionRestrictionSet AVAudioSession control permissions (iOS only)

Audio encoding configuration

APIDescription
setAudioEncoderConfigSet audio encoding parameters
setAudioDecoderConfigSet audio decoding parameters

Audio file playback

APIDescription
startAudioFileStart playing and publishing a local audio file
stopAudioFileStop audio file playback
pauseAudioFilePause audio file playback
resumeAudioFileResume audio file playback
getAudioFileDurationGet the total duration of the audio file
getAudioFileCurrentPositionGet the current playback position of the audio file
setAudioFilePositionMillisSeek to a position in the audio file
setAudioFileVolumeSet the audio file volume
getAudioFileVolumeGet the current audio file volume

External audio streams

APIDescription
addAudioExternalStreamAdd an external audio stream
pushAudioExternalStreamDataPush external PCM audio data
setAudioExternalStreamVolumeSet the external audio stream volume
getAudioExternalStreamVolumeGet the external audio stream volume
clearAudioExternalStreamBufferClear the external audio stream buffer
removeAudioExternalStreamRemove an external audio stream

Audio frame callbacks

APIDescription
setAudioFrameObserverSet the audio frame callback delegate
enableAudioFrameObserverEnable or disable audio frame callbacks at a specified stage

Local audio volume indication

APIDescription
enableLocalAudioVolumeIndicationEnable or disable local capture volume indication

Video device management

APIDescription
startVideoCaptureOpen the video capture device (camera)
stopVideoCaptureClose the video capture device
switchCameraSwitch between front and rear cameras
setLocalViewSet or remove the local video rendering window
setRemoteViewSet or remove the remote video rendering window

Video encoding and external input

APIDescription
setVideoEncoderConfigSet video encoding parameters
setVideoDecoderConfigSet video decoding parameters
pushExternalVideoCapturedFramePush externally captured video frames
pushExternalVideoEncodedFramePush externally encoded video frames

Screen capture

APIDescription
startScreenCaptureStart screen capture (Broadcast Upload Extension)
stopScreenCaptureStop screen capture

Media stream transmission control

APIDescription
enableSendMediaStreamEnable or disable local media stream transmission

Video frame callbacks

APIDescription
setVideoFrameObserverSet the video frame callback delegate
enableVideoFrameObserverEnable or disable video frame callbacks at a specified stage

Real-time messages

APIDescription
sendDataMsgSend a real-time data message

AoqEngineDelegate callbacks

APIDescription
onErrorEngine error callback
onWarningEngine warning callback
onConnectionStatusChangeConnection status change callback
onStatsEngine statistics callback
onAudioDeviceStateChangedAudio device operation status change callback
onAudioDeviceRouteChangedAudio output route change callback
onAudioDeviceInterruptedAudio device interruption callback
onAudioFileStateAudio file playback status callback
onLocalAudioVolumeIndicationLocal capture volume indication callback
onVideoDeviceStateChangedVideo device operation status change callback
onDataMsgReceived real-time data message callback
onScreenCaptureStateChangedScreen capture status change callback (@optional)

AoqAudioFrameDelegate callbacks

APIDescription
onCapturedAudioFrameCalled when a raw audio frame is captured. The frame contains unprocessed PCM data.
onProcessCapturedAudioFrameCalled for an audio frame after 3A processing, such as echo cancellation and noise suppression.
onPublishAudioFrameCalled for an audio frame before publishing, immediately before encoding and transmission.
onPlaybackAudioFrameCalled for a remote audio frame before playback, after decoding and mixing.

AoqVideoFrameDelegate callbacks

APIDescription
onCapturedVideoFrameCalled when a raw video frame is captured, before preprocessing.
onPreEncodeVideoFrameCalled for a video frame after preprocessing and before encoding.
onRemoteVideoFrameCalled for a remote video frame after decoding and before rendering.

API details

Engine lifecycle

createEngine:delegate:

Creates the engine instance. The SDK holds a global singleton; repeated calls return the existing instance.
+ (instancetype _Nonnull)createEngine:(AoqCreateConfig * _Nonnull)config
                             delegate:(id<AoqEngineDelegate> _Nonnull)delegate;
ParameterTypeDescription
configAoqCreateConfig *Engine creation configuration
delegateid<AoqEngineDelegate>Engine event delegate
Return value: An AoqClientEngine instance. Never nil.

destroy

Destroys the engine instance and releases all resources. Call createEngine: again before using the SDK after destruction.
+ (int)destroy;
Parameters: None. Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

getVersion

Gets the current SDK version. Can be called before createEngine:.
+ (NSString * _Nonnull)getVersion;
Parameters: None. Return value: A version string, such as "1.3.0".

connect:

Connects to the Relay server. The application's AppServer allocates connection parameters through /api/v1/allocate and sends them to the client. This method returns immediately. The connection result is reported through onConnectionStatusChange:.
- (int)connect:(AoqConnectConfig * _Nonnull)config;
ParameterTypeDescription
configAoqConnectConfig *Connection configuration, including Token, SID, Relay endpoints, and publishing/subscription tracks
Return value: 0 indicates that the call has been dispatched for asynchronous execution. A nonzero value indicates parameter validation failure and corresponds to AoqErrorCode.
The Screen track supports upstream transmission only; downstream subscription is not implemented. Do not include AoqTrackTypeScreen in config.subscribeTracks. Otherwise, AoqECUnSupport is returned and no connection is initiated. Do not enable sending with enableSendMediaStream:enable:YES before the connection succeeds. Enable it after onConnectionStatusChange: reports Connected.

disconnect

Disconnects from the server and releases connection resources. Returns immediately. The disconnection result is reported through onConnectionStatusChange:.
- (int)disconnect;
Parameters: None. Return value: 0 indicates that the call has been dispatched for asynchronous execution. A nonzero value indicates failure and corresponds to AoqErrorCode.

Audio device management

startAudioCapture:

Opens the audio capture device (microphone) and starts capturing local audio. For external audio input (pushAudioExternalStreamData:data:), set isExternal to YES. In this mode, the microphone is not opened.
- (int)startAudioCapture:(AoqAudioCaptureConfig * _Nonnull)config;
ParameterTypeDescription
configAoqAudioCaptureConfig *Audio capture configuration
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode. For example, AoqECAudioDeviceRecordingAuthFailed indicates that recording permission has not been granted.
Configure NSMicrophoneUsageDescription in Info.plist and obtain recording permission. Device state changes are reported through onAudioDeviceStateChanged:.

stopAudioCapture

Closes the audio capture device and stops local audio capture.
- (int)stopAudioCapture;
Parameters: None. Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

muteAudioCapture:

Mutes or unmutes audio capture. Unlike stopAudioCapture, muting keeps capture running but sends silent frames.
- (int)muteAudioCapture:(BOOL)mute;
ParameterTypeDescription
muteBOOLYES mutes capture; NO unmutes it.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
This method takes effect only after startAudioCapture: is called.

startAudioPlayer:

Starts audio rendering and plays remote audio through the speaker or earpiece. For external rendering (playing PCM yourself), set isExternal to YES.
- (int)startAudioPlayer:(AoqAudioPlaybackConfig * _Nonnull)config;
ParameterTypeDescription
configAoqAudioPlaybackConfig *Audio playback configuration
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode. For example, AoqECAudioDevicePlayoutOccupied indicates that the playback device is occupied.
Device state changes are reported through onAudioDeviceStateChanged:. Output route changes are reported through onAudioDeviceRouteChanged:.

stopAudioPlayer

Stops audio rendering and closes the playback device.
- (int)stopAudioPlayer;
Parameters: None. Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

pauseAudioPlayer:

Pauses audio rendering with optional fade-out. Remote audio data continues to arrive while paused but is not played.
- (int)pauseAudioPlayer:(NSInteger)fadeMs;
ParameterTypeDescription
fadeMsNSIntegerFade-out duration in milliseconds. 0 pauses playback immediately.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

resumeAudioPlayer:

Resumes audio rendering with optional fade-in. Call this method after pauseAudioPlayer:.
- (int)resumeAudioPlayer:(NSInteger)fadeMs;
ParameterTypeDescription
fadeMsNSIntegerFade-in duration in milliseconds. 0 resumes playback immediately.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

interruptAudioPlayer:fadeMs:

Interrupts the current audio conversation and clears the playback buffer. This is commonly used when a user interrupts AI speech in a conversation.
- (int)interruptAudioPlayer:(AoqTrackType)trackType fadeMs:(NSInteger)fadeMs;
ParameterTypeDescription
trackTypeAoqTrackTypeType of the track to interrupt
fadeMsNSIntegerFade-out duration in milliseconds. 0 interrupts playback immediately.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

enableSpeakerphone:

Switches audio output to the speaker or earpiece. Takes effect only after startAudioPlayer:.
- (int)enableSpeakerphone:(BOOL)enable;
ParameterTypeDescription
enableBOOLYES switches to the speaker; NO switches to the earpiece.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode. For example, AoqECAudioDeviceEarpieceRequiresVoipMode indicates that the earpiece requires VoIP mode.
Switching to the earpiece requires AoqAudioPlaybackConfig.isVoipMode=YES. Route changes are reported through onAudioDeviceRouteChanged:.

isSpeakerphoneEnabled

Checks whether audio is currently output through the speaker.
- (BOOL)isSpeakerphoneEnabled;
Parameters: None. Return value: YES indicates speaker output. NO indicates the earpiece or another route.

setAudioSessionRestriction:

Sets the SDK's AVAudioSession control permissions (iOS only). Limits SDK control when the application manages AVAudioSession itself.
- (int)setAudioSessionRestriction:(int)restriction;
ParameterTypeDescription
restrictionintAVAudioSession permission bitmask corresponding to AoqAudioSessionRestriction. Multiple flags can be combined using bitwise OR.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
By default, the SDK fully manages AVAudioSession. Use this method to constrain SDK behavior if the application needs to manage the category or activation state itself.

Audio codec configuration

Audio encoding configuration

setAudioEncoderConfig:

Configures audio encoding for publishing. Configuration changes take effect immediately.
- (int)setAudioEncoderConfig:(AoqAudioCodecConfig * _Nonnull)config;
ParameterTypeDescription
configAoqAudioCodecConfig *Audio encoding configuration. Set trackType to AoqTrackTypeAudio.
Return value: 0 on success; non-zero on failure (an AoqErrorCode value, such as AoqECParamInvalid for invalid parameters).
codecType specifies the encoding format (Opus by default). sampleRate and channel must match the capture settings. bitrate applies only to lossy codecs such as Opus.

setAudioDecoderConfig:

Configures audio decoding for subscribed audio. The settings must match the remote encoding settings.
- (int)setAudioDecoderConfig:(AoqAudioCodecConfig * _Nonnull)config;
ParameterTypeDescription
configAoqAudioCodecConfig *Audio decoding configuration. Set trackType to AoqTrackTypeAudio.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
sampleRate must match the output sample rate of the remote encoder. A mismatch may cause decoding errors or audio quality issues.

Audio file playback

startAudioFile:config:

Starts streaming and playing a local audio file. Remote streaming and local playback can run simultaneously, with their volumes controlled by publishVolume and playoutVolume, respectively.
- (int)startAudioFile:(NSString * _Nonnull)fileId config:(AoqAudioFileMixConfig * _Nonnull)config;
ParameterTypeDescription
fileIdNSString *Application-defined file identifier used for subsequent control
configAoqAudioFileMixConfig *Audio file playback configuration
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Playback state changes are reported through onAudioFileState:. Repeated calls with the same fileId replace the previous playback.

stopAudioFile:

Stops audio file playback.
- (int)stopAudioFile:(NSString * _Nonnull)fileId;
ParameterTypeDescription
fileIdNSString *File identifier, matching the value passed to startAudioFile:config:
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

pauseAudioFile:

Pauses audio file playback.
- (int)pauseAudioFile:(NSString * _Nonnull)fileId;
ParameterTypeDescription
fileIdNSString *File identifier
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

resumeAudioFile:

Resumes audio file playback. Call this method after pauseAudioFile:.
- (int)resumeAudioFile:(NSString * _Nonnull)fileId;
ParameterTypeDescription
fileIdNSString *File identifier
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

getAudioFileDuration:

Gets the total duration of an audio file.
- (long long)getAudioFileDuration:(NSString * _Nonnull)fileId;
ParameterTypeDescription
fileIdNSString *File identifier
Return value: The total duration in milliseconds. Returns 0 if the file is not loaded or does not exist.

getAudioFileCurrentPosition:

Gets the current playback position of an audio file.
- (long long)getAudioFileCurrentPosition:(NSString * _Nonnull)fileId;
ParameterTypeDescription
fileIdNSString *File identifier
Return value: The current playback position in milliseconds. Returns 0 if the file is not loaded or does not exist.

setAudioFilePositionMillis:positionMillis:

Sets the playback position of an audio file (seek).
- (int)setAudioFilePositionMillis:(NSString * _Nonnull)fileId positionMillis:(long long)positionMillis;
ParameterTypeDescription
fileIdNSString *File identifier
positionMillislong longTarget playback position in milliseconds
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

setAudioFileVolume:type:volume:

Sets the audio file volume. Streaming and local playback volumes can be controlled separately.
- (int)setAudioFileVolume:(NSString * _Nonnull)fileId type:(AoqAudioStreamDirection)type volume:(NSInteger)volume;
ParameterTypeDescription
fileIdNSString *File identifier
typeAoqAudioStreamDirectionVolume direction. AoqAudioStreamPublish controls streaming; AoqAudioStreamPlayout controls playback.
volumeNSIntegerVolume. Valid values: 0-100.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

getAudioFileVolume:type:

Gets the current audio file volume.
- (int)getAudioFileVolume:(NSString * _Nonnull)fileId type:(AoqAudioStreamDirection)type;
ParameterTypeDescription
fileIdNSString *File identifier
typeAoqAudioStreamDirectionVolume direction
Return value: The current volume (0-100). Returns 0 if the file does not exist.

External audio streams

addAudioExternalStream:config:

Adds an external audio stream. Multiple independent streams can be created and distinguished by streamId.
- (int)addAudioExternalStream:(NSString * _Nonnull)streamId config:(AoqAudioExternalStreamConfig * _Nonnull)config;
ParameterTypeDescription
streamIdNSString *Application-defined external stream identifier
configAoqAudioExternalStreamConfig *External audio stream configuration
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

pushAudioExternalStreamData:data:

Feeds external PCM audio data into the specified stream.
- (int)pushAudioExternalStreamData:(NSString * _Nonnull)streamId data:(AoqAudioFrameData * _Nonnull)data;
ParameterTypeDescription
streamIdNSString *External stream identifier
dataAoqAudioFrameData *PCM audio frame data
Return value: 0 indicates success. A nonzero value indicates failure. AoqECAudioExternalBufferFull(110) is returned when the buffer is full.
Memory referenced by data.dataPtr needs to remain valid only during the call; the SDK copies it internally. The sample rate and channel count must match the configuration passed to addAudioExternalStream:config:.

setAudioExternalStreamVolume:type:volume:

Sets the external audio stream volume. Streaming and local playback volumes can be controlled separately.
- (int)setAudioExternalStreamVolume:(NSString * _Nonnull)streamId type:(AoqAudioStreamDirection)type volume:(NSInteger)volume;
ParameterTypeDescription
streamIdNSString *External stream identifier
typeAoqAudioStreamDirectionVolume direction
volumeNSIntegerVolume. Valid values: 0-100.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

getAudioExternalStreamVolume:type:

Gets the current external audio stream volume.
- (int)getAudioExternalStreamVolume:(NSString * _Nonnull)streamId type:(AoqAudioStreamDirection)type;
ParameterTypeDescription
streamIdNSString *External stream identifier
typeAoqAudioStreamDirectionVolume direction
Return value: The current volume (0-100). Returns 0 if the stream does not exist.

clearAudioExternalStreamBuffer:fadeoutMs:

Clears the external audio stream buffer with optional fade-out. Commonly used to interrupt current playback.
- (void)clearAudioExternalStreamBuffer:(NSString * _Nonnull)streamId fadeoutMs:(NSInteger)fadeoutMs;
ParameterTypeDescription
streamIdNSString *External stream identifier
fadeoutMsNSIntegerFade-out duration in milliseconds. -1 uses the default value, 0 clears the buffer immediately, and a value greater than 0 retains the specified duration for fade-out.
Return value: None (void).

removeAudioExternalStream:

Removes an external audio stream and releases its resources.
- (int)removeAudioExternalStream:(NSString * _Nonnull)streamId;
ParameterTypeDescription
streamIdNSString *External stream identifier
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

Audio frame callbacks

setAudioFrameObserver:

Sets the audio frame delegate. Pass delegate=nil to remove it.
- (int)setAudioFrameObserver:(id<AoqAudioFrameDelegate> _Nullable)delegate;
ParameterTypeDescription
delegateid<AoqAudioFrameDelegate>Audio frame delegate protocol. Pass nil to remove it.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Set the delegate with this method first, then call enableAudioFrameObserver:audioSource:config: to enable callbacks at the required positions.

enableAudioFrameObserver:audioSource:config:

Enables or disables audio frame callbacks at the specified position.
- (int)enableAudioFrameObserver:(BOOL)enabled audioSource:(AoqAudioSource)audioSource config:(AoqAudioObserverConfig * _Nonnull)config;
ParameterTypeDescription
enabledBOOLYES enables callbacks; NO disables them.
audioSourceAoqAudioSourceAudio source position: capture, after 3A processing, publishing, or playback
configAoqAudioObserverConfig *Callback configuration
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Callbacks run on internal SDK threads. Do not perform time-consuming operations or blocking calls in them. dataPtr is valid only during the callback. Make a copy for asynchronous use.

Local audio volume indication

enableLocalAudioVolumeIndication:

Enables or disables local captured audio volume indications. When enabled, the SDK invokes onLocalAudioVolumeIndication: at config.interval intervals to report the local captured volume and whether speech is detected.
- (int)enableLocalAudioVolumeIndication:(AoqAudioVolumeIndicationConfig * _Nonnull)config;
ParameterTypeDescription
configAoqAudioVolumeIndicationConfig *Volume indication configuration. interval<=0 disables callbacks.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Call this method after startAudioCapture: to obtain volume data. Values of interval>0 and <10 are treated as 10.

Video device management

startVideoCapture:

Opens the video capture device (camera). Captured video is sent over AoqTrackTypeVideo. For external video input (pushExternalVideoCapturedFrame:frame:), set isExternal to YES; the camera is not opened in this mode.
- (int)startVideoCapture:(AoqVideoCaptureConfig * _Nonnull)config;
ParameterTypeDescription
configAoqVideoCaptureConfig *Video capture configuration.
Return value: 0 on success; non-zero on failure (an AoqErrorCode value, such as AoqECVideoDeviceCameraAuthFailed when camera permission has not been granted).
Configure NSCameraUsageDescription in Info.plist and obtain camera permission. Device state changes are reported through onVideoDeviceStateChanged:.

stopVideoCapture

Closes the video capture device and stops local video capture.
- (int)stopVideoCapture;
Parameters: None. Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

switchCamera:

Switches between the front and rear cameras. Call this method after startVideoCapture:(isExternal=NO).
- (int)switchCamera:(AoqCameraDirection)direction;
ParameterTypeDescription
directionAoqCameraDirectionTarget camera direction: AoqCameraDirectionFront for the front camera and AoqCameraDirectionBack for the rear camera.
Return value: 0 on success; < 0 on failure (an AoqErrorCode value).
This method has no effect in external capture mode (isExternal=YES).

setLocalView:canvas:

Sets or removes the local video rendering view. Pass canvas=nil or canvas.view=nil to unbind rendering.
- (int)setLocalView:(AoqTrackType)trackType canvas:(AoqVideoCanvas * _Nullable)canvas;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type. Set to AoqTrackTypeVideo for local preview.
canvasAoqVideoCanvas *Video rendering canvas. Pass nil to unbind it.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.

setRemoteView:canvas:

Sets or removes the remote video rendering view. Pass canvas=nil or canvas.view=nil to unbind it.
- (int)setRemoteView:(AoqTrackType)trackType canvas:(AoqVideoCanvas * _Nullable)canvas;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type
canvasAoqVideoCanvas *Video rendering canvas. Pass nil to unbind it.
Return value: 0 on success; non-zero on failure. If trackType is AoqTrackTypeScreen, returns AoqECUnSupport and does not bind the view.
The Screen track currently supports publishing only and has no remote video to render. Do not set trackType to AoqTrackTypeScreen.

Video encoding and external input

setVideoEncoderConfig:

Configures video encoding for publishing, routed by config.trackType. If isExternal=YES, pushExternalVideoEncodedFrame:frame: sends encoded frames directly without re-encoding by the SDK.
- (int)setVideoEncoderConfig:(AoqVideoCodecConfig * _Nonnull)config;
ParameterTypeDescription
configAoqVideoCodecConfig *Video encoding configuration.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Before using pushExternalVideoEncodedFrame:, call this method with isExternal=YES. This mode bypasses the capture pipeline and does not require startVideoCapture:/startScreenCapture:. When using pushExternalVideoCapturedFrame:, keep isExternal=NO so that the SDK encodes the frames.

setVideoDecoderConfig:

Configures video decoding for subscribed video, routed by config.trackType. Only trackType/codecType/width/height/fps/bitrate apply to decoding. The other fields apply only to encoding.
- (int)setVideoDecoderConfig:(AoqVideoCodecConfig * _Nonnull)config;
ParameterTypeDescription
configAoqVideoCodecConfig *Video decoding configuration.
Return value: 0 on success; non-zero on failure. If config.trackType is AoqTrackTypeScreen, returns AoqECUnSupport and does not apply the configuration.
The Screen track currently supports publishing only, not subscribing. Do not set config.trackType to AoqTrackTypeScreen.

pushExternalVideoCapturedFrame:frame:

Pushes external raw video frames for encoding and transmission by the SDK. Frames are routed by trackType. External capture must be enabled for the corresponding track.
- (int)pushExternalVideoCapturedFrame:(AoqTrackType)trackType frame:(AoqVideoFrame * _Nonnull)frame;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type. For AoqTrackTypeVideo, call startVideoCapture:(isExternal=YES) first. For AoqTrackTypeScreen, call startScreenCapture:(isExternal=YES) first.
frameAoqVideoFrame *External video frame data.
Return value: 0 on success; AoqECVideoExternalCaptureNotEnabled(211) if external capture is not enabled for the track; AoqECVideoExternalBufferFull(210) if the buffer is full; < 0 on other failures.
If frame.timeStamp<=0, the SDK fills it in using the local clock. The CVPixelBuffer zero-copy path is supported (format=AoqVideoPixelFormatCVPixelBuffer).

pushExternalVideoEncodedFrame:frame:

Pushes external encoded video frames. The SDK packetizes and sends them without re-encoding. Frames are consumed only after setVideoEncoderConfig:(isExternal=YES) is called for the corresponding trackType. startVideoCapture:/startScreenCapture: is not required.
- (int)pushExternalVideoEncodedFrame:(AoqTrackType)trackType frame:(AoqVideoEncodedFrame * _Nonnull)frame;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type. Supports AoqTrackTypeVideo / AoqTrackTypeScreen.
frameAoqVideoEncodedFrame *External encoded video frame.
Return value: 0 on success; AoqECVideoExternalEncoderNotEnabled(212) if external encoding is not enabled for the track; < 0 on failure.
frame.timeStamp is passed through unchanged. The SDK does not fill it in. The caller must ensure that timestamps increase monotonically.

Screen capture

- (int)startScreenCapture:(AoqScreenCaptureConfig * _Nonnull)config;
- (int)stopScreenCapture;
config specifies screen capture settings. Screen content is sent on the AoqTrackTypeScreen track. For start, 0 means that the request is accepted; onScreenCaptureStateChanged reports the result asynchronously. A nonzero return rejects the request synchronously without a duplicate failure event. Stop returns 0 on success or a nonzero value on failure, and reports the stopped state through this callback. With isExternal=NO, capture uses a Broadcast Upload Extension. Integrate and configure AoqScreenShare.framework and display the system broadcast picker. On timeout, the onScreenCaptureStateChanged: callback reports failure with AoqECScreenStartFailed. You do not need to wait for Started before enabling transmission. For external raw frames, set isExternal=YES. This does not enable the Extension receiving channel. Supply raw Screen frames through pushExternalVideoCapturedFrame for SDK encoding. For external encoded frames, configure the Screen track for external encoding with setVideoEncoderConfig, then call pushExternalVideoEncodedFrame; startScreenCapture is not required.

Media stream transmission control

enableSendMediaStream:enable:

Enables or disables sending a local media stream, selected by trackType. When sending is disabled, capture and encoding continue, but data is not sent over the network.
- (int)enableSendMediaStream:(AoqTrackType)trackType enable:(BOOL)enable;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type. Supports AoqTrackTypeAudio/AoqTrackTypeVideo/AoqTrackTypeScreen.
enableBOOLYES enables sending; NO disables sending.
Return value: 0 indicates a successful call. A value less than 0 indicates failure and corresponds to AoqErrorCode.
After initialization, call enableSendMediaStream:enable:NO first. Enable sending after onConnectionStatusChange: reports Connected to avoid losing data before the connection is established.

Video frame callbacks

setVideoFrameObserver:

Sets the video frame delegate. Pass delegate=nil to remove it.
- (int)setVideoFrameObserver:(id<AoqVideoFrameDelegate> _Nullable)delegate;
ParameterTypeDescription
delegateid<AoqVideoFrameDelegate>Video frame delegate protocol. Pass nil to remove it.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Set the delegate with this method first, then call enableVideoFrameObserver:videoSource:config: to enable callbacks at the required positions.

enableVideoFrameObserver:videoSource:config:

Enables or disables video frame callbacks at the specified position.
- (int)enableVideoFrameObserver:(BOOL)enabled videoSource:(AoqVideoSource)videoSource config:(AoqVideoObserverConfig * _Nonnull)config;
ParameterTypeDescription
enabledBOOLYES enables callbacks; NO disables them.
videoSourceAoqVideoSourceVideo source position: after capture, before encoding, or after remote decoding
configAoqVideoObserverConfig *Callback configuration. Use config.trackType to observe the Video or Screen track.
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
Callbacks run on internal SDK threads. Do not perform time-consuming operations in them. Only I420/CVPixelBuffer supports read-write mode (mode=ReadWrite); other formats are read-only.

AoqEngineDelegate callbacks

onScreenCaptureStateChanged: is @optional. All other AoqEngineDelegate callbacks are @required.

Real-time messages

sendDataMsg:

Sends a real-time data message to the remote end. Call this method after connect: succeeds and enableSendMediaStream:(Data, YES) is called.
- (int)sendDataMsg:(AoqDataMsg * _Nonnull)msg;
ParameterTypeDescription
msgAoqDataMsg *Data message
Return value: 0 indicates success. A nonzero value indicates failure and corresponds to AoqErrorCode.
The remote end receives the message through onDataMsg:. Message size is subject to internal SDK limits. Split oversized messages into smaller parts before sending.

AoqEngineDelegate callbacks

onError:message:

Engine error callback. Triggered when an unrecoverable error occurs.
- (void)onError:(NSInteger)code message:(NSString * _Nonnull)message;
ParameterTypeDescription
codeNSIntegerError code corresponding to an AoqErrorCode enum value
messageNSString *Error description
Return value: None (void).

onWarning:message:

Engine warning callback. Triggered by recoverable exceptions that do not prevent the SDK from continuing to run.
- (void)onWarning:(NSInteger)code message:(NSString * _Nonnull)message;
ParameterTypeDescription
codeNSIntegerWarning code corresponding to an AoqWarningCode enum value
messageNSString *Warning description
Return value: None (void).

onConnectionStatusChange:

Connection state change callback. State transitions: Disconnected → Connecting → Connected/Failed → Disconnected.
- (void)onConnectionStatusChange:(AoqConnectionStatus)status;
ParameterTypeDescription
statusAoqConnectionStatusCurrent connection state
Return value: None (void).
Enable media sending with enableSendMediaStream:enable:YES after receiving Connected.

onStats:

Engine statistics callback. The SDK periodically reports audio/video publishing and subscription statistics and network statistics to monitor call quality and network conditions and diagnose audio/video issues.
- (void)onStats:(AoqStats * _Nonnull)stats;
ParameterTypeDescription
statsAoqStats *Statistics for audio/video/data message publishing and subscription, and network statistics
Return value: None (void).

onAudioDeviceStateChanged:

Callback for audio device capture/playback state changes.
- (void)onAudioDeviceStateChanged:(AoqAudioDeviceState * _Nonnull)state;
ParameterTypeDescription
stateAoqAudioDeviceState *Audio device state, including state (state code) and reason (error reason)
Return value: None (void).

onAudioDeviceRouteChanged:

Callback for audio output route changes.
- (void)onAudioDeviceRouteChanged:(NSInteger)routeType;
ParameterTypeDescription
routeTypeNSIntegerCurrent audio output route, corresponding to an AoqAudioDeviceRouteType enum value
Return value: None (void).

onAudioDeviceInterrupted:

Audio device interruption callback. Triggered by system interruptions, such as incoming calls or another app taking audio focus.
- (void)onAudioDeviceInterrupted:(BOOL)interrupt;
ParameterTypeDescription
interruptBOOLYES indicates interruption; NO indicates recovery from interruption.
Return value: None (void).

onAudioFileState:

Audio file playback state callback.
- (void)onAudioFileState:(AoqAudioFileState * _Nonnull)state;
ParameterTypeDescription
stateAoqAudioFileState *Audio file playback state, including fileId, stateCode, and errorCode
Return value: None (void).

onLocalAudioVolumeIndication:

Reports the locally captured audio volume. Triggered only after volume indications are enabled through enableLocalAudioVolumeIndication:.
- (void)onLocalAudioVolumeIndication:(AoqAudioVolume * _Nonnull)volume;
ParameterTypeDescription
volumeAoqAudioVolume *Local volume information, including isSpeech (whether speech is detected) and volume (smoothed instantaneous volume [0-255]).
Return value: None (void).

onVideoDeviceStateChanged:

Callback for video device capture state changes.
- (void)onVideoDeviceStateChanged:(AoqVideoDeviceState * _Nonnull)state;
ParameterTypeDescription
stateAoqVideoDeviceState *Video device state, including state (state code) and reason (error reason)
Return value: None (void).

onDataMsg:

Callback for received real-time data messages.
- (void)onDataMsg:(AoqDataMsg * _Nonnull)msg;
ParameterTypeDescription
msgAoqDataMsg *Data message
Return value: None (void).
Callbacks run on internal SDK threads. Do not perform time-consuming operations in them. NSData is valid only during the callback. Make a copy for asynchronous use.

onScreenCaptureStateChanged

Reports screen capture state changes (@optional) using AoqScreenCaptureStateCode and the unified AoqErrorCode. Notifications are delivered in order on the main thread. Screen capture failures are not also reported through onError:.
- (void)onScreenCaptureStateChanged:(AoqScreenCaptureState * _Nonnull)state;
ParameterTypeDescription
stateAoqScreenCaptureState *Screen capture state, including state (state code) and reason (error cause).
Return value: None (void).
Started indicates that capture or external input is ready, not that media has been sent. Fail and Stopped are terminal states after cleanup.

AoqAudioFrameDelegate callbacks

Audio frame delegate protocol. All methods are @optional; implement them as needed.
@protocol AoqAudioFrameDelegate <NSObject>
@optional
- (void)onCapturedAudioFrame:(AoqAudioFrameData * _Nonnull)frame;
- (void)onProcessCapturedAudioFrame:(AoqAudioFrameData * _Nonnull)frame;
- (void)onPublishAudioFrame:(AoqTrackType)trackType frame:(AoqAudioFrameData * _Nonnull)frame;
- (void)onPlaybackAudioFrame:(AoqAudioFrameData * _Nonnull)frame;
@end
MethodWhen triggeredParameter
onCapturedAudioFrame:When a raw audio frame is capturedframe: AoqAudioFrameData *
onProcessCapturedAudioFrame:Audio frame after 3A processingframe: AoqAudioFrameData *
onPublishAudioFrame:frame:Audio frame before publishingtrackType: track type; frame: AoqAudioFrameData *
onPlaybackAudioFrame:Remote audio frame before playbackframe: AoqAudioFrameData *
Return value: None (void).
Callbacks are triggered only after enableAudioFrameObserver:audioSource:config: enables the corresponding AoqAudioSource. dataPtr is valid only during the callback.

onCapturedAudioFrame

Called when a raw audio frame is captured. The frame contains unprocessed PCM data.
- (void)onCapturedAudioFrame:(AoqAudioFrameData *)frame;
ParameterTypeDescription
frameAoqAudioFrameData *Captured audio frame data
Return value: None (void).
frame.dataPtr references SDK-managed memory and is valid only during the callback. Copy the data before using it asynchronously.

onProcessCapturedAudioFrame

Called for an audio frame after 3A processing, such as echo cancellation and noise suppression.
- (void)onProcessCapturedAudioFrame:(AoqAudioFrameData *)frame;
ParameterTypeDescription
frameAoqAudioFrameData *Audio frame data after 3A processing
Return value: None (void).
frame.dataPtr references SDK-managed memory and is valid only during the callback. Copy the data before using it asynchronously.

onPublishAudioFrame

Called for an audio frame before publishing, immediately before encoding and transmission.
- (void)onPublishAudioFrame:(AoqTrackType)trackType frame:(AoqAudioFrameData *)frame;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type
frameAoqAudioFrameData *Audio frame data before publishing
Return value: None (void).
frame.dataPtr references SDK-managed memory and is valid only during the callback. Copy the data before using it asynchronously.

onPlaybackAudioFrame

Called for a remote audio frame before playback, after decoding and mixing.
- (void)onPlaybackAudioFrame:(AoqAudioFrameData *)frame;
ParameterTypeDescription
frameAoqAudioFrameData *Remote audio frame data before playback
Return value: None (void).
frame.dataPtr references SDK-managed memory and is valid only during the callback. Copy the data before using it asynchronously.

AoqVideoFrameDelegate callbacks

Video frame delegate protocol. All methods are @optional. Returning NO indicates no data modification. Each of the three callbacks includes trackType to distinguish Video and Screen tracks.
@protocol AoqVideoFrameDelegate <NSObject>
@optional
- (BOOL)onCapturedVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame * _Nonnull)frame;
- (BOOL)onPreEncodeVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame * _Nonnull)frame;
- (BOOL)onRemoteVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame * _Nonnull)frame;
@end
MethodWhen triggeredParameter
onCapturedVideoFrame:frame:When a raw video frame is captured (before preprocessing)trackType: track type; frame: AoqVideoFrame *
onPreEncodeVideoFrame:frame:Video frame before encoding (after preprocessing)trackType: track type; frame: AoqVideoFrame *
onRemoteVideoFrame:frame:Remote video frame after decoding and before renderingtrackType: track type; frame: AoqVideoFrame *
Return value: BOOL. YES indicates that the data was modified and must be written back to the SDK (supported only for I420/CVPixelBuffer). NO indicates no modification.
Callbacks are triggered only after enableVideoFrameObserver:videoSource:config: enables the corresponding AoqVideoSource. NSData/pixelBuffer in frame references internal SDK memory and is valid only during the callback. Make a copy for asynchronous use.

onCapturedVideoFrame

Called when a raw video frame is captured, before preprocessing.
- (BOOL)onCapturedVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame *)frame;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type (Video/Screen)
frameAoqVideoFrame *Captured video frame data
Return value: BOOL. YES indicates that modified data must be written back to the SDK (supported only for I420/CVPixelBuffer). NO indicates no modification.
Callbacks are triggered only after enableVideoFrameObserver:videoSource:config: enables the corresponding AoqVideoSource. NSData/pixelBuffer in frame references internal SDK memory and is valid only during the callback. Make a copy for asynchronous use.

onPreEncodeVideoFrame

Called for a video frame after preprocessing and before encoding.
- (BOOL)onPreEncodeVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame *)frame;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type (Video/Screen)
frameAoqVideoFrame *Video frame data before encoding
Return value: BOOL. YES indicates that modified data must be written back to the SDK (supported only for I420/CVPixelBuffer). NO indicates no modification.
Callbacks are triggered only after enableVideoFrameObserver:videoSource:config: enables the corresponding AoqVideoSource. NSData/pixelBuffer in frame references internal SDK memory and is valid only during the callback. Make a copy for asynchronous use.

onRemoteVideoFrame

Called for a remote video frame after decoding and before rendering.
- (BOOL)onRemoteVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame *)frame;
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type (Video/Screen)
frameAoqVideoFrame *Decoded remote video frame data
Return value: BOOL. YES indicates that modified data must be written back to the SDK (supported only for I420/CVPixelBuffer). NO indicates no modification.
Callbacks are triggered only after enableVideoFrameObserver:videoSource:config: enables the corresponding AoqVideoSource. NSData/pixelBuffer in frame references internal SDK memory and is valid only during the callback. Make a copy for asynchronous use.

Data types and enumerations

Common types

AoqCreateConfig (fields added in v1.3.0)

FieldTypeDefaultDescription
maxEncodedVideoFrameBytesNSInteger190 × 1024Maximum encoded frame size in bytes. Applies only to the SDK internal JPEG encoder.
enableDropOversizedVideoFrameBOOLNOFor the SDK internal JPEG encoder, whether to drop a frame that remains oversized at the lowest quality.

AoqConnectConfig

subscribeTracks must not include AoqTrackTypeScreen; otherwise, connect returns AoqECUnSupport without starting a connection. setRemoteView also returns AoqECUnSupport for Screen.

Field

Type

Description

token

NSString *

Authentication token

sid

NSString *

Session ID

certFingerprint

NSString *

Server certificate fingerprint

relayEndpoints

NSArray<AoqRelayEndpoint *> *

List of Relay endpoints

workspaceIdHash

NSString *

Workspace ID hash

publishTracks

NSArray<AoqTrackParam *> *

Local tracks to publish

subscribeTracks

NSArray<AoqTrackParam *> *

Remote tracks to subscribe to

AoqRelayEndpoint

Relay endpoint.
FieldTypeDefault valueDescription
routeIndexNSInteger-1Route index
endpointNSString *""Server address (domain name or IP address)
portNSInteger0Server UDP port
tcpPortNSInteger0TCP fallback port. 0 uses the SDK default port, 443.

AoqTrackParam.trackMode

FieldTypeDefaultDescription
trackModeAoqTrackModeAoqTrackModeSegmentApplies only to downstream audio.

AoqTrackParam

Track properties.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAoqTrackTypeAudioTrack type
trackModeAoqTrackModeAoqTrackModeSegmentStreaming or non-streaming mode. Applies only to downstream audio.

Enumerations

AoqTrackMode

ValueNumberDescription
AoqTrackModeSegment0Segment mode: delivers data in semantic segments, such as sentences. Applies only to downstream audio.
AoqTrackModeStream1Stream mode: delivers data continuously. Applies only to downstream audio.

AoqErrorCode

Enum value

Value

Description

AoqECOK

0

Success

AoqECParamInvalid

1

Invalid parameter

AoqECStateInvalid

2

Invalid state

AoqECUnSupport

3

Unsupported operation

AoqECAudio

100

Audio generic error

AoqECAudioExternalBufferFull

110

External audio buffer full

AoqECAudioDevice

120

Audio device generic error

AoqECAudioDeviceRecordingAuthFailed

121

Recording permission not granted

AoqECAudioDeviceRecordingOccupied

122

Recording device in use

AoqECAudioDeviceRecordingBackgroundStart

123

Failed to start recording in background

AoqECAudioDeviceRecordingStartFail

124

Recording start failed

AoqECAudioDevicePlayoutOccupied

125

Playback device in use

AoqECAudioDevicePlayoutBackgroundStart

126

Failed to start playback in background

AoqECAudioDevicePlayoutStartFail

127

Playback start failed

AoqECAudioDeviceEarpieceRequiresVoipMode

128

Earpiece requires VoIP mode

AoqECVideo

200

Video generic error

AoqECVideoExternalBufferFull

210

External video buffer full

AoqECVideoExternalCaptureNotEnabled

211

External video capture not enabled

AoqECVideoExternalEncoderNotEnabled

212

External video encoder not enabled

AoqECVideoDevice

220

Video device generic error

AoqECVideoDeviceCameraOpenFail

221

Camera open failed

AoqECVideoDeviceCameraAuthFailed

222

Camera permission not granted

AoqECVideoDeviceCameraOccupied

223

Camera in use

AoqECVideoDeviceCameraRunningError

224

Camera runtime error

AoqECVideoCodec

230

Video codec generic error

AoqECVideoCodecEncoderInitFail

231

Video encoder initialization failed

AoqECVideoRender

240

Video rendering generic error

AoqECVideoRenderCreateFail

241

Video renderer creation failed

AoqECVideoRenderDrawError

242

Video rendering draw error

AoqECScreen300General screen sharing error
AoqECScreenAuthFailed310Screen sharing permission denied
AoqECScreenStartFailed311Failed to start screen sharing

AoqTrackType

Enum value

Value

Description

AoqTrackTypeAudio

0

Audio track

AoqTrackTypeVideo

1

Video track

AoqTrackTypeData

2

Data messaging track

AoqTrackTypeScreen3Screen sharing track. Uplink only.

AoqWarningCode

Warning codes.
Enum valueValueDescription
AoqWCOK0No warning
AoqWCAudio100General audio warning
AoqWCAudioHowling101Audio howling detected
AoqWCAudioDevice120General audio device warning
AoqWCAudioDeviceMicEnumerateError121Microphone enumeration error
AoqWCAudioDeviceMicStartTimeout122Microphone startup timeout
AoqWCAudioDeviceRecordingError123Recording error
AoqWCAudioDeviceSpeakerEnumerateError124Speaker enumeration error
AoqWCAudioDeviceSpeakerStartTimeout125Speaker startup timeout
AoqWCAudioDevicePlayoutError126Playback error
AoqWCVideo200General video warning
AoqWCVideoCameraEnumerateError201Camera enumeration error
AoqWCVideoEncoderSwitched202Video encoder switched
AoqWCVideoRenderDowngrade203Video rendering downgraded

AoqEncoderType

Track media formats.
Enum valueValueDescription
AoqEncoderTypeUnknown0Unknown format
AoqEncoderTypeAudioPCM1PCM audio
AoqEncoderTypeAudioOpus2Opus audio
AoqEncoderTypeVideoH2643H.264 video
AoqEncoderTypeVideoJpeg4JPEG video
AoqEncoderTypeDataText5Text data

AoqConnectionStatus

Engine connection states.
Enum valueValueDescription
AoqConnectionStatusDisconnected0Disconnected
AoqConnectionStatusConnecting1Connecting
AoqConnectionStatusConnected2Connected
AoqConnectionStatusFailed3Connection failed

AoqMirrorMode

Mirror mode.
Enum valueValueDescription
AoqMirrorModeDisabled0Mirroring disabled
AoqMirrorModeEnabled1Mirroring enabled

AoqOrientationMode

Video orientation.
Enum valueValueDescription
AoqOrientationModeAuto0Automatic
AoqOrientationModePortrait1Portrait
AoqOrientationModeLandscape2Landscape

Audio types

AoqAudioPlaybackConfig

Field

Type

Default

Description

isVoipMode

BOOL

NO

YES: enable VoIP mode (hardware AEC); applies to mobile

isDefaultSpeaker

BOOL

YES

YES: default to speaker; NO: earpiece

isExternal

BOOL

NO

YES: external audio output

channel

NSInteger

1

Channel count: 1 or 2

AoqAudioCaptureConfig

Audio capture configuration.
FieldTypeDefault valueDescription
isExternalBOOLNOWhether to use external capture
isVoipModeBOOLNOWhether to enable VoIP mode (hardware AEC). Effective on mobile devices.
channelNSInteger1Channel count. Supports 1/2.

AoqAudioCodecConfig

Audio codec configuration shared by setAudioEncoderConfig: and setAudioDecoderConfig:.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAoqTrackTypeAudioTrack type
codecTypeAoqEncoderTypeAoqEncoderTypeAudioOpusEncoding format
sampleRateNSInteger48000Sample rate in Hz
channelNSInteger1Number of channels
bitrateNSInteger32000Bitrate in bps

AoqAudioSessionRestriction

AVAudioSession permission bitmask (NS_OPTIONS; flags can be combined with bitwise OR). Used by setAudioSessionRestriction:.
Enum valueValueDescription
AoqAudioSessionNone0No restrictions (the SDK fully manages AVAudioSession)
AoqAudioSessionSetCategory1Restricts the SDK from setting the category
AoqAudioSessionConfigureSession2Restricts the SDK from configuring the session
AoqAudioSessionDeactivateSession4Restricts the SDK from deactivating the session
AoqAudioSessionActivateSession8Restricts the SDK from activating the session

AoqAudioDeviceStateCode

Audio device capture and playback state codes.
Enum valueValueDescription
AoqAudioDeviceNone0No state
AoqAudioDeviceRecordStarting1Capture starting
AoqAudioDeviceRecordStarted2Capture started
AoqAudioDeviceRecordStopping3Capture stopping
AoqAudioDeviceRecordStopped4Capture stopped
AoqAudioDeviceRecordFail5Capture failed
AoqAudioDevicePlayStarting6Playback starting
AoqAudioDevicePlayStarted7Playback started
AoqAudioDevicePlayStopping8Playback stopping
AoqAudioDevicePlayStopped9Playback stopped
AoqAudioDevicePlayFail10Playback failed

AoqAudioDeviceState

Audio device capture and playback state.
FieldTypeDefault valueDescription
stateAoqAudioDeviceStateCodeAoqAudioDeviceNoneDevice operation state
reasonNSInteger0Error reason code (see AoqErrorCode)

AoqAudioDeviceRouteType

Audio device route types.
Enum valueValueDescription
AoqAudioDeviceRouteDefault0Default route
AoqAudioDeviceRouteHeadset1Headset with microphone
AoqAudioDeviceRouteEarpiece2Earpiece
AoqAudioDeviceRouteHeadsetNoMic3Headset without microphone
AoqAudioDeviceRouteSpeakerPhone4Speaker
AoqAudioDeviceRouteUsb5USB audio device
AoqAudioDeviceRouteBluetooth6Bluetooth SCO mode
AoqAudioDeviceRouteBluetoothA2dp7Bluetooth A2DP mode

Audio file types

AoqAudioFileMixConfig

Audio file playback configuration.
FieldTypeDefault valueDescription
fileNameNSString *""File name including its path. Must not be empty.
cyclesNSInteger-1Loop count. -1 loops indefinitely.
startPosMsNSInteger0Initial playback position in milliseconds
publishVolumeNSInteger100Publishing volume. Valid values: 0-100.
playoutVolumeNSInteger100Playback volume. Valid values: 0-100.

AoqAudioFileStateCode

Audio file playback state codes.
Enum valueValueDescription
AoqAudioFileNone0No state
AoqAudioFileStarted1Playback started
AoqAudioFileStopped2Playback stopped
AoqAudioFilePaused3Playback paused
AoqAudioFileResumed4Playback resumed
AoqAudioFileEnded5Playback ended
AoqAudioFileBuffering6Playback buffering
AoqAudioFileBufferingEnd7Buffering ended
AoqAudioFileFailed8Playback failed

AoqAudioFileErrorCode

Audio file playback error codes.
Enum valueValueDescription
AoqAudioFileNoError0No error
AoqAudioFileOpenFailed1Failed to open file
AoqAudioFileDecodeFailed2Failed to decode file

AoqAudioFileState

Audio file state.
FieldTypeDefault valueDescription
fileIdNSString *""File identifier
stateCodeAoqAudioFileStateCodeAoqAudioFileNoneFile playback state code
errorCodeAoqAudioFileErrorCodeAoqAudioFileNoErrorFile error code

External audio stream and volume types

AoqAudioVolume

FieldTypeDefaultDescription
isSpeechBOOLNOWhether speech is detected.
volumeNSInteger0Smoothed instantaneous volume, from 0 to 255.

AoqAudioVolumeIndicationConfig

FieldTypeDefaultDescription
reportSpeechBOOLNOWhether to detect speech.
intervalNSInteger0Callback interval in milliseconds. Values of 0 or less disable callbacks; values between 0 and 10 use 10.
smoothNSInteger3Smoothing factor, from 0 to 10. Higher values produce smoother results.

AoqAudioStreamDirection

Audio stream directions.
Enum valueValueDescription
AoqAudioStreamPublish0Publishing stream
AoqAudioStreamPlayout1Playback stream

AoqAudioExternalStreamToggle

External audio stream toggle states.
Enum valueValueDescription
AoqAudioExternalStreamToggleNormal0Normal state
AoqAudioExternalStreamTogglePause1Paused state

AoqAudioExternalStreamConfig

External audio stream configuration.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAoqTrackTypeAudioAudio track type
codecTypeAoqEncoderTypeAoqEncoderTypeAudioPCMAudio stream format
channelsNSInteger1Number of channels
sampleRateNSInteger48000Sample rate in Hz
playoutVolumeNSInteger100Playback volume (0-100)
publishVolumeNSInteger100Publishing volume (0-100)
maxBufferDurationNSInteger1000Maximum buffer duration in milliseconds
enable3ABOOLNOWhether to apply 3A processing to input PCM

AoqAudioFrameData

External audio frame data.
FieldTypeDefault valueDescription
dataPtrvoid *NULLPointer to raw PCM audio data (@Nullable)
dataSizeNSInteger0PCM data size in bytes
numOfSamplesNSInteger0Number of samples per channel
bytesPerSampleNSInteger0Bytes per sample
numOfChannelsNSInteger0Number of channels
samplesPerSecNSInteger0Samples per second (sample rate)
pushSequenceint32_t0PCM input round
timeStampint64_t0Timestamp
autoGenMuteBOOLNOValid in data callbacks. YES indicates SDK-generated silence.

AoqAudioSource

Audio frame callback data sources.
Enum valueValueDescription
AoqAudioSourceCaptured0Captured audio data
AoqAudioSourceProcessCaptured1Audio data after 3A processing
AoqAudioSourcePublish2Published audio data
AoqAudioSourcePlayback3Playback audio data

AoqAudioObserverMode

Audio frame callback modes.
Enum valueValueDescription
AoqAudioObserverModeReadOnly0Read-only mode
AoqAudioObserverModeReadWrite1Read-write mode

AoqAudioObserverConfig

Audio frame callback configuration.
FieldTypeDefault valueDescription
sampleRateNSInteger48000Callback audio sample rate in Hz
channelsNSInteger1Callback audio channel count
modeAoqAudioObserverModeAoqAudioObserverModeReadOnlyRead-write mode

Video types

AoqScreenCaptureState

FieldTypeDefaultDescription
stateAoqScreenCaptureStateCodeAoqScreenCaptureNoneScreen capture state.
reasonNSInteger00 for normal states; an AoqErrorCode on failure.

AoqScreenCaptureStateCode

ValueNumberDescription
AoqScreenCaptureNone0None
AoqScreenCaptureStarting1Starting
AoqScreenCaptureStarted2Input ready; does not indicate transmission
AoqScreenCaptureStopping3Stopping
AoqScreenCaptureStopped4Stopped
AoqScreenCaptureFail5Start or runtime failure

AoqScreenCaptureConfig

FieldTypeDefaultDescription
isExternalBOOLNOWhether the application supplies raw screen frames.
appGroupNSString *nilOptional AppGroup ID shared by the app and Broadcast Extension. If nil, settings are delivered through the socket handshake and neither target needs the App Groups capability. Ignored for external capture.

AoqVideoCodecConfig

FieldTypeDefaultDescription
trackTypeAoqTrackTypeAoqTrackTypeVideoTrack type
codecTypeAoqEncoderTypeAoqEncoderTypeVideoH264Codec
widthNSInteger540Width in pixels
heightNSInteger960Height in pixels
fpsNSInteger5Frame rate
bitrateNSInteger500000Bitrate in bps
minBitrateNSInteger128000Minimum bitrate in bps
keyframeIntervalNSInteger2Keyframe interval in seconds
mirrorModeAoqMirrorModeAoqMirrorModeDisabledMirror mode
orientationModeAoqOrientationModeAoqOrientationModeAutoOrientation mode
isExternalBOOLNOWhether the application supplies encoded frames.

AoqRenderMode

Rendering modes.
Enum valueValueDescription
AoqRenderModeAuto0Automatic mode
AoqRenderModeStretch1Stretch mode. The image is distorted when aspect ratios differ.
AoqRenderModeFill2Letterbox mode. Black bars are added above and below or on the sides when aspect ratios differ.
AoqRenderModeCrop3Crop mode. Width or height is cropped when aspect ratios differ, removing part of the image.

AoqVideoCanvas

Video rendering canvas.
FieldTypeDefault valueDescription
viewUIView *nilDisplay view. Pass nil to remove the rendering binding (@Nullable).
renderModeAoqRenderModeAoqRenderModeAutoRendering mode

AoqCameraDirection

Camera direction.
Enum valueValueDescription
AoqCameraDirectionFront0Front camera
AoqCameraDirectionBack1Rear camera (effective on mobile devices)

AoqVideoCaptureConfig

Video capture configuration.
FieldTypeDefault valueDescription
widthNSInteger1280Capture width in pixels. Ignored when isExternal=YES.
heightNSInteger720Capture height in pixels. Ignored when isExternal=YES.
fpsNSInteger15Capture frame rate. Ignored when isExternal=YES (timing is determined by frame input).
isExternalBOOLNOWhether to use external capture. When YES, the camera is not opened; supply frames through pushExternalVideoCapturedFrame:.
cameraDirectionAoqCameraDirectionAoqCameraDirectionFrontCamera direction. Ignored when isExternal=YES.

AoqVideoPixelFormat

Video pixel formats.
Enum valueValueDescription
AoqVideoPixelFormatUnknown0Unknown format
AoqVideoPixelFormatI4201I420 (YUV planar format)
AoqVideoPixelFormatNV122NV12 (YUV semi-planar format)
AoqVideoPixelFormatNV213NV21 (YUV semi-planar format)
AoqVideoPixelFormatBGRA4BGRA (32-bit)
AoqVideoPixelFormatRGBA5RGBA (32-bit)
AoqVideoPixelFormatCVPixelBuffer6Apple zero-copy path. Set pixelBuffer to a CVPixelBufferRef.
iOS does not support TextureOES/Texture2D. Its zero-copy path uses CVPixelBuffer.

AoqVideoFrame

External video data, also used in video frame callbacks (AoqVideoFrameDelegate).
FieldTypeDefault valueDescription
formatAoqVideoPixelFormatAoqVideoPixelFormatUnknownPixel format
widthNSInteger0Width in pixels
heightNSInteger0Height in pixels
dataNSData *nilPacked-format data (NV12/NV21/BGRA/RGBA) (@Nullable)
dataYNSData *nilI420 Y plane data (@Nullable)
dataUNSData *nilI420 U plane data (@Nullable)
dataVNSData *nilI420 V plane data (@Nullable)
strideYNSInteger0Y plane stride
strideUNSInteger0U plane stride
strideVNSInteger0V plane stride
pixelBufferCVPixelBufferRefNULLApple zero-copy buffer. Used when format=AoqVideoPixelFormatCVPixelBuffer (@Nullable).
timeStampint64_t0Timestamp in milliseconds. If 0, the SDK fills it in using the local clock.
iOS has no textureId/transformMatrix/eglContext fields. Use pixelBuffer for zero-copy access.

AoqVideoCodecType

Codec type for externally encoded frames.
Enum valueValueDescription
AoqVideoCodecTypeJPEG0JPEG encoding

AoqVideoEncodedFrame

Externally encoded video frame. The application encodes the frame; the SDK packages and sends it without re-encoding.
FieldTypeDefault valueDescription
codecAoqVideoCodecTypeAoqVideoCodecTypeJPEGEncoding format
dataNSData *Non-emptyEncoded data
widthNSInteger0Width in pixels
heightNSInteger0Height in pixels
timeStampint64_t0Timestamp in milliseconds. If 0, the SDK fills it in using the local clock.

AoqVideoDeviceStateCode

Video device capture state codes.
Enum valueValueDescription
AoqVideoDeviceNone0No state
AoqVideoDeviceCaptureStarting1Camera starting
AoqVideoDeviceCaptureStarted2Camera started
AoqVideoDeviceCaptureStopping3Camera stopping
AoqVideoDeviceCaptureStopped4Camera stopped
AoqVideoDeviceCaptureFail5Camera startup failed

AoqVideoDeviceState

Video device capture state.
FieldTypeDefault valueDescription
stateAoqVideoDeviceStateCodeAoqVideoDeviceNoneDevice capture state
reasonNSInteger0Error reason code (see AoqErrorCode)

Video frame callback types

AoqVideoSource

Video frame callback data sources (pipeline positions).
Enum valueValueDescription
AoqVideoSourceCaptured0Video data after capture (before preprocessing)
AoqVideoSourcePreEncode1Video data before encoding (after preprocessing)
AoqVideoSourceRemote2Remote video data after decoding and before rendering

AoqVideoObserverMode

Video frame callback modes.
Enum valueValueDescription
AoqVideoObserverModeReadOnly0Read-only mode
AoqVideoObserverModeReadWrite1Read-write mode

AoqVideoObserverAlignment

Video output width alignment.
Enum valueValueDescription
AoqVideoObserverAlignmentDefault0Default alignment
AoqVideoObserverAlignmentEven1Even alignment
AoqVideoObserverAlignment424-byte alignment
AoqVideoObserverAlignment838-byte alignment
AoqVideoObserverAlignment16416-byte alignment

AoqVideoObserverConfig

Video frame callback configuration.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAoqTrackTypeVideoVideo track to observe. Only Video and Screen are supported.
formatAoqVideoPixelFormatAoqVideoPixelFormatI420Desired callback pixel format
alignmentAoqVideoObserverAlignmentAoqVideoObserverAlignmentDefaultWidth alignment policy
modeAoqVideoObserverModeAoqVideoObserverModeReadOnlyRead/write mode. Only I420/CVPixelBuffer supports read-write access.
mirrorAppliedBOOLNOWhether to mirror callback data

Data message types

AoqDataMsg

Real-time message data structure.
FieldTypeDefault valueDescription
dataNSData *Empty NSDataMessage data referencing memory owned by the caller

Statistics types

AoqStats

Field

Type

Description

audioPublishStats

NSArray<AoqAudioPublishStats *> *

Audio publish statistics

videoPublishStats

NSArray<AoqVideoPublishStats *> *

Video publish statistics

dataMsgPublishStats

NSArray<AoqDataMsgPublishStats *> *

Data message publish statistics

audioSubscribeStats

NSArray<AoqAudioSubscribeStats *> *

Audio subscribe statistics

videoSubscribeStats

NSArray<AoqVideoSubscribeStats *> *

Video subscribe statistics

dataMsgSubscribeStats

NSArray<AoqDataMsgSubscribeStats *> *

Data message subscribe statistics

networkStats

AoqNetworkStats *

Network statistics

AoqNetworkStats

Field

Type

Description

sendBitrate

NSUInteger

Send bitrate (bps)

sendBytes

NSUInteger

Cumulative bytes sent

recvBitrate

NSUInteger

Receive bitrate (bps)

recvBytes

NSUInteger

Cumulative bytes received

loss

NSUInteger

Packet loss rate

rtt

NSUInteger

Round-trip time (ms)

AoqAudioPublishStats

Audio publishing statistics.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate in bps
bytesNSUIntegerTotal bytes sent
encodeVolumeNSUIntegerPublishing encoding volume

AoqVideoPublishStats

Video publishing statistics.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate in bps
bytesNSUIntegerTotal bytes sent
encodeFpsNSUIntegerEncoding frame rate

AoqAudioSubscribeStats

Audio subscription statistics.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate in bps
bytesNSUIntegerTotal bytes received
playVolumeNSUIntegerPlayback volume

AoqVideoSubscribeStats

Video subscription statistics.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate in bps
bytesNSUIntegerTotal bytes received
decodeFpsNSUIntegerDecoding frame rate
renderFpsNSUIntegerRendering frame rate

AoqDataMsgPublishStats

Data message publishing statistics.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate in bps
bytesNSUIntegerTotal bytes sent

AoqDataMsgSubscribeStats

Data message subscription statistics.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate in bps
bytesNSUIntegerTotal bytes received
Text Generation
Image Generation
Video Generation
World models
Audio
  • Audio generation
Text Embedding
Decision Model
TokenPlan
Model Production