Type definition
This page lists all the type definitions of the macOS API.
AgoraAreaCodeType
The region for connection, which is the region where the server the SDK connects to is located.
Enumerator
- AgoraAreaCodeTypeCN
- Mainland China.
- AgoraAreaCodeTypeNA
- North America.
- AgoraAreaCodeTypeEUR
- Europe.
- AgoraAreaCodeTypeAS
- Asia, excluding Mainland China.
- AgoraAreaCodeTypeJP
- Japan.
- AgoraAreaCodeTypeIN
- India.
- AgoraAreaCodeTypeGlobal
- Global.
AgoraAudienceLatencyLevelType
The latency level of an audience member in interactive live streaming. This enum takes effect only when the user role is set to AgoraClientRoleAudience .
Enumerator
- AgoraAudienceLatencyLevelLowLatency
- 1: Low latency.
- AgoraAudienceLatencyLevelUltraLowLatency
- 2: (Default) Ultra low latency.
AgoraAudioCodecProfileType
Self-defined audio codec profile.
Enumerator
- AgoraAudioCodecProfileLCAAC
- 0: (Default) LC-AAC.
- AgoraAudioCodecProfileHEAAC
- 1: HE-AAC.
- AgoraAudioCodecProfileHEAACv2
- 2: HE-AAC v2.
AgoraAudioCodecType
The codec type of audio.
Enumerator
- AgoraAudioCodecTypeOPUS
- 1: OPUS.
- AgoraAudioCodecTypeAACLC
- 8: LC-AAC.
- AgoraAudioCodecTypeHEAAC
- 9: HE-AAC.
- AgoraAudioCodecTypeHEAAC2
- 11: HE-AAC v2.
AgoraAudioDualMonoMode
The channel mode.
Enumerator
- AgoraAudioDuraMonoStereo
- 0: Original mode.
- AgoraAudioDualMonoL
- 1: Left channel mode. This mode replaces the audio of the right channel with the audio of the left channel, which means the user can only hear the audio of the left channel.
- AgoraAudioDualMonoR
- 2: Right channel mode. This mode replaces the audio of the left channel with the audio of the right channel, which means the user can only hear the audio of the right channel.
- AgoraAudioDualMonoMix
- 3: Mixed channel mode. This mode mixes the audio of the left channel and the right channel, which means the user can hear the audio of the left channel and the right channel at the same time.
AgoraAudioEffectPreset
Preset audio effects.
Preset audio effects | profile |
---|---|
|
AgoraAudioProfileMusicHighQualityStereo or AgoraAudioProfileMusicStandardStereo |
Other preset audio effects (except for AgoraAudioEffectPresetOff) | AgoraAudioProfileMusicHighQuality or AgoraAudioProfileMusicHighQualityStereo |
Enumerator
- AgoraAudioEffectPresetOff
- Turn off voice effects, that is, use the original voice.
- AgoraAudioEffectPresetRoomAcousticsKTV
- The voice effect typical of a KTV venue.
- AgoraAudioEffectPresetRoomAcousVocalConcer
- The voice effect typical of a concert hall.
- AgoraAudioEffectPresetRoomAcousStudio
- The voice effect typical of a recording studio.
- AgoraAudioEffectPresetRoomAcousPhonograph
- The voice effect typical of a vintage phonograph.
- AgoraAudioEffectPresetRoomAcousVirtualStereo
- The virtual stereo effect, which renders monophonic audio as stereo audio.
- AgoraAudioEffectPresetRoomAcousSpatial
- A more spatial voice effect.
- AgoraAudioEffectPresetRoomAcousEthereal
- A more ethereal voice effect.
- AgoraAudioEffectPresetRoomAcousVirtualSurroundSound
- Virtual surround sound, that is, the SDK generates a simulated surround sound field on the basis of stereo channels, thereby creating a surround sound effect.Attention: If the virtual surround sound is enabled, users need to use stereo audio playback devices to hear the anticipated audio effect.
- AgoraAudioEffectPresetRoomAcous3DVoice
-
A 3D voice effect that makes the voice appear to be moving around the user. The default cycle period is 10 seconds. After setting this effect, you can call setAudioEffectParameters to modify the movement period.
Attention: If the 3D voice effect is enabled, users need to use stereo audio playback devices to hear the anticipated voice effect. - AgoraAudioEffectPresetVoiceChangerEffectUncle
-
A middle-aged man's voice.
Attention: Agora recommends using this preset to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect. - AgoraAudioEffectPresetVoiceChangerEffectOldMan
-
An older man's voice.
Attention: Agora recommends using this preset to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect. - AgoraAudioEffectPresetVoiceChangerEffectBoy
-
A boy's voice.
Attention: Agora recommends using this preset to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect. - AgoraAudioEffectPresetVoiceChangerEffectSister
-
A young woman's voice.
Attention: Agora recommends using this preset to process a female-sounding voice; otherwise, you may not hear the anticipated voice effect. - AgoraAudioEffectPresetVoiceChangerEffectGirl
-
A girl's voice.
Attention: Agora recommends using this preset to process a female-sounding voice; otherwise, you may not hear the anticipated voice effect. - AgoraAudioEffectPresetVoiceChangerEffectPigKin
- The voice of Pig King, a character in Journey to the West who has a voice like a growling bear.
- AgoraAudioEffectPresetVoiceChangerEffectHulk
- The Hulk's voice.
- AgoraAudioEffectPresetStyleTransformationRnb
- The voice effect typical of R&B music.
- AgoraAudioEffectPresetStyleTransformationPopular
- The voice effect typical of popular music.
- AgoraAudioEffectPresetPitchCorrection
- A pitch correction effect that corrects the user's pitch based on the pitch of the natural C major scale. After setting this voice effect, you can call setAudioEffectParameters to adjust the basic mode of tuning and the pitch of the main tone.
AgoraAudioEncodedFrameDelegatePosition
Audio profile.
Enumerator
- AgoraAudioEncodedFrameObserverPositionRecord
- 1: Only records the audio of the local user.
- AgoraAudioEncodedFrameObserverPositionPlayback
- 2: Only records the audio of all remote users.
- AgoraAudioEncodedFrameObserverPositionMixed
- 3: Records the mixed audio of the local and all remote users.
AgoraAudioEncodingType
Audio encoding type.
Enumerator
- AgoraAudioEncodingTypeAAC16000Low
- AAC encoding format, 16000 Hz sampling rate, bass quality. A file with an audio duration of 10 minutes is approximately 1.2 MB after encoding.
- AgoraAudioEncodingTypeAAC16000Medium
- AAC encoding format, 16000 Hz sampling rate, medium sound quality. A file with an audio duration of 10 minutes is approximately 2 MB after encoding.
- AgoraAudioEncodingTypeAAC32000Low
- AAC encoding format, 32000 Hz sampling rate, bass quality. A file with an audio duration of 10 minutes is approximately 1.2 MB after encoding.
- AgoraAudioEncodingTypeAAC32000Medium
- AAC encoding format, 32000 Hz sampling rate, medium sound quality. A file with an audio duration of 10 minutes is approximately 2 MB after encoding.
- AgoraAudioEncodingTypeAAC32000High
- AAC encoding format, 32000 Hz sampling rate, high sound quality. A file with an audio duration of 10 minutes is approximately 3.5 MB after encoding.
- AgoraAudioEncodingTypeAAC48000Medium
- AAC encoding format, 48000 Hz sampling rate, medium sound quality. A file with an audio duration of 10 minutes is approximately 2 MB after encoding.
- AgoraAudioEncodingTypeAAC48000High
- AAC encoding format, 48000 Hz sampling rate, high sound quality. A file with an audio duration of 10 minutes is approximately 3.5 MB after encoding.
- AgoraAudioEncodingTypeOPUS16000Low
- OPUS encoding format, 16000 Hz sampling rate, bass quality. A file with an audio duration of 10 minutes is approximately 2 MB after encoding.
- AgoraAudioEncodingTypeOPUS6000Medium
- OPUS encoding format, 16000 Hz sampling rate, medium sound quality. A file with an audio duration of 10 minutes is approximately 2 MB after encoding.
- AgoraAudioEncodingTypeOPUS48000Medium
- OPUS encoding format, 48000 Hz sampling rate, medium sound quality. A file with an audio duration of 10 minutes is approximately 2 MB after encoding.
- AgoraAudioEncodingTypeOPUS48000High
- OPUS encoding format, 48000 Hz sampling rate, high sound quality. A file with an audio duration of 10 minutes is approximately 3.5 MB after encoding.
AgoraAudioEqualizationBandFrequency
The midrange frequency for audio equalization.
Enumerator
- AgoraAudioEqualizationBand31
- 0: 31 Hz
- AgoraAudioEqualizationBand62
- 1: 62 Hz
- AgoraAudioEqualizationBand125
- 2: 125 Hz
- AgoraAudioEqualizationBand250
- 3: 250 Hz
- AgoraAudioEqualizationBand500
- 4: 500 Hz
- AgoraAudioEqualizationBand1K
- 5: 1 kHz
- AgoraAudioEqualizationBand2K
- 6: 2 kHz
- AgoraAudioEqualizationBand4K
- 7: 4 kHz
- AgoraAudioEqualizationBand8K
- 8: 8 kHz
- AgoraAudioEqualizationBand16K
- 9: 16 kHz
AgoraAudioFileRecordingType
Recording content. Set in startAudioRecording [2/2].
Enumerator
- AgoraAudioFileRecordingTypeMic
- 1: Only records the audio of the local user.
- AgoraAudioFileRecordingTypePlayback
- 2: Only records the audio of all remote users.
- AgoraAudioFileRecordingTypeMixed
- 3: Records the mixed audio of the local and all remote users.
AgoraAudioMixingDualMonoMode
The channel mode.
Enumerator
- AgoraAudioMixingDualMonoAuto
- 0: Original mode.
- AgoraAudioMixingDualMonoL
- 1: Left channel mode. This mode replaces the audio of the right channel with the audio of the left channel, which means the user can only hear the audio of the left channel.
- AgoraAudioMixingDualMonoR
- 2: Right channel mode. This mode replaces the audio of the left channel with the audio of the right channel, which means the user can only hear the audio of the right channel.
- AgoraAudioMixingDualMonoMix
- 3: Mixed channel mode. This mode mixes the audio of the left channel and the right channel, which means the user can hear the audio of the left channel and the right channel at the same time.
AgoraAudioMixingReasonCode
The reason why the playback state of the music file changes. Reported in the audioMixingStateChanged callback.
Enumerator
- AgoraAudioMixingReasonTypeOk
- 0: The SDK opens music file successfully.
- AgoraAudioMixingReasonTypeCanNotOpen
- 701: The SDK cannot open the music file. For example, the local music file does not exist, the SDK does not support the file format, or the the SDK cannot access the music file URL.
- AgoraAudioMixingReasonTypeTooFrequentlyCall
- 702: The SDK opens the music file too frequently. If you need to call startAudioMixing multiple times, ensure that the call interval is more than 500 ms.
- AgoraAudioMixingReasonTypeInterruptedEOF
- 703: The music file playback is interrupted.
- AgoraAudioMixingReasonOneLoopCompleted
- 721: The music file completes a loop playback.
- AgoraAudioMixingReasonAllLoopsCompleted
- 723: The music file completes all loop playback.
- AgoraAudioMixingReasonStoppedByUser
- 724: Successfully call stopAudioMixing to stop playing the music file.
AgoraAudioMixingStateType
The playback state of the music file.
Enumerator
- AgoraAudioMixingStateTypePlaying
-
710: The music file is playing.
- AgoraAudioMixingStateTypePaused
-
711: The music file pauses playing.
- AgoraAudioMixingStateTypeStopped
-
713: The music file stops playing.
The possible reasons include:- AgoraAudioMixingReasonAllLoopsCompleted(723)
- AgoraAudioMixingReasonStoppedByUser(724)
- AgoraAudioMixingStateTypeFailed
-
714: An error occurs during the playback of the audio mixing file.
The possible reasons include:- AgoraAudioMixingReasonTypeCanNotOpen(701)
- AgoraAudioMixingReasonTypeTooFrequentlyCall(702)
- AgoraAudioMixingReasonTypeInterruptedEOF(703)
AgoraAudioProfile
The audio profile.
Enumerator
- AgoraAudioProfileDefault
-
0: The default audio profile.
- For the interactive streaming profile: A sample rate of 48 kHz, music encoding, mono, and a bitrate of up to 64 Kbps.
- For the communication profile: A sample rate of 32 kHz, audio encoding, mono, and a bitrate of up to 18 Kbps.
- AgoraAudioProfileSpeechStandard
- 1: A sample rate of 32 kHz, audio encoding, mono, and a bitrate of up to 18 Kbps.
- AgoraAudioProfileMusicStandard
- 2: A sample rate of 48 kHz, music encoding, mono, and a bitrate of up to 64 Kbps.
- AgoraAudioProfileMusicStandardStereo
- AgoraAudioProfileMusicHighQuality
- 4: A sample rate of 48 kHz, music encoding, mono, and a bitrate of up to 96 Kbps.
- AgoraAudioProfileMusicHighQualityStereo
- AgoraAudioProfileIot
-
6: A sample rate of 16 kHz, audio encoding, mono, and Acoustic Echo Cancellation (AES) enabled.
- Enumerator boundary.
AgoraAudioRecordingQuality
Recording quality.
Enumerator
- AgoraAudioRecordingQualityLow
- 0: Low quality. The sample rate is 32 kHz, and the file size is around 1.2 MB after 10 minutes of recording.
- AgoraAudioRecordingQualityMedium
- 1: Medium quality. The sample rate is 32 kHz, and the file size is around 2 MB after 10 minutes of recording.
- AgoraAudioRecordingQualityHigh
- 2: High quality. The sample rate is 32 kHz, and the file size is around 3.75 MB after 10 minutes of recording.
- AgoraAudioRecordingQualityUltraHigh
- 3: Ultra high quality. The sample rate is 32 kHz, and the file size is around 7.5 MB after 10 minutes of recording.
AgoraAudioReverbPreset
Voice reverb presets.
- Deprecated:
- Deprecated as of v3.2.0.
Enumerator
- AgoraAudioReverbPresetOff
- Turn off voice reverb, that is, to use the original voice.
- AgoraAudioReverbPresetFxKTV
- The reverb style typical of a KTV venue (enhanced).
- AgoraAudioReverbPresetFxVocalConcert
- The reverb style typical of a concert hall (enhanced).
- AgoraAudioReverbPresetFxUncle
- A middle-aged man's voice.
- AgoraAudioReverbPresetFxSister
- The reverb style typical of a young woman's voice.
- AgoraAudioReverbPresetFxStudio
- The reverb style typical of a recording studio (enhanced).
- AgoraAudioReverbPresetFxPopular
- The reverb style typical of popular music (enhanced).
- AgoraAudioReverbPresetFxRNB
- The reverb style typical of R&B music (enhanced).
- AgoraAudioReverbPresetFxPhonograph
- The voice effect typical of a vintage phonograph.
AgoraAudioReverbType
Audio reverberation types.
Enumerator
- AgoraAudioReverbDryLevel
- 0: The level of the dry signal (dB). The value is between -20 and 10.
- AgoraAudioReverbWetLevel
- 1: The level of the early reflection signal (wet signal) (dB). The value is between -20 and 10.
- AgoraAudioReverbRoomSize
- 2: The room size of the reflection. The value is between 0 and 100.
- AgoraAudioReverbWetDelay
- 3: The length of the initial delay of the wet signal (ms). The value is between 0 and 200.
- AgoraAudioReverbStrength
- 4: The reverberation strength. The value is between 0 and 100.
AgoraAudioOutputRouting
The type of the audio route.
Enumerator
- AgoraAudioOutputRoutingDefault
- -1: The default audio route.
- AgoraAudioOutputRoutingHeadset
- 0: Audio output routing is a headset with microphone.
- AgoraAudioOutputRoutingEarpiece
- 1: The audio route is an earpiece.
- AgoraAudioOutputRoutingHeadsetNoMic
- 2: The audio route is a headset without a microphone.
- AgoraAudioOutputRoutingSpeakerphone
- 3: The audio route is the speaker that comes with the device.
- AgoraAudioOutputRoutingLoudspeaker
- 4: The audio route is an external speaker.
- AgoraAudioOutputRoutingHeadsetBluetooth
- 5: The audio route is a bluetooth headset.
- AgoraAudioOutputRoutingHdmi
- 6: The audio route is an HDMI peripheral device.
- AgoraAudioOutputRoutingUsb
- 7: The audio route is a USB peripheral device.
- AgoraAudioOutputRoutingDisplayPort
- 8: The audio route is a DisplayPort peripheral device.
- AgoraAudioOutputRoutingAirPlay
- 9: The audio route is Apple AirPlay.
AgoraAudioSampleRateType
The audio sampling rate of the stream to be pushed to the CDN.
Enumerator
- AgoraAudioSampleRateType32000
- 32000: 32 kHz
- AgoraAudioSampleRateType44100
- 44100: 44.1 kHz
- AgoraAudioSampleRateType48000
- 48000: (Default) 48 kHz
AgoraAudioScenario
The audio scenarios.
Enumerator
- AgoraAudioScenarioDefault
- 0: (Default) Automatic scenario match, where the SDK chooses the appropriate audio quality according to the user role and audio route.
- AgoraAudioScenarioGameStreaming
- 3: High-quality audio scenario, where users mainly play music.
- AgoraAudioScenarioChatRoom
- 5: Chatroom scenario, where users need to frequently switch the user role or mute and unmute the microphone. In this scenario, audience members receive a pop-up window to request permission of using microphones.
- AgoraAudioScenarioChorus
- 7: Real-time chorus scenario, where users have good network conditions and require ultra-low latency.
- AgoraAudioScenarioMeeting
- 8: Meeting scenario that mainly contains the human voice.
AgoraAudioSessionOperationRestriction
The operation permissions of the SDK on the audio session.
Enumerator
- AgoraAudioSessionOperationRestrictionNone
- No restriction, the SDK can change the audio session.
- AgoraAudioSessionOperationRestrictionSetCategory
- The SDK cannot change the audio session category.
- AgoraAudioSessionOperationRestrictionConfigureSession
- The SDK cannot change the audio session category, mode, or categoryOptions.
- AgoraAudioSessionOperationRestrictionDeactivateSession
- The SDK keeps the audio session active when the user leaves the channel, for example, to play an audio file in the background.
- AgoraAudioSessionOperationRestrictionAll
- Completely restricts the operation permissions of the SDK on the audio session; the SDK cannot change the audio session.
AgoraVirtualBackgroundSourceType
The type of the custom background image.
Enumerator
- AgoraVirtualBackgroundColor
- 1: (Default) The background image is a solid color.
- AgoraVirtualBackgroundImg
- The background image is a file in PNG or JPG format.
- AgoraVirtualBackgroundBlur
- The background image is the blurred background.
AgoraBlurDegree
The degree of blurring applied to the custom background image.
Enumerator
- AgoraBlurLow
- 1: The degree of blurring applied to the custom background image is low. The user can almost see the background clearly.
- AgoraBlurMedium
- The degree of blurring applied to the custom background image is medium. It is difficult for the user to recognize details in the background.
- AgoraBlurHigh
- (Default) The degree of blurring applied to the custom background image is high. The user can barely see any distinguishing features in the background.
AgoraCaptureBrightnessLevelType
The brightness level of the video image captured by the local camera.
Enumerator
- AgoraCaptureBrightnessLevelInvalid
- -1: The SDK does not detect the brightness level of the video image. Wait a few seconds to get the brightness level from captureBrightnessLevel in the next callback.
- AgoraCaptureBrightnessLevelNormal
- 0: The brightness level of the video image is normal.
- AgoraCaptureBrightnessLevelBright
- 1: The brightness level of the video image is too bright.
- AgoraCaptureBrightnessLevelDark
- 2: The brightness level of the video image is too dark.
AgoraChannelMediaRelayError
The error code of the channel media relay.
Enumerator
- AgoraChannelMediaRelayErrorNone
- 0: No error.
- AgoraChannelMediaRelayErrorServerErrorResponse
- 1: An error occurs in the server response.
- AgoraChannelMediaRelayErrorServerNoResponse
-
2: No server response.
You can call leaveChannel [1/2] to leave the channel.
This error can also occur if your project has not enabled co-host token authentication. You can contact technical support to enable the service for cohosting across channels before starting a channel media relay.
- AgoraChannelMediaRelayErrorNoResourceAvailable
- 3: The SDK fails to access the service, probably due to limited resources of the server.
- AgoraChannelMediaRelayErrorFailedJoinSourceChannel
- 4: Fails to send the relay request.
- AgoraChannelMediaRelayErrorFailedJoinDestinationChannel
- 5: Fails to accept the relay request.
- AgoraChannelMediaRelayErrorFailedPacketReceivedFromSource
- 6: The server fails to receive the media stream.
- AgoraChannelMediaRelayErrorFailedPacketSentToDestination
- 7: The server fails to send the media stream.
- AgoraChannelMediaRelayErrorServerConnectionLost
- 8: The SDK disconnects from the server due to poor network connections. You can call leaveChannel [1/2] to leave the channel.
- AgoraChannelMediaRelayErrorInternalError
- 9: An internal error occurs in the server.
- AgoraChannelMediaRelayErrorSourceTokenExpired
- 10: The token of the source channel has expired.
- AgoraChannelMediaRelayErrorDestinationTokenExpired
- 11: The token of the destination channel has expired.
AgoraChannelMediaRelayEvent
The event code of channel media relay.
Enumerator
- AgoraChannelMediaRelayEventDisconnect
- 0: The user disconnects from the server due to a poor network connection.
- AgoraChannelMediaRelayEventConnected
- 1: The user is connected to the server.
- AgoraChannelMediaRelayEventJoinedSourceChannel
- 2: The user joins the source channel.
- AgoraChannelMediaRelayEventJoinedDestinationChannel
- 3: The user joins the destination channel.
- AgoraChannelMediaRelayEventSentToDestinationChannel
- 4: The SDK starts relaying the media stream to the destination channel.
- AgoraChannelMediaRelayEventReceivedVideoPacketFromSource
- 5: The server receives the audio stream from the source channel.
- AgoraChannelMediaRelayEventReceivedAudioPacketFromSource
- 6: The server receives the audio stream from the source channel.
- AgoraChannelMediaRelayEventUpdateDestinationChannel
- 7: The destination channel is updated.
- AgoraChannelMediaRelayEventUpdateDestinationChannelRefused
- 8: The destination channel update fails due to internal reasons.
- AgoraChannelMediaRelayEventUpdateDestinationChannelNotChange
- 9: The destination channel does not change, which means that the destination channel fails to be updated.
- AgoraChannelMediaRelayEventUpdateDestinationChannelIsNil
- 10: The destination channel name is
nil
. - AgoraChannelMediaRelayEventVideoProfileUpdate
- 11: The video profile is sent to the server.
- AgoraChannelMediaRelayEventPauseSendPacketToDestChannelSuccess
- 12: The SDK successfully pauses relaying the media stream to destination channels.
- AgoraChannelMediaRelayEventPauseSendPacketToDestChannelFailed
- 13: The SDK fails to pause relaying the media stream to destination channels.
- AgoraChannelMediaRelayEventResumeSendPacketToDestChannelSuccess
- 14: The SDK successfully resumes relaying the media stream to destination channels.
- AgoraChannelMediaRelayEventResumeSendPacketToDestChannelFailed
- 15: The SDK fails to resume relaying the media stream to destination channels.
AgoraChannelMediaRelayState
The state code of the channel media relay.
Enumerator
- AgoraChannelMediaRelayStateIdle
- 0: The initial state. After you successfully stop the channel media relay by calling stopChannelMediaRelay, the channelMediaRelayStateDidChange callback returns this state.
- AgoraChannelMediaRelayStateConnecting
- 1: The SDK tries to relay the media stream to the destination channel.
- AgoraChannelMediaRelayStateRunning
- 2: The SDK successfully relays the media stream to the destination channel.
- AgoraChannelMediaRelayStateFailure
- 3: An error occurs. See code in channelMediaRelayStateDidChange for the error code.
AgoraChannelProfile
The channel profile.
Enumerator
- AgoraChannelProfileCommunication
- 0: Communication. Use this profile when there are only two users in the channel.
- AgoraChannelProfileLiveBroadcasting
- 1: Live streaming. Live streaming. Use this profile when there are more than two users in the channel.
- AgoraChannelProfileGame
- 2: Gaming. This profile is deprecated.
- AgoraChannelProfileCloudGaming
- Cloud gaming. The scenario is optimized for latency. Use this profile if the use case requires frequent interactions between users.
AgoraCloudProxyType
The cloud proxy type.
Enumerator
- AgoraNoneProxyType
- 0: The automatic mode. The SDK has this mode enabled by default. In this mode, the SDK attempts a direct connection to SD-RTN™ and automatically switches to TCP/TLS 443 if the attempt fails.
- AgoraUdpProxyType
- 1: The cloud proxy for the UDP protocol, that is, the Force UDP cloud proxy mode. In this mode, the SDK always transmits data over UDP.
- AgoraTcpProxyType
- 2: The cloud proxy for the TCP (encryption) protocol, that is, the Force TCP cloud proxy mode. In this mode, the SDK always transmits data over TCP/TLS 443.
AgoraClientRole
The user role in the interactive live streaming.
Enumerator
- AgoraClientRoleBroadcaster
- 1: Host. A host can both send and receive streams.
- AgoraClientRoleAudience
- 2: (Default) Audience. An audience member can only receive streams.
AgoraClientRoleChangeFailedReason
The reason for a user role switch failure.
Enumerator
- AgoraClientRoleChangeFailedTooManyBroadcasters
1: The number of hosts in the channel is already at the upper limit.
Note: This enumerator is reported only when the support for 128 users is enabled. The maximum number of hosts is based on the actual number of hosts configured when you enable the 128-user feature.- AgoraClientRoleChangeFailedNotAuthorized
2: The request is rejected by the Agora server. Agora recommends you prompt the user to try to switch their user role again.
- AgoraClientRoleChangeFailedRequestTimeout
3: The request is timed out. Agora recommends you prompt the user to check the network connection and try to switch their user role again.
- AgoraClientRoleChangeFailedConnectionFailed
4: The SDK connection fails. You can use reason reported in the connectionChangedToState callback to troubleshoot the failure.
AgoraConnectionChangedReason
Reasons causing the change of the connection state.
Enumerator
- AgoraConnectionChangedReasonConnecting
- 0: The SDK is connecting to the Agora edge server.
- AgoraConnectionChangedReasonJoinSuccess
- 1: The SDK has joined the channel successfully.
- AgoraConnectionChangedReasonInterrupted
- 2: The connection between the SDK and the Agora edge server is interrupted.
- AgoraConnectionChangedReasonBannedByServer
- 3: The connection between the SDK and the Agora edge server is banned by the Agora edge server. This error occurs when the user is kicked out of the channel by the server.
- AgoraConnectionChangedReasonJoinFailed
- 4: The SDK fails to join the channel. When the SDK fails to join the channel for more than 20 minutes, this error occurs and the SDK stops reconnecting to the channel.
- AgoraConnectionChangedReasonLeaveChannel
- 5: The SDK has left the channel.
- AgoraConnectionChangedReasonInvalidAppId
- 6: The connection failed because the App ID is not valid. Please rejoin the channel with a valid App ID.
- AgoraConnectionChangedReasonInvalidChannelName
- 7: The connection failed since channel name is not valid. Please rejoin the channel with a valid channel name.
- AgoraConnectionChangedReasonInvalidToken
-
8: The connection failed because the token is not valid. Typical reasons include:
- The App Certificate for the project is enabled in Agora Console, but you do not use a token when joining the channel. If you enable the App Certificate, you must use a token to join the channel.
- The uid specified when calling joinChannelByToken [2/4] to join the channel is inconsistent with the uid passed in when generating the token.
- AgoraConnectionChangedReasonTokenExpired
- 9: The connection failed since token is expired.
- AgoraConnectionChangedReasonRejectedByServer
-
10: The connection is rejected by server. Typical reasons include:
- The user is already in the channel and still calls a method, for example, joinChannelByToken [2/4], to join the channel. Stop calling this method to clear this error.
- The user tries to join the channel when conducting a pre-call test. The user needs to call the channel after the call test ends.
- AgoraConnectionChangedReasonSettingProxyServer
- 11: The connection state changed to reconnecting because the SDK has set a proxy server.
- AgoraConnectionChangedReasonRenewToken
- 12: The connection state changed because the token is renewed.
- AgoraConnectionChangedReasonClientIpAddressChanged
- 13: The IP address of the client has changed, possibly because the network type, IP address, or port has been changed.
- AgoraConnectionChangedReasonKeepAliveTimeout
- 14: Timeout for the keep-alive of the connection between the SDK and the Agora edge server. The connection state changes to .
- AgoraConnectionChangedReasonRejoinSuccess
- 15: The SDK has rejoined the channel successfully.
- AgoraConnectionChangedReasonLost
- 16: The connection between the SDK and the server is lost.
- AgoraConnectionChangedReasonEchoTest
- 17: The connection state changes due to the echo test.
AgoraConnectionState
Connection states.
Enumerator
- AgoraConnectionStateDisconnected
-
1: The SDK is disconnected from the Agora edge server. The state indicates the SDK is in one of the following phases:
- Theinitial state before calling the joinChannelByToken [2/4] method.
- The app calls the leaveChannel [1/2] method.
- AgoraConnectionStateConnecting
-
2: The SDK is connecting to the Agora edge server. This state indicates that the SDK is establishing a connection with the specified channel after the app calls joinChannelByToken [2/4].
- If the SDK successfully joins the channel, it triggers the connectionChangedToState callback and the connection state switches to AgoraConnectionStateConnected.
- After the connection is established, the SDK also initializes the media and triggers didJoinChannel when everything is ready.
- AgoraConnectionStateConnected
- 3: The SDK is connected to the Agora edge server. This state also indicates that the user has joined a channel and can now publish or subscribe to a media stream in the channel. If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers connectionChangedToState callback, notifying that the current network state becomes AgoraConnectionStateReconnecting.
- AgoraConnectionStateReconnecting
-
4: The SDK keeps reconnecting to the Agora edge server. The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.
- If the SDK cannot rejoin the channel within 10 seconds, it triggers rtcEngineConnectionDidLost, stays in the AgoraConnectionStateReconnecting state, and keeps rejoining the channel.
- If the SDK fails to rejoin the channel 20 minutes after being disconnected from the Agora edge server, the SDK triggers the connectionChangedToState callback, switches to the AgoraConnectionStateFailed state, and stops rejoining the channel.
- AgoraConnectionStateFailed
-
5: The SDK fails to connect to the Agora edge server or join the channel. This state indicates that the SDK stops trying to rejoin the channel. You must call leaveChannel [1/2] to leave the channel.
- You can call joinChannelByToken [2/4] to rejoin the channel.
- If the SDK is banned from joining the channel by the Agora edge server through the RESTful API, the SDK triggers the connectionChangedToState callback.
AgoraContentInspectResult
Content moderation results.
Enumerator
- AgoraContentInspectNeutral
- 1: The image does not contain inappropriate elements.
- AgoraContentInspectSexy
- 2: The image is sexually suggestive.
- AgoraContentInspectPorn
- 3: The image is pornographic.
AgoraContentInspectType
The type of video content moderation module.
Enumerator
- AgoraContentInspectTypeInvalid
- 0: (Default) This module has no actual function. Do not set type to this value.
- AgoraContentInspectTypeModeration
- 1: Video content moderation. SDK takes screenshots, inspects video content of the video stream in the channel, and uploads the screenshots and moderation results.
- AgoraContentInspectTypeSupervise
- 2: Screenshot capture. SDK takes screenshots of the video stream in the channel and uploads them.
AgoraDegradationPreference
Video degradation preferences when the bandwidth is a constraint.
Enumerator
- AgoraDegradationMaintainQuality
-
0: (Default) Prefers to reduce the video frame rate while maintaining video quality during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized.
Attention: In the COMMUNICATION channel profile, the resolution of the video sent may change, so remote users need to handle this issue. See videoSizeChangedOfUid. - AgoraDegradationMaintainFramerate
- 1: Prefers to reduce the video quality while maintaining the video frame rate during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where smoothness is prioritized and video quality is allowed to be reduced.
- AgoraDegradationBalanced
-
2: Reduces the video frame rate and video quality simultaneously during video encoding under limited bandwidth. The AgoraDegradationBalanced has a lower reduction than AgoraDegradationMaintainQuality and AgoraDegradationMaintainFramerate, and this preference is suitable for scenarios where both smoothness and video quality are a priority.
Attention: The resolution of the video sent may change, so remote users need to handle this issue. See videoSizeChangedOfUid. - AgoraDegradationMaintainResolution
- 3: When the bandwidth is limited, the video frame rate is preferentially reduced during video encoding.
AgoraEarMonitoringFilterType
The audio filter of in-ear monitoring.
Enumerator
- AgoraEarMonitoringFilterNone
-
1<<0: Do not add an audio filter to the in-ear monitor.
- AgoraEarMonitoringFilterBuiltInAudioFilters
-
1<<1: Add an audio filter to the in-ear monitor. If you implement functions such as voice beautifier and audio effect, users can hear the voice after adding these effects.
- AgoraEarMonitoringFilterNoiseSuppression
-
1<<2: Enable noise suppression to the in-ear monitor.
AgoraEncryptionErrorType
Encryption error type.
Enumerator
- ENCRYPTION_ERROR_INTERNAL_FAILURE
- 0: Internal reason.
- ENCRYPTION_ERROR_DECRYPTION_FAILURE
- 1: Decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
- ENCRYPTION_ERROR_ENCRYPTION_FAILURE
- 2: Encryption errors.
AgoraEncryptionMode
The built-in encryption mode.
Agora recommends using AgoraEncryptionModeAES128GCM2 or AgoraEncryptionModeAES256GCM2 encrypted mode. These two modes support the use of salt for higher security.
Enumerator
- AgoraEncryptionModeAES128XTS
- 1: 128-bit AES encryption, XTS mode.
- AgoraEncryptionModeAES128ECB
- 2: 128-bit AES encryption, ECB mode.
- AgoraEncryptionModeAES256XTS
- 3: 256-bit AES encryption, XTS mode.
- AgoraEncryptionModeSM4128ECB
- 4: 128-bit SM4 encryption, ECB mode.
- AgoraEncryptionModeAES128GCM
- 5: 128-bit AES encryption, GCM mode.
- AgoraEncryptionModeAES256GCM
- 6: 256-bit AES encryption, GCM mode.
- AgoraEncryptionModeAES128GCM2
- 7: (Default) 128-bit AES encryption, GCM mode. This encryption mode requires the setting of salt (
encryptionKdfSalt
). - AgoraEncryptionModeAES256GCM2
- 8: 256-bit AES encryption, GCM mode. This encryption mode requires the setting of salt (
encryptionKdfSalt
). - AgoraEncryptionModeEnd
- Enumerator boundary.
AgoraErrorCode
Error codes.
An error code indicates that the SDK encountered an unrecoverable error that requires application intervention. For example, an error is returned when the camera fails to open, and the app needs to inform the user that the camera cannot be used.
Enumerator
- AgoraErrorCodeNoError
- 0: No error.
- AgoraErrorCodeFailed
- 1: General error with no classified reason. Try calling the method again.
- AgoraErrorCodeInvalidArgument
- 2: An invalid parameter is used. For example, the specified channel name includes illegal characters. Reset the parameter.
- AgoraErrorCodeNotReady
- 3: The SDK is not ready. Possible reasons include the following:
- The initialization of AgoraRtcEngineKit fails. Reinitialize the AgoraRtcEngineKit.
- No user has joined the channel when the method is called. Check the code logic.
- The user has not left the channel when the rate or complain method is called. Check the code logic.
- The audio module is disabled.
- The program is not complete.
- AgoraErrorCodeNotSupported
- 4: AgoraRtcEngineKit does not support the request. Possible reasons include the following:
- The built-in encryption mode is incorrect, or the SDK fails to load the external encryption library. Check the encryption mode setting, or reload the external encryption library.
- AgoraErrorCodeRefused
- 5: The request is rejected. Possible reasons include the following:
- The AgoraRtcEngineKit initialization fails. Reinitialize the AgoraRtcEngineKit.
- The channel name is set as the empty string
""
when joining the channel. Reset the channel name. - When the joinChannelExByToken method is called to join multiple channels, the specified channel name is already in use. Reset the channel name.
- AgoraErrorCodeBufferTooSmall
- 6: The buffer size is insufficient to store the returned data.
- AgoraErrorCodeNotInitialized
- 7: A method is called before the initialization of AgoraRtcEngineKit. Ensure that the AgoraRtcEngineKit object is initialized before using this method.
- AgoraErrorCodeNoPermission
- 9: Permission to access is not granted. Check whether your app has access to the audio and video device.
- AgoraErrorCodeTimedOut
- 10: A timeout occurs. Some API calls require the SDK to return the execution result. This error occurs if the SDK takes too long (more than 10 seconds) to return the result.
- AgoraErrorCodeJoinChannelRejected
- 17: The request to join the channel is rejected. Possible reasons include the following:
- The user is already in the channel. Agora recommends using the connectionChangedToState callback to get whether the user is in the channel. Do not call this method to join the channel unless you receive the AgoraConnectionStateDisconnected(1) state.
- After calling startEchoTestWithInterval for the call test, the user tries to join the channel without calling stopEchoTest to end the current test. To join a channel, the call test must be ended by calling stopEchoTest.
- AgoraErrorCodeLeaveChannelRejected
- 18: Fails to leave the channel. Possible reasons include the following:
- The user has left the channel before calling the leaveChannel [1/2] method. Stop calling this method to clear this error.
- The user calls the leaveChannel [1/2] method to leave the channel before joining the channel. In this case, no extra operation is needed.
- AgoraErrorCodeAlreadyInUse
- 19: Resources are already in use.
- AgoraErrorCodeAbort
- 20: The request is abandoned by the SDK, possibly because the request has been sent too frequently.
- AgoraErrorCodeInitNetEngine
- 21: The AgoraRtcEngineKit fails to initialize and has crashed because of specific Windows firewall settings.
- AgoraErrorCodeResourceLimited
- 22: The SDK fails to allocate resources because your app uses too many system resources or system resources are insufficient.
- AgoraErrorCodeInvalidAppId
- 101: The specified App ID is invalid. Rejoin the channel with a valid App ID.
- AgoraErrorCodeInvalidChannelId
- 102: The specified channel name is invalid. A possible reason is that the parameter's data type is incorrect. Rejoin the channel with a valid channel name.
- AgoraErrorCodeTokenExpired
- 109: The current token has expired. Apply for a new token on the server and call renewToken.
- Deprecated:
- This enumerator is deprecated. Use AgoraConnectionChangedReasonTokenExpired(9) in the connectionChangedToState callback instead.
- AgoraErrorCodeInvalidToken
- 110: Invalid token Typical reasons include the following:
- App Certificate is enabled in Agora Console, but the code still uses App ID for authentication. Once App Certificate is enabled for a project, you must use token-based authentication.
- The
uid
used to generate the token is not the same as the uid used to join the channel.
- Deprecated:
- This enumerator is deprecated. Use AgoraConnectionChangedReasonInvalidToken(8) in the connectionChangedToState callback instead.
- AgoraErrorCodeConnectionInterrupted
- 111: The network connection is interrupted. The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established.
- AgoraErrorCodeConnectionLost
- 112: The network connection is lost. Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.
- AgoraErrorCodeNotInChannel
- 113: The user is not in the channel when calling the sendStreamMessage method.
- AgoraErrorCodeSizeTooLarge
- 114: The data size exceeds 1 KB when calling the sendStreamMessage method.
- AgoraErrorCodeBitrateLimit
- 115: The data bitrate exceeds 6 KB/s when calling the sendStreamMessage method.
- AgoraErrorCodeTooManyDataStreams
- 116: More than five data streams are created when calling the createDataStream [2/2] method.
- AgoraErrorCodeDecryptionFailed
- 120: Decryption fails. The user might have entered an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel.
- AgoraErrorCodeEncryptedStreamNotAllowedPublish
- 130: The SDK does not support pushing encrypted streams to CDN.
- AgoraErrorCodeInvalidUserAccount
- 134: The user account is invalid, possibly because it contains invalid parameters.
- AgoraErrorCodeLoadMediaEngine
- 1001: The SDK fails to load the media engine.
- AgoraErrorCodeAdmGeneralError
- 1005: A general error occurs (no specified reason). Check whether the audio device is already in use by another app, or try rejoining the channel.
- AgoraErrorCodeAdmInitPlayout
- 1008: An error occurs when initializing the playback device. Check whether the playback device is already in use by another app, or try rejoining the channel.
- AgoraErrorCodeAdmStartPlayout
- 1009: An error occurs when starting the playback device. Check the playback device.
- AgoraErrorCodeAdmStopPlayout
- 1010: An error occurs when stopping the playback device.
- AgoraErrorCodeAdmInitRecording
- 1011: An error occurs when initializing the recording device. Check the recording device, or try rejoining the channel.
- AgoraErrorCodeAdmStartRecording
- 1012: An error occurs when starting the recording device. Check the recording device.
- AgoraErrorCodeAdmStopRecording
- 1013: An error occurs when stopping the recording device.
- AgoraErrorCodeVdmCameraNotAuthorized
- 1501: Permission to access the camera is not granted. Check whether permission to access the camera permission is granted.
AgoraExperiencePoorReason
Reasons why the QoE of the local user when receiving a remote audio stream is poor.
Enumerator
- AgoraExperiencePoorReasonNone
- 0: No reason, indicating a good QoE of the local user.
- AgoraExperiencePoorReasonRemoteNetworkQualityPoor
- 1: The remote user's network quality is poor.
- AgoraExperiencePoorReasonLocalNetworkQualityPoor
- 2: The local user's network quality is poor.
- AgoraExperiencePoorReasonWirelessSignalPoor
- 4: The local user's Wi-Fi or mobile network signal is weak.
- AgoraExperiencePoorReasonWifiBluetoothCoexist
- 8: The local user enables both Wi-Fi and bluetooth, and their signals interfere with each other. As a result, audio transmission quality is undermined.
AgoraExperienceQuality
The Quality of Experience (QoE) of the local user when receiving a remote audio stream.
Enumerator
- AgoraExperienceQualityGood
- 0: The QoE of the local user is good.
- AgoraExperienceQualityBad
- 1: The QoE of the local user is poor.
AgoraExternalVideoSourceType
The external video frame encoding type.
Enumerator
- AgoraExternalVideoSourceTypeVideoFrame
- 0: The video frame is not encoded.
- AgoraExternalVideoSourceTypeEncodedVideoFrame
- 1: The video frame is encoded.
AgoraVideoFrameRate
Video frame rate.
Enumerator
- AgoraVideoFrameRateFps1
- 1: 1 fps
- AgoraVideoFrameRateFps7
- 7: 7 fps
- AgoraVideoFrameRateFps10
- 10: 10 fps
- AgoraVideoFrameRateFps15
- 15: 15 fps
- AgoraVideoFrameRateFps24
- 24: 24 fps
- AgoraVideoFrameRateFps30
- 30: 30 fps
- AgoraVideoFrameRateFps60
-
60: 60 fps
Attention: For Windows and macOS only.
AgoraHeadphoneEQPreset
Preset headphone equalizer types.
- Since
- v4.0.1
Enumerator
- AgoraAudioHeadphoneEQPresetOff
- The headphone equalizer is disabled, and the original audio is heard.
- AgoraAudioHeadphoneEQPresetOverear
- An equalizer is used for headphones.
- AgoraAudioHeadphoneEQPresetInear
- An equalizer is used for in-ear headphones.
AgoraLastmileProbeResultState
The status of the last-mile probe test.
Enumerator
- AgoraLastmileProbeResultComplete
- 1: The last-mile network probe test is complete.
- AgoraLastmileProbeResultIncompleteNoBwe
- 2: The last-mile network probe test is incomplete because the bandwidth estimation is not available due to limited test resources. One possible reason is that testing resources are temporarily limited.
- AgoraLastmileProbeResultUnavailable
- 3: The last-mile network probe test is not carried out. Probably due to poor network conditions.
AgoraLighteningContrastLevel
The contrast level.
Enumerator
- AgoraLighteningContrastLow
- 0: Low contrast level.
- AgoraLighteningContrastNormal
- 1: (Default) Normal contrast level.
- AgoraLighteningContrastHigh
- 2: High contrast level.
AgoraAudioLocalError
Local audio state error codes.
Enumerator
- AgoraAudioLocalErrorOK
- 0: The local audio is normal.
- AgoraAudioLocalErrorFailure
- 1: No specified reason for the local audio failure. Remind your users to try to rejoin the channel.
- AgoraAudioLocalErrorDeviceNoPermission
- 2: No permission to use the local audio capturing device. Remind your users to grant permission.
- Deprecated:
- This enumerator is deprecated. Please use AgoraPermissionTypeRecordAudio in the permissionError callback instead.
- AgoraAudioLocalErrorRecordFailure
- 4: The local audio capture fails.
- AgoraAudioLocalErrorEncodeFailure
- 5: The local audio encoding fails.
AgoraAudioLocalState
The state of the local audio.
Enumerator
- AgoraAudioLocalStateStopped
- 0: The local audio is in the initial state.
- AgoraAudioLocalStateRecording
- 1: The local audio capturing device starts successfully.
- AgoraAudioLocalStateEncoding
- 2: The first audio frame encodes successfully.
- AgoraAudioLocalStateFailed
- 3: The local audio fails to start.
AgoraLocalVideoStreamError
Local video state error codes.
Enumerator
- AgoraLocalVideoStreamErrorOK
- 0: The local video is normal.
- AgoraLocalVideoStreamErrorFailure
- 1: No specified reason for the local video failure.
- AgoraLocalVideoStreamErrorDeviceNoPermission
- 2: No permission to use the local video capturing device. Remind the user to grant permissions and rejoin the channel.
- Deprecated:
- This enumerator is deprecated. Please use AgoraPermissionTypeCamera in the permissionError callback instead.
- AgoraLocalVideoStreamErrorDeviceBusy
- 3: The local video capturing device is in use. Remind the user to check whether another application occupies the camera.
- AgoraLocalVideoStreamErrorCaptureFailure
- 4: The local video capture fails. Remind your user to check whether the video capture device is working properly, whether the camera is occupied by another application, or try to rejoin the channel.
- AgoraLocalVideoStreamErrorEncodeFailure
- 5: The local video encoding fails.
- AgoraLocalVideoStreamErrorCaptureDeviceDisconnected
- 9: (macOS only) The video capture device currently in use is disconnected (such as being unplugged).
- AgoraLocalVideoStreamErrorCaptureDeviceInvalidId
- 10: The SDK cannot find the video device in the video device list. Check whether the ID of the video device is valid.
- AgoraLocalVideoStreamErrorScreenCaptureWindowMinimized
- 11: The shared window is minimized when you call startScreenCaptureByWindowId to share a window. The SDK cannot share a minimized window. You can cancel the minimization of this window at the application layer, for example by maximizing this window.
- AgoraLocalVideoStreamErrorScreenCaptureWindowClosed
-
12: The error code indicates that a window shared by the window ID has been closed or a full-screen window shared by the window ID has exited full-screen mode. After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a black screen, Agora recommends that you immediately stop screen sharing.
Common scenarios for reporting this error code:- When the local user closes the shared window, the SDK reports this error code.
- The local user shows some slides in full-screen mode first, and then shares the windows of the slides. After the user exits full-screen mode, the SDK reports this error code.
- The local user watches a web video or reads a web document in full-screen mode first, and then shares the window of the web video or document. After the user exits full-screen mode, the SDK reports this error code.
AgoraVideoLocalState
Local video state types.
Enumerator
- AgoraVideoLocalStateStopped
- 0: The local video is in the initial state.
- AgoraVideoLocalStateCapturing
- 1: The local video capturing device starts successfully.
- AgoraVideoLocalStateEncoding
- 2: The first video frame is successfully encoded.
- AgoraVideoLocalStateFailed
- 3: Fails to start the local video.
AgoraLogFilter
The output log level of the SDK.
Enumerator
- AgoraLogFilterOff
- 0: Do not output any log information.
- AgoraLogFilterDebug
- 0x080f: Output all log information. Set your log filter to this level if you want to get the most complete log file.
- AgoraLogFilterInfo
- 0x000f: Output AgoraLogFilterCritical, AgoraLogFilterError, AgoraLogFilterWarning, and AgoraLogFilterInfo level log information. We recommend setting your log filter to this level.
- AgoraLogFilterWarning
- 0x000e: Output AgoraLogFilterCritical, AgoraLogFilterError, and AgoraLogFilterWarning level log information.
- AgoraLogFilterError
- 0x000c: Output AgoraLogFilterCritical and AgoraLogFilterError level log information.
- AgoraLogFilterCritical
- 0x0008: Output AgoraLogFilterCritical level log information.
AgoraLogLevel
The output log level of the SDK.
Enumerator
- AgoraLogLevelNone
- 0: Do not output any log information.
- AgoraLogLevelInfo
- 0x0001: (Default) Output
FATAL
,ERROR
,WARN
, andINFO
level log information. We recommend setting your log filter to this level. - AgoraLogLevelWarn
- 0x0002: Output
FATAL
,ERROR
, andWARN
level log information. - AgoraLogLevelError
- 0x0004: Output
FATAL
andERROR
level log information. - AgoraLogLevelFatal
- 0x0008: Output
FATAL
level log information.
AgoraMediaDeviceType
Media device types.
Enumerator
- AgoraMediaDeviceTypeAudioUnknown
- -1: Unknown device type.
- AgoraMediaDeviceTypeAudioPlayout
- 0: Audio playback device.
- AgoraMediaDeviceTypeAudioRecording
- 1: Audio capturing device.
- AgoraMediaDeviceTypeVideoRender
- 2: Video renderer.
- AgoraMediaDeviceTypeVideoCapture
- 3: Video capturer.
AgoraMediaPlayerError
Error codes of the media player.
Enumerator
- AgoraMediaPlayerErrorNone
- 0: No error.
- AgoraMediaPlayerErrorInvalidArguments
- -1: Invalid arguments.
- AgoraMediaPlayerErrorInternal
- -2: Internal error.
- AgoraMediaPlayerErrorNoSource
- -3: No resource.
- AgoraMediaPlayerErrorInvalidMediaSource
- -4: Invalid media resource.
- AgoraMediaPlayerErrorUnknowStreamType
- -5: The media stream type is unknown.
- AgoraMediaPlayerErrorObjNotInitialized
- -6: The object is not initialized.
- AgoraMediaPlayerErrorCodecNotSupported
- -7: The codec is not supported.
- AgoraMediaPlayerErrorVideoRenderFailed
- -8: Invalid renderer.
- AgoraMediaPlayerErrorInvalidState
- -9: An error with the internal state of the player occurs.
- AgoraMediaPlayerErrorUrlNotFound
- -10: The URL of the media resource cannot be found.
- AgoraMediaPlayerErrorInvalidConnectState
- -11: Invalid connection between the player and the Agora Server.
- AgoraMediaPlayerErrorSrcBufferUnderflow
- -12: The playback buffer is insufficient.
- AgoraMediaPlayerErrorInterrupted
- -13: The playback is interrupted.
- AgoraMediaPlayerErrorNotSupported
- -14: The SDK does not support the method being called.
- AgoraMediaPlayerErrorUnknown
- -17: An unknown error.
AgoraMediaPlayerEvent
Media player events.
Enumerator
- AgoraMediaPlayerEventSeekBegin
- 0: The player begins to seek to a new playback position.
- AgoraMediaPlayerEventSeekComplete
- 1: The player finishes seeking to a new playback position.
- AgoraMediaPlayerEventSeekError
- 2: An error occurs when seeking to a new playback position.
- AgoraMediaPlayerEventAudioTrackChanged
- 5: The audio track used by the player has been changed.
- AgoraMediaPlayerEventBufferLow
- 6: The currently buffered data is not enough to support playback.
- AgoraMediaPlayerEventBufferRecover
- 7: The currently buffered data is just enough to support playback.
- AgoraMediaPlayerEventFreezeStart
- 8: The audio or video playback freezes.
- AgoraMediaPlayerEventFreezeStop
- 9: The audio or video playback resumes without freezing.
- AgoraMediaPlayerEventSwitchBegin
- 10: The player starts switching the media resource.
- AgoraMediaPlayerEventSwitchComplete
- 11: Media resource switching is complete.
- AgoraMediaPlayerEventSwitchError
- 12: Media resource switching error.
- AgoraMediaPlayerEventFirstDisplayed
- 13: The first video frame is rendered.
- AgoraMediaPlayerEventReachCacheFileMaxCount
- 14: The cached media files reach the limit in number.
- AgoraMediaPlayerEventReachCacheFileMaxSize
- 15: The cached media files reach the limit in aggregate storage space.
AgoraMediaPlayerMetaDataType
The type of media metadata.
Enumerator
- AgoraMediaPlayerMetaDataTypeUnknown
- 0: The type is unknown.
- AgoraMediaPlayerMetaDataTypeSEI
- 1: The type is SEI.
AgoraMediaPlayerRenderMode
Video display modes.
Enumerator
- AgoraMediaPlayerRenderModeHidden
- 1: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Hidden mode. One dimension of the video may have clipped contents.
- AgoraMediaPlayerRenderModeFit
- 2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Fit mode. Areas that are not filled due to disparity in the aspect ratio are filled with black.
AgoraMediaPlayerState
The playback state.
Enumerator
- AgoraMediaPlayerStateIdle
- 0: The default state. The media player returns this state code before you open the media resource or after you stop the playback.
- AgoraMediaPlayerStateOpening
- Opening the media resource.
- AgoraMediaPlayerStateOpenCompleted
- Opens the media resource successfully.
- AgoraMediaPlayerStatePlaying
- The media resource is playing.
- AgoraMediaPlayerStatePaused
- Pauses the playback.
- AgoraMediaPlayerStatePlayBackCompleted
- The playback finishes.
- AgoraMediaPlayerStatePlayBackAllLoopsCompleted
- The loop finishes.
- AgoraMediaPlayerStateStopped
- The playback stops.
- AgoraMediaPlayerStateFailed
- 100: The media player fails to play the media resource.
AgoraMediaRecorderContainerFormat
The format of the recording file.
Enumerator
- AgoraMediaRecorderContainerFormatMP4
- 1: (Default) MP4.
AgoraMediaRecorderStreamType
The recording content.
Enumerator
- AgoraMediaStreamTypeAudio
- Only audio.
- AgoraMediaStreamTypeVideo
- Only video.
- AgoraMediaRecorderStreamTypeBoth
- (Default) Audio and video.
AgoraMediaSourceType
Media source type.
Enumerator
- AgoraMediaSourceTypeAudioPlayout
- 0: Audio playback device.
- AgoraMediaSourceTypeRecording
- 1: Audio capturing device.
- AgoraMediaSourceTypePrimaryCamera
- 2: The primary camera.
- AgoraMediaSourceTypeSecondaryCamera
- 3: The secondary camera.
- AgoraMediaSourceTypeUnknown
- 100: Unknown media source.
AgoraMediaStreamType
The type of the media stream.
Enumerator
- AgoraMediaStreamTypeUnknown
- 0: The type is unknown.
- AgoraMediaStreamTypeVideo
- AgoraMediaRecorderStreamTypeAudio
- 1: The video stream.
- AgoraMediaStreamTypeAudio
- AgoraMediaRecorderStreamTypeVideo
- 2: The audio stream.
- AgoraMediaStreamTypeSubtitle
- 3: The subtitle stream.
AgoraMetadataType
Metadata type of the observer. We only support video metadata for now.
Enumerator
- AgoraMetadataTypeUnknown
- The type of metadata is unknown.
- AgoraMetadataTypeVideo
- The type of metadata is video.
AgoraNetworkType
Network type.
Enumerator
- AgoraNetworkTypeUnknown
- -1: The network type is unknown.
- AgoraNetworkTypeDisconnected
- 0: The SDK disconnects from the network.
- AgoraNetworkTypeLAN
- 1: The network type is LAN.
- AgoraNetworkTypeWIFI
- 2: The network type is Wi-Fi (including hotspots).
- AgoraNetworkType2G
- 3: The network type is mobile 2G.
- AgoraNetworkType3G
- 4: The network type is mobile 3G.
- AgoraNetworkType4G
- 5: The network type is mobile 4G.
- AgoraNetworkType5G
- 6: The network type is mobile 5G.
AgoraVideoOutputOrientationMode
Video output orientation mode.
Enumerator
- AgoraVideoOutputOrientationModeAdaptative
-
0: (Default) The output video always follows the orientation of the captured video. The receiver takes the rotational information passed on from the video encoder. This mode applies to scenarios where video orientation can be adjusted on the receiver.
- If the captured video is in landscape mode, the output video is in landscape mode.
- If the captured video is in portrait mode, the output video is in portrait mode.
- AgoraVideoOutputOrientationModeFixedLandscape
- 1: In this mode, the SDK always outputs videos in landscape (horizontal) mode. If the captured video is in portrait mode, the video encoder crops it to fit the output. Applies to situations where the receiving end cannot process the rotational information. For example, CDN live streaming.
- AgoraVideoOutputOrientationModeFixedPortrait
- 2: In this mode, the SDK always outputs video in portrait (portrait) mode. If the captured video is in landscape mode, the video encoder crops it to fit the output. Applies to situations where the receiving end cannot process the rotational information. For example, CDN live streaming.
AgoraPermissionType
The type of the device permission.
Enumerator
- AgoraPermissionTypeRecordAudio
- 0: Permission for the audio capture device.
- AgoraPermissionTypeCamera
- 1: Permission for the camera.
AgoraMediaPlayerPreloadEvent
Events that occur when media resources are preloaded.
Enumerator
- AgoraMediaPlayerPreloadEventBegin
- 0: Starts preloading media resources.
- AgoraMediaPlayerPreloadEventComplete
- 1: Preloading media resources is complete.
- AgoraMediaPlayerPreloadEventError
- 2: An error occurs when preloading media resources.
AgoraProxyType
The cloud proxy type.
Enumerator
- AgoraNoneProxyType
- 0: Reserved for future use.
- AgoraUdpProxyType
- 1: The cloud proxy for the UDP protocol, that is, the Force UDP cloud proxy mode. In this mode, the SDK always transmits data over UDP.
- AgoraTcpProxyType·
- 2: The cloud proxy for the TCP (encryption) protocol, that is, the Force TCP cloud proxy mode. In this mode, the SDK always transmits data over TCP/TLS 443.
- AgoraLocalProxyType
- 3: Reserved for future use.
- AgoraTcpProxyAutoFallbackType
- 4: Automatic mode. In this mode, the SDK attempts a direct connection to SD-RTN™ and automatically switches to TCP/TLS 443 if the attempt fails.
AgoraVideoQualityAdaptIndication
Quality change of the local video in terms of target frame rate and target bit rate since last count.
Enumerator
- AgoraVideoQualityAdaptNone
- 0: The local video quality stays the same.
- AgoraVideoQualityAdaptUpBandwidth
- 1: The local video quality improves because the network bandwidth increases.
- AgoraVideoQualityAdaptDownBandwidth
- 2: The local video quality deteriorates because the network bandwidth decreases.
AgoraNetworkQuality
Network quality types.
Enumerator
- AgoraNetworkQualityUnknown
- 0: The network quality is unknown.
- AgoraNetworkQualityExcellent
- 1: The network quality is excellent.
- AgoraNetworkQualityGood
- 2: The network quality is quite good, but the bitrate may be slightly lower than excellent.
- AgoraNetworkQualityPoor
- 3: Users can feel the communication is slightly impaired.
- AgoraNetworkQualityBad
- 4: Users cannot communicate smoothly.
- AgoraNetworkQualityVBad
- 5: The quality is so bad that users can barely communicate.
- AgoraNetworkQualityDown
- 6: The network is down and users cannot communicate at all.
AgoraAudioRawFrameOperationMode
The use mode of the audio data.
Enumerator
- AgoraAudioRawFrameOperationModeReadOnly
- 0: Read-only mode, For example, when users acquire the data with the Agora SDK, then start the media push.
- AgoraAudioRawFrameOperationModeReadWrite
- 2: Read and write mode, For example, when users have their own audio-effect processing module and perform some voice preprocessing, such as a voice change.
AgoraMediaRecorderErrorCode
The reason for the state change.
Enumerator
- AgoraMediaRecorderErrorCodeNoError
- 0: No error.
- AgoraMediaRecorderErrorCodeWriteFailed
- 1: The SDK fails to write the recorded data to a file.
- AgoraMediaRecorderErrorCodeNoStream
- 2: The SDK does not detect any audio and video streams, or audio and video streams are interrupted for more than five seconds during recording.
- AgoraMediaRecorderErrorCodeOverMaxDuration
- 3: The recording duration exceeds the upper limit.
- AgoraMediaRecorderErrorCodeConfigChange
- 4: The recording configuration changes.
AgoraMediaRecorderState
The current recording state.
Enumerator
- AgoraMediaRecorderStateError
- -1: An error occurs during the recording. See AgoraMediaRecorderErrorCode for the reason.
- AgoraMediaRecorderStateStarted
- 2: The audio and video recording starts.
- AgoraMediaRecorderStateStopped
- 3: The audio and video recording stops.
AgoraAudioRemoteReason
The reason for the remote audio state change.
Enumerator
- AgoraAudioRemoteReasonInternal
- 0: The SDK reports this reason when the audio state changes.
- AgoraAudioRemoteReasonNetworkCongestion
- 1: Network congestion.
- AgoraAudioRemoteReasonNetworkRecovery
- 2: Network recovery.
- AgoraAudioRemoteReasonLocalMuted
- 3: The local user stops receiving the remote audio stream or disables the audio module.
- AgoraAudioRemoteReasonLocalUnmuted
- 4: The local user resumes receiving the remote audio stream or enables the audio module.
- AgoraAudioRemoteReasonRemoteMuted
- 5: The remote user stops sending the audio stream or disables the audio module.
- AgoraAudioRemoteReasonRemoteUnmuted
- 6: The remote user resumes sending the audio stream or enables the audio module.
- AgoraAudioRemoteReasonRemoteOffline
- 7: The remote user leaves the channel.
AgoraAudioRemoteState
Remote audio states.
Enumerator
- AgoraAudioRemoteStateStopped
- 0: The local audio is in the initial state. The SDK reports this state in the case of AgoraAudioRemoteReasonLocalMuted, AgoraAudioRemoteReasonRemoteMuted or AgoraAudioRemoteReasonRemoteOffline.
- AgoraAudioRemoteStateStarting
- 1: The first remote audio packet is received.
- AgoraAudioRemoteStateDecoding
- 2: The remote audio stream is decoded and plays normally. The SDK reports this state in the case of AgoraAudioRemoteReasonNetworkRecovery, AgoraAudioRemoteReasonLocalUnmuted or AgoraAudioRemoteReasonRemoteUnmuted.
- AgoraAudioRemoteStateFrozen
- 3: The remote audio is frozen. The SDK reports this state in the case of AgoraAudioRemoteReasonNetworkCongestion.
- AgoraAudioRemoteStateFailed
- 4: The remote audio fails to start. The SDK reports this state in the case of AgoraAudioRemoteReasonInternal.
AgoraVideoRemoteReason
The reason for the remote video state change.
Enumerator
- AgoraVideoRemoteReasonInternal
- 0: The SDK reports this reason when the video state changes.
- AgoraVideoRemoteReasonCongestion
- 1: Network congestion.
- AgoraVideoRemoteReasonRecovery
- 2: Network recovery.
- AgoraVideoRemoteReasonLocalMuted
- 3: The local user stops receiving the remote video stream or disables the video module.
- AgoraVideoRemoteReasonLocalUnmuted
- 4: The local user resumes receiving the remote video stream or enables the video module.
- AgoraVideoRemoteReasonRemoteMuted
- 5: The remote user stops sending the video stream or disables the video module.
- AgoraVideoRemoteReasonRemoteUnmuted
- 6: The remote user resumes sending the video stream or enables the video module.
- AgoraVideoRemoteReasonRemoteOffline
- 7: The remote user leaves the channel.
AgoraVideoRemoteState
The state of the remote video.
Enumerator
- AgoraVideoRemoteStateStopped
- 0: The remote video is in the initial state. The SDK reports this state in the case of AgoraVideoRemoteReasonLocalMuted, AgoraVideoRemoteReasonRemoteMuted, or AgoraVideoRemoteReasonRemoteOffline.
- AgoraVideoRemoteStateStarting
- 1: The first remote video packet is received.
- AgoraVideoRemoteStateDecoding
- 2: The remote video stream is decoded and plays normally. The SDK reports this state in the case of AgoraVideoRemoteReasonRecovery, AgoraVideoRemoteReasonLocalUnmuted, AgoraVideoRemoteReasonRemoteUnmuted or AgoraVideoRemoteReasonAudioFallbackRecovery.
- AgoraVideoRemoteStateFrozen
- 3: The remote video is frozen. The SDK reports this state in the case of AgoraVideoRemoteReasonCongestion or AgoraVideoRemoteReasonAudioFallback.
- AgoraVideoRemoteStateFailed
- 4: The remote video fails to start. The SDK reports this state in the case of AgoraVideoRemoteReasonInternal.
AgoraVideoStreamType
The type of video streams.
Enumerator
- AgoraVideoStreamTypeHigh
- 0: High-quality video stream.
- AgoraVideoStreamTypeLow
- 1: Low-quality video stream.
AgoraVideoRenderMode
Video display modes.
Enumerator
- AgoraVideoRenderModeHidden
- 1: Hidden mode. Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). One dimension of the video may have clipped contents.
- AgoraVideoRenderModeFit
- 2: Fit mode. Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black.
AgoraRtmpStreamLifeCycle
Lifecycle of the CDN live video stream.
- Deprecated
Enumerator
- AgoraRtmpStreamLifeCycleBindToChannel
- Bind to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds.
- AgoraRtmpStreamLifeCycleBindToOwner
- Bind to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately.
AgoraRtmpStreamingErrorCode
Error codes of the RTMP or RTMPS streaming.
Enumerator
- AgoraRtmpStreamingErrorCodeOK
- 0: The RTMP or RTMPS streaming publishes successfully.
- AgoraRtmpStreamingErrorCodeInvalidParameters
- 1: Invalid argument used. Check the parameter setting.
- AgoraRtmpStreamingErrorCodeEncryptedStreamNotAllowed
- 2: The RTMP or RTMPS streaming is encrypted and cannot be published.
- AgoraRtmpStreamingErrorCodeConnectionTimeout
- 3: Timeout for the RTMP or RTMPS streaming. Try to publish the streaming again.
- AgoraRtmpStreamingErrorCodeInternalServerError
- 4: An error occurs in Agora's streaming server. Try to publish the streaming again.
- AgoraRtmpStreamingErrorCodeRtmpServerError
- 5: An error occurs in the CDN server.
- AgoraRtmpStreamingErrorCodeTooOften
- 6: The RTMP or RTMPS streaming publishing requests are too frequent.
- AgoraRtmpStreamingErrorCodeReachLimit
- 7: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones.
- AgoraRtmpStreamingErrorCodeNotAuthorized
- 8: The host manipulates other hosts' URLs. For example, the host updates or stops other hosts' streams. Check your app logic.
- AgoraRtmpStreamingErrorCodeStreamNotFound
- 9: Agora's server fails to find the RTMP or RTMPS streaming.
- AgoraRtmpStreamingErrorCodeFormatNotSupported
- 10: The format of the RTMP or RTMPS streaming URL is not supported. Check whether the URL format is correct.
- AgoraRtmpStreamingErrorNotBroadcaster
- 11: The user role is not host, so the user cannot use the CDN live streaming function. Check your app code logic.
- AgoraRtmpStreamingErrorTranscodingNoMixStream
- 13: The updateRtmpTranscoding or setLiveTranscoding method is called to update the transcoding configuration in a scenario where there is streaming without transcoding. Check your application code logic.
- AgoraRtmpStreamingErrorNetDown
- 14: Errors occurred in the host's network.
- AgoraRtmpStreamingErrorInvalidAppId
- 15: Your App ID does not have permission to use the CDN live streaming function.
- AgoraRtmpStreamingErrorCodeUnpublishOK
- 100: The streaming has been stopped normally. After you call stopRtmpStream to stop streaming, the SDK returns this value.
AgoraRtmpStreamingState
States of the Media Push.
Enumerator
- AgoraRtmpStreamingStateIdle
- 0: The Media Push has not started or has ended.
- AgoraRtmpStreamingStateConnecting
- 1: The SDK is connecting to Agora's streaming server and the CDN server.
- AgoraRtmpStreamingStateRunning
- 2: The RTMP or RTMPS streaming publishes. The SDK successfully publishes the RTMP or RTMPS streaming and returns this state.
- AgoraRtmpStreamingStateRecovering
-
3: The RTMP or RTMPS streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP or RTMPS streaming and returns this state.
- If the SDK successfully resumes the streaming, AgoraRtmpStreamingStateRunning(2) returns.
- If the streaming does not resume within 60 seconds or server errors occur, AgoraRtmpStreamingStateFailure(4) returns. You can also reconnect to the server by calling the stopRtmpStream method.
- AgoraRtmpStreamingStateFailure
- 4: The RTMP or RTMPS streaming fails. See the errCode parameter for the detailed error information.
- AgoraRtmpStreamingStateDisconnecting
- 5: The SDK is disconnecting from the Agora streaming server and CDN. When you call stopRtmpStream to stop the streaming normally, the SDK reports the streaming state as AgoraRtmpStreamingStateDisconnecting and AgoraRtmpStreamingStateIdle in sequence.
AgoraRtmpStreamingEvent
Events during the media push.
Enumerator
- AgoraRtmpStreamingEventFailedLoadImage
- 1: An error occurs when you add a background image or a watermark image in the media push.
- AgoraRtmpStreamingEventUrlAlreadyInUse
- 2: The streaming URL is already being used for CDN live streaming. If you want to start new streaming, use a new streaming URL.
- AgoraRtmpStreamingEventAdvancedFeatureNotSupport
- 3: The feature is not supported.
- AgoraRtmpStreamingEventRequestTooOften
- 4: Reserved.
AgoraScreenCaptureSourceType
The type of the shared target. Set in AgoraScreenCaptureSourceInfo.
Enumerator
- AgoraScreenCaptureSourceTypeUnknown
- -1: Unknown type.
- AgoraScreenCaptureSourceTypeWindow
- 0: The shared target is a window.
- AgoraScreenCaptureSourceTypeScreen
- 1: The shared target is a screen of a particular monitor.
- AgoraScreenCaptureSourceTypeCustom
- 2: Reserved parameter
AgoraScreenScenarioType
The screen sharing scenario.
Enumerator
- AgoraScreenScenarioDocument
- 1: (Default) Document. This scenario prioritizes the video quality of screen sharing and reduces the latency of the shared video for the receiver. If you share documents, slides, and tables, you can set this scenario.
- AgoraScreenScenarioGaming
- 2: Game. This scenario prioritizes the smoothness of screen sharing. If you share games, you can set this scenario.
- AgoraScreenScenarioVideo
- 3: Video. This scenario prioritizes the smoothness of screen sharing. If you share movies or live videos, you can set this scenario.
- AgoraScreenScenarioRDC
- 4: Remote control. This scenario prioritizes the video quality of screen sharing and reduces the latency of the shared video for the receiver. If you share the device desktop being remotely controlled, you can set this scenario.
AgoraStreamFallbackOptions
Stream fallback options.
Enumerator
- AgoraStreamFallbackOptionDisabled
- 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed.
- AgoraStreamFallbackOptionVideoStreamLow
- 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-quality (low resolution and low bitrate) video stream. This option is only valid for setRemoteSubscribeFallbackOption.
- AgoraStreamFallbackOptionAudioOnly
- 2: Under poor uplink network conditions, the published video stream falls back to audio-only. Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-quality (low resolution and low bitrate) video stream; and then to an audio-only stream if the network conditions worsen.
SegModelType
The type of algorithms to user for background processing.
Enumerator
- SegModelAgoraAi
- 1: (Default) Use the algorithm suitable for all scenarios.
- SegModelAgoraGreen
- 2: Use the algorithm designed specifically for scenarios with a green screen background.
AgoraStreamPublishState
The publishing state.
Enumerator
- AgoraStreamPublishStateIdle
- 0: The initial publishing state after joining the channel.
- AgoraStreamPublishStateNoPublished
-
1: Fails to publish the local stream. Possible reasons:
- The local user calls muteLocalAudioStream(
YES
) or muteLocalVideoStream(YES
) to stop sending local media streams. - The local user calls disableAudio or disableVideo to disable the local audio or video module.
- The local user calls enableLocalAudio(
NO
) or enableLocalVideo(NO
) to disable the local audio or video capture. - The role of the local user is audience.
- The local user calls muteLocalAudioStream(
- AgoraStreamPublishStatePublishing
- 2: Publishing.
- AgoraStreamPublishStatePublished
- 3: Publishes successfully.
AgoraStreamSubscribeState
The subscribing state.
Enumerator
- AgoraStreamSubscribeStateIdle
- 0: The initial publishing state after joining the channel.
- AgoraStreamSubscribeStateNoSubscribed
-
1: Fails to subscribe to the remote stream. Possible reasons:
- The remote user:
- Calls muteLocalAudioStream(
YES
) or muteLocalVideoStream(YES
) to stop sending local media stream. - Calls disableAudio or disableVideo to disable the local audio or video module.
- Calls enableLocalAudio(NO) or enableLocalVideo(NO) to disable local audio or video capture.
- The role of the remote user is audience.
- Calls muteLocalAudioStream(
- The local user calls the following methods to stop receiving remote streams:
- Call muteRemoteAudioStream(YES) or muteAllRemoteAudioStreams(YES) to stop receiving the remote audio stream.
- Call muteRemoteVideoStream(YES) or muteAllRemoteVideoStreams(YES) to stop receiving the remote video stream.
- The remote user:
- AgoraStreamSubscribeStateSubscribing
- 2: Subscribing.
- AgoraStreamSubscribeStateSubscribed
- 3: The remote stream is received, and the subscription is successful.
AgoraUserOfflineReason
Reasons for a user being offline.
Enumerator
- AgoraUserOfflineReasonQuit
- 0: The user quits the call.
- AgoraUserOfflineReasonDropped
-
1: The SDK times out and the user drops offline because no data packet is received within a certain period of time.
Attention: If the user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. - AgoraUserOfflineReasonBecomeAudience
- 2: The user switches the client role from the host to the audience.
AgoraVideoFramePosition
The frame position of the video observer.
Enumerator
- AgoraVideoFramePositionPostCapture
- 1: The post-capturer position, which corresponds to the video data in the onCaptureVideoFrame callback.
- AgoraVideoFramePositionPreRenderer
- 2: The pre-renderer position, which corresponds to the video data in the onRenderVideoFrame callback.
- AgoraVideoFramePositionPreEncoder
- 4: The pre-encoder position, which corresponds to the video data in the onPreEncodeVideoFrame callback.
AgoraVideoCodecProfileType
Video codec profile types.
- AgoraVideoCodecProfileTypeBaseLine
- 66: Baseline video codec profile; generally used for video calls on mobile phones.
- AgoraVideoCodecProfileTypeMain
- 77: Main video codec profile; generally used in mainstream electronics such as MP4 players, portable video players, PSP, and iPads.
- AgoraVideoCodecProfileTypeHigh
- 100: (Default) High video codec profile; generally used in high-resolution live streaming or television.
AgoraVideoCodecType
Video codec types.
Enumerator
- AgoraVideoCodecTypeVP8
- 1: Standard VP8.
- AgoraVideoCodecTypeH264
- 2: Standard H.264.
AgoraVideoCodecTypeForStream
The codec type of the output video.
Enumerator
- AgoraVideoCodecTypeH264ForStream
- 1: (Default) H.264.
- AgoraVideoCodecTypeH265ForStream
- 2: H.265.
AgoraVideoFrameProcessMode
The process mode of the video frame:
Enumerator
- AgoraVideoFrameProcessModeReadOnly
-
Read-only mode.
In this mode, you do not modify the video frame. The video frame observer is a renderer.
- AgoraVideoFrameProcessModeReadWrite
-
Read and write mode.
In this mode, you modify the video frame. The video frame observer is a video filter.
AgoraVideoFrameType
The video frame type.
Enumerator
- AgoraVideoFrameTypeBlankFrame
- 0: A black frame.
- AgoraVideoFrameTypeKeyFrame
- 3: Key frame.
- AgoraVideoFrameTypeDeltaFrame
- 4: Delta frame.
- AgoraVideoFrameTypeBFrame
- 5: The B frame.
- AgoraVideoFrameTypeDroppableFrame
- 6: A discarded frame.
- AgoraVideoFrameTypeUnknow
- Unknown frame.
AgoraVideoMirrorMode
Video mirror mode.
Enumerator
- AgoraVideoMirrorModeAuto
- 0: (Default) The SDK determines the mirror mode.
- AgoraVideoMirrorModeEnabled
- 1: Enable mirror mode.
- AgoraVideoMirrorModeDisabled
- 2: Disable mirror mode.
AgoraVideoRotation
The clockwise rotation of the video.
Enumerator
- AgoraVideoRotationNone
- 0: (Default) No rotation.
- AgoraVideoRotation90
- 90: 90 degrees.
- AgoraVideoRotation180
- 180: 180 degrees.
- AgoraVideoRotation270
- 270: 270 degrees.
AgoraVideoFormat
The video pixel format.
Enumerator
- AgoraVideoFormatDefault
- 0: Raw video pixel format.
- AgoraVideoPixelFormatI420
- 1: The format is I420.
- AgoraVideoFormatRGBA
- 4: The format is RGBA.
- AgoraVideoFormatNV12
- 8: The format is NV12.
- AgoraVideoFormatCVPixelNV12
- 12: The format is CVPixelBufferRef NV12.
- AgoraVideoFormatCVPixelI420
- 13: The format is CVPixelBufferRef I420.
- AgoraVideoFormatCVPixelBGRA
- 14: The format is CVPixelBufferRef BGRA.
- AgoraVideoFormatI422
- 16: The format is I422.
AgoraVideoProfile
Video profile.
- Deprecated
- This class is deprecated.
Enumerator
- AgoraVideoProfileInvalid
- Invalid video attribute.
- AgoraVideoProfileLandscape120P
- 0: 160 × 120, frame rate 15 fps, bitrate 65 Kbps.
- AgoraVideoProfileLandscape120P_3
- 2: 120 × 120, frame rate 15 fps, bitrate 50 Kbps.
- AgoraVideoProfileLandscape180P
- 10: 320 × 180, frame rate 15 fps, bitrate 140 Kbps.
- AgoraVideoProfileLandscape180P_3
- 12: 180 × 180, frame rate 15 fps, bitrate 100 Kbps.
- AgoraVideoProfileLandscape180P_4
- 13: 240 × 180, frame rate 15 fps, bitrate 120 Kbps.
- AgoraVideoProfileLandscape240P
- 20: 320 × 240, frame rate 15 fps, bitrate 200 Kbps.
- AgoraVideoProfileLandscape240P_3
- 22: 240 × 240, frame rate 15 fps, bitrate 140 Kbps.
- AgoraVideoProfileLandscape240P_4
- 23: 424 × 240, frame rate 15 fps, bitrate 220 Kbps.
- AgoraVideoProfileLandscape360P
- 30: 640 × 360, frame rate 15 fps, bitrate 400 Kbps.
- AgoraVideoProfileLandscape360P_3
- 32: 360 × 360, frame rate 15 fps, bitrate 260 Kbps.
- AgoraVideoProfileLandscape360P_4
- 33: 640 × 360, frame rate 30 fps, bitrate 600 Kbps.
- AgoraVideoProfileLandscape360P_6
- 35: 360 × 360, frame rate 30 fps, bitrate 400 Kbps.
- AgoraVideoProfileLandscape360P_7
- 36: 480 × 360, frame rate 15 fps, bitrate 320 Kbps.
- AgoraVideoProfileLandscape360P_8
- 37: 480 × 360, frame rate 30 fps, bitrate 490 Kbps.
- AgoraVideoProfileLandscape360P_9
-
38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps.
Attention: This profile applies only to the live streaming channel profile. - AgoraVideoProfileLandscape360P_10
-
39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps.
Attention: This profile applies only to the live streaming channel profile. - AgoraVideoProfileLandscape360P_11
-
100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps.
Attention: This profile applies only to the live streaming channel profile. - AgoraVideoProfileLandscape480P
- 40: 640 × 480, frame rate 15 fps, bitrate 500 Kbps.
- AgoraVideoProfileLandscape480P_3
- 42: 480 × 480, frame rate 15 fps, bitrate 400 Kbps.
- AgoraVideoProfileLandscape480P_4
- 43: 640 × 480, frame rate 30 fps, bitrate 750 Kbps.
- AgoraVideoProfileLandscape480P_6
- 45: 480 × 480, frame rate 30 fps, bitrate 600 Kbps.
- AgoraVideoProfileLandscape480P_8
- 47: 848 × 480, frame rate 15 fps, bitrate 610 Kbps.
- AgoraVideoProfileLandscape480P_9
- 48: 848 × 480, frame rate 30 fps, bitrate 930 Kbps.
- AgoraVideoProfileLandscape480P_10
- 49: 640 × 480, frame rate 10 fps, bitrate 400 Kbps.
- AgoraVideoProfileLandscape720P
- 50: 1280 × 720, frame rate 15 fps, bitrate 1130 Kbps.
- AgoraVideoProfileLandscape720P_3
- 52: 1280 × 720, frame rate 30 fps, bitrate 1710 Kbps.
- AgoraVideoProfileLandscape720P_5
- 54: 960 × 720, frame rate 15 fps, bitrate 910 Kbps.
- AgoraVideoProfileLandscape720P_6
- 55: 960 × 720, frame rate 30 fps, bitrate 1380 Kbps.
- AgoraVideoProfileLandscape1080P
- 60: 1920 × 1080, frame rate 15 fps, bitrate 2080 Kbps.
- AgoraVideoProfileLandscape1080P_3
- 60: 1920 × 1080, frame rate 30 fps, bitrate 3150 Kbps.
- AgoraVideoProfileLandscape1080P_5
- 64: 1920 × 1080, frame rate 60 fps, bitrate 4780 Kbps.
- AgoraVideoProfilePortrait120P
- 1000: 120 × 160, frame rate 15 fps, bitrate 65 Kbps.
- AgoraVideoProfilePortrait120P_3
- 1002: 120 × 120, frame rate 15 fps, bitrate 50 Kbps.
- AgoraVideoProfilePortrait180P
- 1010: 180 × 320, frame rate 15 fps, bitrate 140 Kbps.
- AgoraVideoProfilePortrait180P_3
- 1012: 180 × 180, frame rate 15 fps, bitrate 100 Kbps.
- AgoraVideoProfilePortrait180P_4
- 1013: 180 × 240, frame rate 15 fps, bitrate 120 Kbps.
- AgoraVideoProfilePortrait240P
- 1020: 240 × 320, frame rate 15 fps, bitrate 200 Kbps.
- AgoraVideoProfilePortrait240P_3
- 1022: 240 × 240, frame rate 15 fps, bitrate 140 Kbps.
- AgoraVideoProfilePortrait240P_4
- 1023: 240 × 424, frame rate 15 fps, bitrate 220 Kbps.
- AgoraVideoProfilePortrait360P
- 1030: 360 × 640, frame rate 15 fps, bitrate 400 Kbps.
- AgoraVideoProfilePortrait360P_3
- 1032: 360 × 360, frame rate 15 fps, bitrate 260 Kbps.
- AgoraVideoProfilePortrait360P_4
- 1033: 360 × 640, frame rate 15 fps, bitrate 600 Kbps.
- AgoraVideoProfilePortrait360P_6
- 1035: 360 × 360, frame rate 30 fps, bitrate 400 Kbps.
- AgoraVideoProfilePortrait360P_7
- 1036: 360 × 480, frame rate 15 fps, bitrate 320 Kbps.
- AgoraVideoProfilePortrait360P_8
- 1037: 360 × 480, frame rate 30 fps, bitrate 490 Kbps.
- AgoraVideoProfilePortrait360P_9
-
1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps.
Attention: This profile applies only to the live streaming channel profile. - AgoraVideoProfilePortrait360P_10
-
1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps.
Attention: This profile applies only to the live streaming channel profile. - AgoraVideoProfilePortrait360P_11
-
1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps.
Attention: This profile applies only to the live streaming channel profile. - AgoraVideoProfilePortrait480P
- 1040: 480 × 640, frame rate 15 fps, bitrate 500 Kbps.
- AgoraVideoProfilePortrait480P_3
- 1042: 480 × 480, frame rate 15 fps, bitrate 400 Kbps.
- AgoraVideoProfilePortrait480P_4
- 1043: 480 × 640, frame rate 30 fps, bitrate 750 Kbps.
- AgoraVideoProfilePortrait480P_6
- 1045: 480 × 480, frame rate 30 fps, bitrate 600 Kbps.
- AgoraVideoProfilePortrait480P_8
- 1047: 480 × 848, frame rate 15 fps, bitrate 610 Kbps.
- AgoraVideoProfilePortrait480P_9
- 1048: 480 × 848, frame rate 30 fps, bitrate 930 Kbps.
- AgoraVideoProfilePortrait480P_10
- 1049: 480 × 640, frame rate 10 fps, bitrate 400 Kbps.
- AgoraVideoProfilePortrait720P
- 1050: 720 × 1280, frame rate 15 fps, bitrate 1130 Kbps.
- AgoraVideoProfilePortrait720P_3
- 1052: 720 × 1280, frame rate 30 fps, bitrate 1710 Kbps.
- AgoraVideoProfilePortrait720P_5
- 1054: 720 × 960, frame rate 15 fps, bitrate 910 Kbps.
- AgoraVideoProfilePortrait720P_6
- 1055: 720 × 960, frame rate 30 fps, bitrate 1380 Kbps.
- AgoraVideoProfilePortrait1080P
- 1060: 1080 × 1920, frame rate 15 fps, bitrate 2080 Kbps.
- AgoraVideoProfilePortrait1080P_3
- 1062: 1080 × 1920, frame rate 30 fps, bitrate 3150 Kbps.
- AgoraVideoProfilePortrait1080P_5
- 1064: 1080 × 1920, frame rate 60 fps, bitrate 4780 Kbps.
- AgoraVideoProfileDEFAULT
- (Default) 640 × 360, frame rate 15 fps, bitrate 400 Kbps.
AgoraVideoSourceType
The capture type of the custom video source.
Enumerator
- AgoraVideoSourceTypeCamera
- The camera.
- AgoraVideoSourceTypeCameraSecondary
- The secondary camera.
- AgoraVideoSourceTypeScreen
- The screen.
- AgoraVideoSourceTypeScreenSecondary
- The secondary screen.
- AgoraVideoSourceTypeCustom
- The custom video source.
- AgoraVideoSourceTypeMediaPlayer
- The video source from the media player.
- AgoraVideoSourceTypeImagePNG
- The video source is a PNG image.
- AgoraVideoSourceTypeImageJPEG
- The video source is a JPEG image.
- AgoraVideoSourceTypeImageGIF
- The video source is a GIF image.
- AgoraVideoSourceTypeRemote
- The video source is remote video acquired by the network.
- AgoraVideoSourceTypeTransCoded
- A transcoded video source.
- AgoraVideoSourceTypeUnknown
- An unknown video source.
AgoraVoiceBeautifierPreset
The options for SDK preset voice beautifier effects.
Enumerator
- AgoraVoiceBeautifierPresetOff
- Turn off voice beautifier effects and use the original voice.
- AgoraVoiceBeautifierPresetChatBeautifierMagnetic
A more magnetic voice.
Attention: Agora recommends using this enumerator to process a male-sounding voice; otherwise, you may experience vocal distortion.- AgoraVoiceBeautifierPresetChatBeautifierFresh
-
A fresher voice.
Attention: Agora recommends using this enumerator to process a female-sounding voice; otherwise, you may experience vocal distortion. - AgoraVoiceBeautifierPresetChatBeautifierVitality
-
A more vital voice.
Attention: Agora recommends using this enumerator to process a female-sounding voice; otherwise, you may experience vocal distortion. - AgoraVoiceBeautifierPresetSingingBeautifier
-
Singing beautifier effect.
- If you call setVoiceBeautifierPreset(AgoraVoiceBeautifierPresetSingingBeautifier), you can beautify a male-sounding voice and add a reverberation effect that sounds like singing in a small room. Agora recommends using this enumerator to process a male-sounding voice; otherwise, you might experience vocal distortion.
- If you call setVoiceBeautifierParameters(AgoraVoiceBeautifierPresetSingingBeautifier, param1, param2), you can beautify a male or female-sounding voice and add a reverberation effect.
- AgoraVoiceBeautifierTimbreTransformationVigorous
- A more vigorous voice.
- AgoraVoiceBeautifierTimbreTransformationDeep
- A deep voice.
- AgoraVoiceBeautifierTimbreTransformationMellow
- A mellower voice.
- AgoraVoiceBeautifierTimbreTransformationFalsetto
- Falsetto.
- AgoraVoiceBeautifierTimbreTransformationFull
- A fuller voice.
- AgoraVoiceBeautifierTimbreTransformationClear
- A clearer voice.
- AgoraVoiceBeautifierTimbreTransformationResounding
- A more resounding voice.
- AgoraVoiceBeautifierTimbreTransformatRinging
- A more ringing voice.
- AgoraVoiceBeautifierUltraHighQuality
- A ultra-high quality voice, which makes the audio clearer and restores more details.
- To achieve better audio effect quality, Agora recommends that you set the profile of setAudioProfile [2/2] to AgoraAudioProfileMusicHighQuality(4) or AgoraAudioProfileMusicHighQualityStereo(5) and scenario to AgoraAudioScenarioGameStreaming(3) before calling setVoiceBeautifierPreset.
- If you have an audio capturing device that can already restore audio details to a high degree, Agora recommends that you do not enable ultra-high quality; otherwise, the SDK may over-restore audio details, and you may not hear the anticipated voice effect.
AgoraAudioVoiceChanger
Local voice changer options.
Enumerator
- AgoraAudioVoiceChangerOff
- The original voice (no local voice change).
- AgoraAudioVoiceChangerOldMan
- The voice of an old man.
- AgoraAudioVoiceChangerBabyBoy
- The voice of a little boy.
- AgoraAudioVoiceChangerBabyGirl
- The voice of a little girl.
- AgoraAudioVoiceChangerZhuBaJie
- The voice of Zhu Bajie, a character in Journey to the West who has a voice like that of a growling bear.
- AgoraAudioVoiceChangerEthereal
- The ethereal voice.
- AgoraAudioVoiceChangerHulk
- The voice of Hulk.
- AgoraAudioVoiceBeautyVigorous
- A more vigorous voice.
- AgoraAudioVoiceBeautyDeep
- A deeper voice.
- AgoraAudioVoiceBeautyMellow
- A mellower voice.
- AgoraAudioVoiceBeautyFalsetto
- Falsetto.
- AgoraAudioVoiceBeautyFull
- A fuller voice.
- AgoraAudioVoiceBeautyClear
- A clearer voice.
- AgoraAudioVoiceBeautyResounding
- A more resounding voice.
- AgoraAudioVoiceBeautyRinging
- A more ringing voice.
- VAgoraAudioVoiceBeautySpacial
- A more spatially resonant voice.
- AgoraAudioGeneralBeautyVoiceMaleMagnetic
- (For male only) A more magnetic voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. Do not use it when the speaker is a female; otherwise, voice distortion occurs.
- AgoraAudioGeneralBeautyVoiceFemaleFresh
- (For female only) A fresher voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. Do not use it when the speaker is a male; otherwise, voice distortion occurs.
- AgoraAudioGeneralBeautyVoiceFemaleVitality
- (For female only) A more vital voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. Do not use it when the speaker is a male; otherwise, voice distortion occurs.
AgoraVoiceConversionPreset
The options for SDK preset voice conversion effects.
Enumerator
- AgoraVoiceConversionPresetOff
- Turn off voice conversion effects and use the original voice.
- AgoraVoiceConversionPresetNeutral
- A gender-neutral voice. To avoid audio distortion, ensure that you use this enumerator to process a female-sounding voice.
- AgoraVoiceConversionPresetSweet
- A sweet voice. To avoid audio distortion, ensure that you use this enumerator to process a female-sounding voice.
- AgoraVoiceConversionPresetChangerSolid
- A steady voice. To avoid audio distortion, ensure that you use this enumerator to process a male-sounding voice.
- AgoraVoiceConversionPresetChangerBass
- A deep voice. To avoid audio distortion, ensure that you use this enumerator to process a male-sounding voice.
AgoraRtcDeviceInfo
The class that provides device information.
__attribute__((visibility("default"))) @interface AgoraRtcDeviceInfo : NSObject @property (assign, nonatomic) int __deprecated index; @property(assign, nonatomic) AgoraMediaDeviceType type; @property(copy, nonatomic) NSString *_Nullable deviceId; @property(copy, nonatomic) NSString *_Nullable deviceName; @end
Properties
- type
- The device type. See AgoraMediaDeviceType.
- deviceId
- The device ID.
- deviceName
- The device name.
AgoraAudioEncodedFrameDelegateConfig
Observer settings for encoded audio.
__attribute__((visibility("default"))) @interface AgoraAudioEncodedFrameDelegateConfig: NSObject @property (assign, nonatomic) AgoraAudioEncodedFrameDelegatePosition postionType; @property (assign, nonatomic) AgoraAudioEncodingType encodingType; @end
Properties
- postionType
-
Audio profile. See AgoraAudioEncodedFrameDelegatePosition.
- encodingType
-
Audio encoding type. See AgoraAudioEncodingType.
AgoraAudioFrame
Raw audio data.
__attribute__((visibility("default"))) @interface AgoraAudioFrame: NSObject @property (assign, nonatomic) NSInteger samplesPerChannel; @property (assign, nonatomic) NSInteger bytesPerSample; @property (assign, nonatomic) NSInteger channels; @property (assign, nonatomic) NSInteger samplesPerSec; @property (strong, nonatomic) NSData* _Nullable buffer; @property (assign, nonatomic) int64_t renderTimeMs; @property (assign, nonatomic) NSInteger avSyncType; @end
Properties
- samplesPerChannel
- The number of samples per channel in the audio frame.
- bytesPerSample
- The number of bytes per audio sample, which is usually 16-bit (2 bytes).
- channels
-
The number of audio channels (the data are interleaved if it is stereo).
- 1: Mono.
- 2: Stereo.
- samplesPerSec
- The number of samples per channel in the audio frame.
- buffer
-
The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved.
The size of the data buffer is as follows:
buffer
=samples
×channels
×bytesPerSample
. - renderTimeMs
-
The timestamp (ms) of the external audio frame.
You can use this timestamp to restore the order of the captured audio frame, and synchronize audio and video frames in video scenarios, including scenarios where external video sources are used.
- avsyncType
- Reserved for future use.
AgoraAudioParams
Audio data format.
__attribute__((visibility("default"))) @interface AgoraAudioParams : NSObject @property (assign, nonatomic) NSInteger sampleRate; @property (assign, nonatomic) NSInteger channel; @property (assign, nonatomic) AgoraAudioRawFrameOperationMode mode; @property (assign, nonatomic) NSInteger samplesPerCall; @end
- getRecordAudioParams: Sets the audio data format for the onRecordAudioFrame callback.
- getPlaybackAudioParams: Sets the audio data format for the onPlaybackAudioFrame callback.
- getMixedAudioParams: Sets the audio data format for the onMixedAudioFrame callback.
- getEarMonitoringAudioParams: Sets the audio data format for the onEarMonitoringAudioFrame callback.
- The SDK calculates the sampling interval through the samplesPerCall, sampleRate, and channel parameters in AgoraAudioParams, and triggers the onRecordAudioFrame, onPlaybackAudioFrame, onMixedAudioFrame, and onEarMonitoringAudioFrame callbacks according to the sampling interval.
- Sample interval (sec) = samplePerCall/(sampleRate × channel).
- Ensure that the sample interval ≥ 0.01 (s).
Properties
- sampleRate
- The audio sample rate (Hz), which can be set as one of the following values:
- 8000.
- (Default) 16000.
- 32000.
- 44100
- 48000
- channel
- The number of audio channels, which can be set as either of the following values:
- 1: (Default) Mono.
- 2: Stereo.
- mode
- The use mode of the audio data. See AgoraAudioRawFrameOperationMode.
- samplesPerCall
- The number of samples, such as 1024 for the media push.
AgoraAudioRecordingConfiguration
Recording configuration.
__attribute__((visibility("default"))) @interface AgoraAudioRecordingConfiguration: NSObject @property (copy, nonatomic) NSString * _Nullable filePath; @property (assign, nonatomic) BOOL codec; @property (assign, nonatomic) NSUInteger sampleRate; @property (assign, nonatomic) AgoraAudioFileRecordingType fileRecordOption; @property (assign, nonatomic) AgoraAudioRecordingQuality quality; @property (assign, nonatomic) NSInteger recordingChannel; @end
Properties
- filePath
- The absolute path (including the filename extensions) of the recording file. For example:
/var/mobile/Containers/Data/audio.mp4
.Attention:Ensure that the path for the recording file exists and is writable.
- codec
- Whether to encode the audio data:
YES
: Encode audio data in AAC.NO
: (Default) Do not encode audio data, but save the recorded audio data directly.
- sampleRate
- Recording sample rate (Hz).
- 16000
- (Default) 32000
- 44100
- 48000
Attention:If you set this parameter to 44100 or 48000, Agora recommends recording WAV files, or AAC files with quality set as AgoraAudioRecordingQualityMedium or AgoraAudioRecordingQualityHigh for better recording quality.
- fileRecordOption
-
Recording content. See AgoraAudioFileRecordingType.
- quality
-
Recording quality. See AgoraAudioRecordingQuality.
Attention:Note: This parameter applies to AAC files only.
- recordingChannel
- The audio channel of recording: The parameter supports the following values:
- 1: (Default) Mono.
- 2: Stereo.
Note:The actual recorded audio channel is related to the audio channel that you capture.- If the captured audio is mono and recordingChannel is
2
, the recorded audio is the dual-channel data that is copied from mono data, not stereo. - If the captured audio is dual channel and recordingChannel is
1
, the recorded audio is the mono data that is mixed by dual-channel data.
AgoraRtcAudioVolumeInfo
The volume information of users.
__attribute__((visibility("default"))) @interface AgoraRtcAudioVolumeInfo : NSObject @property(assign, nonatomic) NSUInteger uid; @property(assign, nonatomic) NSUInteger volume; @property(assign, nonatomic) NSUInteger vad; @property (assign, nonatomic) double voicePitch; @end
Properties
- uid
-
The user ID.
- In the local user's callback, uid = 0.
- In the remote users' callback, uid is the user ID of a remote user whose instantaneous volume is one of the three highest.
- volume
- The volume of the user. The value ranges between 0 (lowest volume) and 255 (highest volume). If the user calls startAudioMixing [2/2], the value of volume is the volume after audio mixing.
- vad
-
Voice activity status of the local user.
- 0: The local user is not speaking.
- 1: The local user is speaking.
Attention:- The vad parameter does not report the voice activity status of remote users. In a remote user's callback, the value of vad is always 1.
- To use this parameter, you must set reportVad to
YES
when calling enableAudioVolumeIndication.
- voicePitch
-
The voice pitch of the local user. The value ranges between 0.0 and 4000.0.
Attention: The voicePitch parameter does not report the voice pitch of remote users. In the remote users' callback, the value of voicePitch is always 0.0.
AgoraBeautyOptions
Image enhancement options.
__attribute__((visibility("default"))) @interface AgoraBeautyOptions : NSObject @property(nonatomic, assign) AgoraLighteningContrastLevel lighteningContrastLevel; @property(nonatomic, assign) float lighteningLevel; @property(nonatomic, assign) float smoothnessLevel; @property(nonatomic, assign) float rednessLevel; @property(nonatomic, assign) float sharpnessLevel; @end
Properties
- lighteningContrastLevel
-
The contrast level, used with the lighteningLevel parameter. The larger the value, the greater the contrast between light and dark. See AgoraLighteningContrastLevel.
- lighteningLevel
-
The brightening level, in the range [0.0,1.0], where 0.0 means the original brightening. The default value is . The higher the value, the greater the degree of brightening.
- smoothnessLevel
-
The smoothness level, in the range [0.0,1.0], where 0.0 means the original smoothness. The default value is . The higher the value, the greater the smoothness level.
- rednessLevel
-
The redness level, in the range [0.0,1.0], where 0.0 means the original redness. The default value is . The higher the value, the greater the redness level.
- sharpnessLevel
-
The sharpness level, in the range [0.0,1.0], where 0.0 means the original sharpness. The default value is . The larger the value, the greater the sharpness level.
AgoraMediaPlayerCacheStatistics
Statistics about the media files being cached.
__attribute__((visibility("default"))) @interface AgoraMediaPlayerCacheStatistics : NSObject @property(assign, nonatomic) NSInteger fileSize; @property(assign, nonatomic) NSInteger cacheSize; @property(assign, nonatomic) NSInteger downloadSize; @end
Properties
- fileSize
- The size (bytes) of the media file being played.
- cacheSize
- The size (bytes) of the media file that you want to cache.
- downloadSize
- The size (bytes) of the media file that has been downloaded.
AgoraCameraCapturerConfiguration
The camera capturer preference.
__attribute__((visibility("default"))) @interface AgoraCameraCapturerConfiguration: NSObject #if TARGET_OS_IOS @property (assign, nonatomic) AgoraCameraDirection cameraDirection; #endif @end
Properties
- cameraDirection
- The camera direction.
AgoraChannelMediaRelayInfo
The definition of AgoraChannelMediaRelayInfo.
__attribute__((visibility("default"))) @interface AgoraChannelMediaRelayInfo: NSObject @property (copy, nonatomic) NSString * _Nullable token; @property (copy, nonatomic) NSString * _Nullable channelName; @property (assign, nonatomic) NSUInteger uid; - (instancetype _Nonnull)initWithToken:(NSString *_Nullable)token; @end
Properties
- channelName
- The channel name.
- token
- The token that enables the user to join the channel.
- uid
- The user ID.
AgoraRtcChannelMediaOptions
The channel media options.
__attribute__((visibility("default"))) @interface AgoraRtcChannelMediaOptions : NSObject @property(assign, nonatomic) BOOL publishCameraTrack; @property(assign, nonatomic) BOOL publishSecondaryCameraTrack; @property(assign, nonatomic) BOOL publishMicrophoneTrack; #if TARGET_OS_IPHONE @property(assign, nonatomic) BOOL publishScreenCaptureVideo; @property(assign, nonatomic) BOOL publishScreenCaptureAudio; #elif TARGET_OS_MAC @property(assign, nonatomic) BOOL publishScreenTrack; @property(assign, nonatomic) BOOL publishSecondaryScreenTrack; #endif @property(assign, nonatomic) BOOL publishCustomAudioTrack; @property(assign, nonatomic) NSInteger publishCustomAudioSourceId; @property(assign, nonatomic) BOOL publishCustomAudioTrackEnableAec; @property(assign, nonatomic) BOOL publishDirectCustomAudioTrack; @property(assign, nonatomic) BOOL publishCustomVideoTrack; @property(assign, nonatomic) BOOL publishEncodedVideoTrack; @property(assign, nonatomic) BOOL publishMediaPlayerAudioTrack; @property(assign, nonatomic) BOOL publishMediaPlayerVideoTrack; @property(assign, nonatomic) BOOL publishTrancodedVideoTrack; @property(assign, nonatomic) BOOL autoSubscribeAudio; @property(assign, nonatomic) BOOL autoSubscribeVideo; @property(assign, nonatomic) BOOL enableAudioRecordingOrPlayout; @property(assign, nonatomic) NSInteger publishMediaPlayerId; @property(assign, nonatomic) AgoraClientRole clientRoleType; @property(assign, nonatomic) AgoraAudienceLatencyLevelType audienceLatencyLevel; @property(assign, nonatomic) AgoraVideoStreamType defaultVideoStreamType; @property(assign, nonatomic) AgoraChannelProfile channelProfile; @property(assign, nonatomic) NSInteger mediaPlayerAudioDelayMs; @property(copy, nonatomic) NSString * _Nullable token; @property(assign, nonatomic) BOOL enableBuiltInMediaEncryption; @property(assign, nonatomic) BOOL publishRhythmPlayerTrack; @property(assign, nonatomic) BOOL isInteractiveAudience; @property(assign, nonatomic) NSInteger customVideoTrackId; @property(assign, nonatomic) BOOL isAudioFilterable; @end
YES
at the same time,
but only one of publishCameraTrack, , publishScreenTrack, publishCustomVideoTrack, or publishEncodedVideoTrack can be set as YES
.Properties
- publishCameraTrack
- Whether to publish the video captured by the camera:
YES
: (Default) Publish the video captured by the camera.NO
: Do not publish the video captured by the camera.
- publishMicrophoneTrack
- Whether to publish the audio captured by the microphone:
YES
: (Default) Publish the audio captured by the microphone.NO
: Do not publish the audio captured by the microphone.
Note: As of v4.0.0, the parameter name is changed from publishAudioTrack to publishMicrophoneTrack. - publishScreenTrack
-
Whether to publish the video captured from the screen:
YES
: Publish the video captured from the screen.NO
: (Default) Do not publish the video captured from the screen.
-
Whether to publish the video captured from the screen:
YES
: Publish the video captured from the screen.NO
: (Default) Do not publish the video captured from the screen.
-
Whether to publish the audio captured from the screen:
YES
: Publish the audio captured from the screen.NO
: (Default) Do not publish the audio captured from the screen.
- publishCustomAudioTrack
- Whether to publish the audio captured from a custom source:
YES
: Publish the audio captured from the custom source.NO
: (Default) Do not publish the audio captured from the custom source.
- publishCustomAudioSourceId
- The ID of the custom audio source to publish. The default value is 0.
If you have set sourceNumber in setExternalAudioSource [2/2] to a value greater than 1, the SDK creates the corresponding number of custom audio tracks and assigns an ID to each audio track, starting from 0.
- publishCustomVideoTrack
- Whether to publish the video captured from a custom source:
YES
: Publish the video captured from the custom source.NO
: (Default) Do not publish the video captured from the custom source.
- publishEncodedVideoTrack
- Whether to publish the encoded video:
YES
: Publish the encoded video.NO
: (Default) Do not publish the encoded video.
- publishMediaPlayerAudioTrack
- Whether to publish the audio from the media player:
YES
: Publish the audio from the media player.NO
: (Default) Do not publish the audio from the media player.
- publishMediaPlayerVideoTrack
- Whether to publish the video from the media player:
YES
: Publish the video from the media player.NO
: (Default) Do not publish the video from the media player.
- autoSubscribeAudio
- Whether to automatically subscribe to all remote audio streams when the user joins a channel:
YES
: (Default) Automatically subscribe to all remote audio streams.NO
: Do not automatically subscribe to any remote audio streams.
- autoSubscribeVideo
- Whether to automatically subscribe to all remote video streams when the user joins the channel:
YES
: (Default) Automatically subscribe to all remote video streams.NO
: Do not automatically subscribe to any remote video streams.
- enableAudioRecordingOrPlayout
- Whether to enable audio capturing or playback:
YES
: (Default) Enable audio capturing or playback.NO
: Do not enable audio capturing or playback.
- publishMediaPlayerId
- The ID of the media player to be published. The default value is 0.
- clientRoleType
-
The user role. See AgoraClientRole.
- audienceLatencyLevel
- The latency level of an audience member in interactive live streaming. See AgoraAudienceLatencyLevelType.
- defaultVideoStreamType
-
The default video-stream type. See AgoraVideoStreamType.
- channelProfile
-
The channel profile. See AgoraChannelProfile.
- token
-
(Optional) The token generated on your server for authentication. See Authenticate Your Users with Token.
CAUTION:- This parameter takes effect only when calling updateChannelWithMediaOptions or updateChannelExWithMediaOptions.
- Ensure that the App ID, channel name, and user name used for creating the token are the same as those used by the sharedEngineWithConfig method for initializing the RTC engine, and those used by the joinChannelByToken [2/4] and joinChannelExByToken methods for joining the channel.
- publishRhythmPlayerTrack
- Whether to publish the sound of a metronome to remote users:
YES
: (Default) Publish the sound of the metronome. Both the local user and remote users can hear the metronome.NO
: Do not publish the sound of the metronome. Only the local user can hear the metronome.
- isInteractiveAudience
- Whether to enable interactive mode:
YES
: Enable interactive mode. Once this mode is enabled and the user role is set as audience, the user can receive remote video streams with low latency.NO
: (Default) Do not enable interactive mode. If this mode is disabled, the user receives the remote video streams in default settings.
Attention:- This parameter only applies to scenarios involving cohosting across channels. The cohosts need to call the joinChannelExByToken method to join the other host's channel as an audience member, and set isInteractiveAudience to
YES
. - This parameter takes effect only when the user role is AgoraClientRoleAudience.
- customVideoTrackId
- The video track ID returned by calling the createCustomVideoTrack method. The default value is 0.
- isAudioFilterable
- Whether the audio stream being published is filtered according to the volume algorithm:
YES
: (Default) The audio stream is filtered. If the audio stream filter is not enabled, this setting does not takes effect.NO
: The audio stream is not filtered.
Attention: If you need to enable this function, contact support@agora.io.
AgoraChannelMediaRelayConfiguration
The definition of AgoraChannelMediaRelayConfiguration.
__attribute__((visibility("default"))) @interface AgoraChannelMediaRelayConfiguration: NSObject @property (strong, nonatomic, readonly) NSDictionary<NSString *, AgoraChannelMediaRelayInfo *> *_Nullable destinationInfos; @property (strong, nonatomic) AgoraChannelMediaRelayInfo *_Nonnull sourceInfo; - (BOOL)setDestinationInfo:(AgoraChannelMediaRelayInfo *_Nonnull)destinationInfo forChannelName:(NSString *_Nonnull)channelName; - (BOOL)removeDestinationInfoForChannelName:(NSString *_Nonnull)channelName; @end
Properties
- sourceInfo
-
The information of the source channel AgoraChannelMediaRelayInfo. It contains the following members:
channelName
: The name of the source channel. The default value isnil
, which means the SDK applies the name of the current channel.uid
: The unique ID to identify the relay stream in the source channel. The default value is 0, which means the SDK generates a randomuid
. You must set it as 0.token
: Thetoken
for joining the source channel. It is generated with thechannelName
anduid
you set insrcInfo
.- If you have not enabled the App Certificate, set this parameter as the default value
nil
, which means the SDK applies the App ID. - If you have enabled the App Certificate, you must use the
token
generated with thechannelName
anduid
, and theuid
must be set as 0.
- If you have not enabled the App Certificate, set this parameter as the default value
- destinationInfos
-
The information of the destination channel AgoraChannelMediaRelayInfo. It contains the following members:
channelName
: The name of the destination channel.uid
: The unique ID to identify the relay stream in the destination channel. The value ranges from 0 to (232-1). To avoid UID conflicts, this UID must be different from any other UID in the destination channel. The default value is 0, which means the SDK generates a random UID. Do not set this parameter as the UID of the host in the destination channel, and ensure that this UID is different from any other UID in the channel.token
: Thetoken
for joining the destination channel. It is generated with thechannelName
anduid
you set indestInfos
.- If you have not enabled the App Certificate, set this parameter as the default value
nil
, which means the SDK applies the App ID. - If you have enabled the App Certificate, you must use the
token
generated with thechannelName
anduid
.
- If you have not enabled the App Certificate, set this parameter as the default value
AgoraContentInspectConfig
Configuration of video screenshot and upload.
__attribute__((visibility("default"))) @interface AgoraContentInspectConfig: NSObject
@property (nonatomic, copy) NSString* _Nullable extraInfo;
@property(copy, nonatomic) NSArray<AgoraContentInspectModule*>* _Nullable modules;
@end
Parameters
- extraInfo
-
Additional information on the video content (maximum length: 1024 Bytes).
The SDK sends the screenshots and additional information on the video content to the Agora server. Once the video screenshot and upload process is completed, the Agora server sends the additional information and the callback notification to your server.
- modules
-
Functional module. See AgoraContentInspectModule.
A maximum of 32 AgoraContentInspectModule instances can be configured, and the value range of MAX_CONTENT_INSPECT_MODULE_COUNT is an integer in [1,32].
Attention: A function module can only be configured with one instance at most. Currently only the video screenshot and upload function is supported. - moduleCount
- The number of functional modules, that is,the number of configured AgoraContentInspectModule instances, must be the same as the number of instances configured in modules. The maximum number is 32.
AgoraContentInspectModule
AgoraContentInspectModuleA structure used to configure the frequency of video screenshot and upload.
__attribute__((visibility("default"))) @interface AgoraContentInspectModule: NSObject @property (assign, nonatomic) AgoraContentInspectType type; @property (assign, nonatomic) NSInteger interval; @end
Properties
- type
- Types of functional module. See AgoraContentInspectType.
- interval
- The frequency (s) of video screenshot and upload. The value should be set as larger than 0. The default value is 0, the SDK does not take screenshots. Agora recommends that you set the value as 10; you can also adjust it according to your business needs.
AgoraClientRoleOptions
The detailed options of a user.
__attribute__((visibility("default"))) @interface AgoraClientRoleOptions: NSObject @property (assign, nonatomic) AgoraAudienceLatencyLevelType audienceLatencyLevel; @end
Properties
- audienceLatencyLevel
- The latency level of an audience member in interactive live streaming. See AgoraAudienceLatencyLevelType.
AgoraColorEnhanceOptions
The color enhancement options.
__attribute__((visibility("default"))) @interface AgoraColorEnhanceOptions : NSObject @property(nonatomic, assign) float strengthLevel; @property(nonatomic, assign) float skinProtectLevel; @end
Properties
- strengthLevel
- The level of color enhancement. The value range is [0.0, 1.0].
0.0
is the default value, which means no color enhancement is applied to the video. The higher the value, the higher the level of color enhancement. The default value is0.5
. - skinProtectLevel
The level of skin tone protection. The value range is [0.0, 1.0].
0.0
means no skin tone protection. The higher the value, the higher the level of skin tone protection. The default value is1.0
.- When the level of color enhancement is higher, the portrait skin tone can be significantly distorted, so you need to set the level of skin tone protection.
- When the level of skin tone protection is higher, the color enhancement effect can be slightly reduced.
AgoraDataStreamConfig
The configurations for the data stream.
__attribute__((visibility("default"))) @interface AgoraDataStreamConfig: NSObject @property (assign, nonatomic) BOOL ordered; @property (assign, nonatomic) BOOL syncWithAudio; @end
The following table shows the SDK behaviors under different parameter settings:
syncWithAudio |
ordered |
SDK behaviors |
---|---|---|
NO |
NO |
The SDK triggers the receiveStreamMessageFromUid callback immediately after the receiver receives a data packet. |
YES |
NO |
If the data packet delay is within the audio delay, the SDK triggers the receiveStreamMessageFromUid callback when the synchronized audio packet is played out. If the data packet delay exceeds the audio delay, the SDK triggers the receiveStreamMessageFromUid callback as soon as the data packet is received. |
NO |
YES |
If the delay of a data packet is less than five seconds, the SDK corrects the order of the data packet. If the delay of a data packet exceeds five seconds, the SDK discards the data packet. |
YES |
YES |
If the delay of the data packet is within the range of the audio delay, the SDK corrects the order of the data packet. If the delay of a data packet exceeds the audio delay, the SDK discards this data packet. |
Properties
- syncWithAudio
-
Whether to synchronize the data packet with the published audio packet.
YES
: Synchronize the data packet with the audio packet.NO
: Do not synchronize the data packet with the audio packet.
- ordered
-
Whether the SDK guarantees that the receiver receives the data in the sent order.
YES
: Guarantee that the receiver receives the data in the sent order.NO
: Do not guarantee that the receiver receives the data in the sent order.
YES
if you need the receiver to receive the data packet immediately.
AgoraEchoTestConfiguration
The configuration of the audio and video call loop test.
NS_SWIFT_NAME(AgoraEchoTestConfiguration) __attribute__((visibility("default"))) @interface AgoraEchoTestConfiguration : NSObject @property(strong, nonatomic) VIEW_CLASS* _Nullable view NS_SWIFT_NAME(view); @property(assign, nonatomic) BOOL enableAudio NS_SWIFT_NAME(enableAudio); @property(assign, nonatomic) BOOL enableVideo NS_SWIFT_NAME(enableVideo); @property(copy, nonatomic) NSString* _Nullable token NS_SWIFT_NAME(token); @property(copy, nonatomic) NSString* _Nonnull channelId NS_SWIFT_NAME(channelId); @end
Properties
- view
- The view used to render the local user's video. This parameter is only applicable to scenarios testing video devices, that is, when enableVideo is YES.
- enableAudio
- Whether to enable the audio device for the loop test:
- YES: (Default) Enable the audio device. To test the audio device, set this parameter as YES.
- NO: Disable the audio device.
- enableVideo
- Whether to enable the video device for the loop test:
- YES: (Default) Enable the video device. To test the video device, set this parameter as YES.
- NO: Disable the video device.
- token.
- The token used to secure the audio and video call loop test. If you do not enable App Certificate in Agora Console, you do not need to pass a value in this parameter; if you have enabled App Certificate in Agora Console, you must pass a token in this parameter; the
uid
used when you generate the token must be 0xFFFFFFFF, and the channel name used must be the channel name that identifies each audio and video call loop tested. For server-side token generation, see Authenticate Your Users with Tokens. - channelId
- The channel name that identifies each audio and video call loop. To ensure proper loop test functionality, the channel name passed in to identify each loop test cannot be the same when users of the same project (App ID) perform audio and video call loop tests on different devices.
AgoraEncodedAudioFrameInfo
Audio information after encoding.
__attribute__((visibility("default"))) @interface AgoraEncodedAudioFrameInfo: NSObject @property (assign, nonatomic) NSInteger samplesPerChannel; @property (assign, nonatomic) NSInteger channels; @property (assign, nonatomic) NSInteger samplesPerSec; @property (assign, nonatomic) AgoraAudioCodecType codecType; @end
Properties
- codecType
- Audio Codec type: AgoraAudioCodecType
- samplesPerSec
- Audio sample rate (Hz).
- samplesPerChannel
- The number of audio samples per channel.
- channels
- The number of audio channels.
AgoraEncodedVideoFrameInfo
Information about externally encoded video frames.
__attribute__((visibility("default"))) @interface AgoraEncodedVideoFrameInfo: NSObject @property (assign, nonatomic) AgoraVideoCodecType codecType; @property (assign, nonatomic) NSInteger width; @property (assign, nonatomic) NSInteger height; @property (assign, nonatomic) NSInteger framesPerSecond; @property (assign, nonatomic) AgoraVideoFrameType frameType; @property (assign, nonatomic) NSInteger rotation; @property (assign, nonatomic) NSInteger trackId; @property (assign, nonatomic) NSInteger captureTimeMs; @property (assign, nonatomic) NSInteger uid; @property (assign, nonatomic) AgoraVideoStreamType streamType; @end
Properties
- codecType
- The codec type of the local video stream. See AgoraVideoCodecType. The default value is
AgoraVideoCodecTypeH264 (2)
. - width
- Width (pixel) of the video frame.
- height
- Height (pixel) of the video frame.
- framesPerSecond
-
The number of video frames per second.
When this parameter is not
0
, you can use it to calculate the Unix timestamp of externally encoded video frames. - frameType
- The video frame type. See AgoraVideoFrameType.
- rotation
- The rotation information of the video frame. See AgoraVideoRotation.
- trackId
- Reserved for future use.
- captureTimeMs
- The Unix timestamp (ms) for capturing the external encoded video frames.
- uid
- The user ID to push the externally encoded video frame.
- streamType
- The type of video streams. See AgoraVideoStreamType.
AgoraEncryptionConfig
Built-in encryption configurations.
__attribute__((visibility("default"))) @interface AgoraEncryptionConfig: NSObject @property (assign, nonatomic) AgoraEncryptionMode encryptionMode; @property (copy, nonatomic) NSString * _Nullable encryptionKey; @property (strong, nonatomic) NSData * _Nullable encryptionKdfSalt; @end
Properties
- encryptionMode
-
The built-in encryption mode. See AgoraEncryptionMode. Agora recommends using
AgoraEncryptionModeAES128GCM2
orAgoraEncryptionModeAES256GCM2
encrypted mode. These two modes support the use of salt for higher security. - encryptionKey
-
Encryption key in string type with unlimited length. Agora recommends using a 32-byte key.
Attention: If you do not set an encryption key or set it asnil
, you cannot use the built-in encryption, and the SDK returns-2
. - encryptionKdfSalt
-
Salt, 32 bytes in length. Agora recommends that you use OpenSSL to generate salt on the server side. See Media Stream Encryption for details. See "Media Stream Encryption" for details.
Attention: This parameter takes effect only inAgoraEncryptionModeAES128GCM2
orAgoraEncryptionModeAES256GCM2
encrypted mode. In this case, ensure that this parameter is not0
.
AgoraVideoFrame
The external video frame.
__attribute__((visibility("default"))) @interface AgoraVideoFrame : NSObject @property(assign, nonatomic) NSInteger format; @property(assign, nonatomic) CMTime time; @property(assign, nonatomic) int stride DEPRECATED_MSG_ATTRIBUTE("use strideInPixels instead"); @property(assign, nonatomic) int strideInPixels; @property(assign, nonatomic) int height; @property(assign, nonatomic) CVPixelBufferRef _Nullable textureBuf; @property(strong, nonatomic) NSData *_Nullable dataBuf; @property(assign, nonatomic) int cropLeft; @property(assign, nonatomic) int cropTop; @property(assign, nonatomic) int cropRight; @property(assign, nonatomic) int cropBottom; @property(assign, nonatomic) int rotation; @end
Properties
- format
- The format of the incoming video frame. This parameter must be specified as one of the following values:
- 1: I420
- 2: BGRA
- 3: NV21
- 4: RGBA
- 5: IMC2
- 7: ARGB
- 8: NV12
- 12: iOS texture (CVPixelBufferRef)
- 16: I422.
- textureBuf
- Buffer of iOS texture.
- stride
- Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.
- Deprecated:
- Use strideInPixels instead.
- strideInPixels
- The line span of the frame, that is, the number of pixels between two adjacent lines of video frames.Attention:
- The unit of this parameter is pixels, not bytes.
- If the video is in Texture format, set this parameter to the width of Texture.
- If the video frame format is set to 12, do not use this field.
- height
- Height of the incoming video frame.
- This parameter only applies to video data in Texture format. The MetaData buffer. The default value is
NULL
. - This parameter only applies to video data in Texture format. The MetaData size. The default value is
0
. - cropLeft
- Raw data related parameter. The number of pixels trimmed from the left. The default value is 0.
- cropTop
- Raw data related parameter. The number of pixels trimmed from the top. The default value is 0.
- cropRight
- Raw data related parameter. The number of pixels trimmed from the right. The default value is 0.
- cropBottom
- Raw data related parameter. The number of pixels trimmed from the bottom. The default value is 0.
- rotation
- Raw data related parameter. The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.
- time
- Timestamp (ms) of the incoming video frame. An incorrect timestamp results in frame loss or unsynchronized audio and video.
AgoraImageTrackOptions
Image configurations
__attribute__((visibility("default"))) @interface AgoraImageTrackOptions : NSObject @property(copy, nonatomic) NSString *_Nullable imageUrl; @property(assign, nonatomic) int fps;
Properties
- imageUrl
- The URL of the image that you want to use to replace the video feeds. The image must be in PNG format. This method supports adding an image from the local absolute or relative file path.
- fps
- The frame rate of the video streams being published. The value range is [1,30]. The default value is 1.
AgoraLastmileProbeConfig
Configurations of the last-mile network test.
__attribute__((visibility("default"))) @interface AgoraLastmileProbeConfig : NSObject @property (assign, nonatomic) BOOL probeUplink; @property (assign, nonatomic) BOOL probeDownlink; @property (assign, nonatomic) NSUInteger expectedUplinkBitrate; @property (assign, nonatomic) NSUInteger expectedDownlinkBitrate; @end
Properties
- probeUplink
-
Sets whether to test the uplink network. Some users, for example, the audience members in a LIVE_BROADCASTING channel, do not need such a test.
YES
: Test the uplink network.NO
: Do not test the uplink network.
- probeDownlink
-
Sets whether to test the downlink network:
YES
: Test the downlink network.NO
: Do not test the downlink network.
- expectedUplinkBitrate
- The expected maximum uplink bitrate (bps) of the local user. The value range is [100000, 5000000]. Agora recommends referring to setVideoEncoderConfiguration to set the value.
- expectedDownlinkBitrate
- The expected maximum downlink bitrate (bps) of the local user. The value range is [100000,5000000].
AgoraLastmileProbeOneWayResult
Results of the uplink or downlink last-mile network test.
__attribute__((visibility("default"))) @interface AgoraLastmileProbeOneWayResult : NSObject @property (assign, nonatomic) NSUInteger packetLossRate; @property (assign, nonatomic) NSUInteger jitter; @property (assign, nonatomic) NSUInteger availableBandwidth; @end
Properties
- packetLossRate
- The packet loss rate (%).
- jitter
- The network jitter (ms).
- availableBandwidth
- The estimated available bandwidth (bps).
AgoraLastmileProbeResult
Results of the uplink and downlink last-mile network tests.
__attribute__((visibility("default"))) @interface AgoraLastmileProbeResult : NSObject @property (assign, nonatomic) AgoraLastmileProbeResultState state; @property (assign, nonatomic) NSUInteger rtt; @property (strong, nonatomic) AgoraLastmileProbeOneWayResult *_Nonnull uplinkReport; @property (strong, nonatomic) AgoraLastmileProbeOneWayResult *_Nonnull downlinkReport; @end
Properties
- state
-
The status of the last-mile probe test. See AgoraLastmileProbeResultState .
- uplinkReport
- Results of the uplink last-mile network test. See AgoraLastmileProbeOneWayResult.
- downlinkReport
- Results of the downlink last-mile network test. See AgoraLastmileProbeOneWayResult.
- rtt
- The round-trip time (ms).
AgoraLeaveChannelOptions
The options for leaving a channel.
__attribute__((visibility("default"))) @interface AgoraLeaveChannelOptions : NSObject @property(nonatomic, assign) BOOL stopAudioMixing; @property(nonatomic, assign) BOOL stopAllEffect; @property(nonatomic, assign) BOOL stopMicrophoneRecording; @end
Properties
- stopAudioMixing
- Whether to stop playing and mixing the music file when a user leaves the channel.
YES
: (Default) Stop playing and mixing the music file.NO
: Do not stop playing and mixing the music file.
- stopAllEffect
- Whether to stop playing all audio effects when a user leaves the channel.
YES
: (Default) Stop playing all audio effects.NO
: Do not stop playing any audio effect.
- stopMicrophoneRecording
- Whether to stop microphone recording when a user leaves the channel.
YES
: (Default) Stop microphone recording.NO
: Do not stop microphone recording.
AgoraLiveTranscoding
Transcoding configurations for Media Push.
__attribute__((visibility("default"))) @interface AgoraLiveTranscoding : NSObject @property(assign, nonatomic) CGSize size; @property(assign, nonatomic) NSInteger videoBitrate; @property(assign, nonatomic) NSInteger videoFramerate; @property(assign, nonatomic) BOOL lowLatency; @property(assign, nonatomic) NSInteger videoGop; @property(assign, nonatomic) AgoraVideoCodecProfileType videoCodecProfile; @property(assign, nonatomic) AgoraVideoCodecTypeForStream videoCodecType; @property(copy, nonatomic) NSArray<AgoraLiveTranscodingUser *> *_Nullable transcodingUsers; @property(copy, nonatomic) NSString *_Nullable transcodingExtraInfo; @property(strong, nonatomic) AgoraImage *_Nullable watermark; @property (copy, nonatomic) NSArray<AgoraImage *> *_Nullable watermarkArray; @property(strong, nonatomic) AgoraImage *_Nullable backgroundImage; @property (copy, nonatomic) NSArray<AgoraImage *> *_Nullable backgroundImageArray; @property(strong, nonatomic) COLOR_CLASS *_Nullable backgroundColor; @property(assign, nonatomic) AgoraAudioSampleRateType audioSampleRate; @property(assign, nonatomic) NSInteger audioBitrate; @property(assign, nonatomic) NSInteger audioChannels; @property(assign, nonatomic) AgoraAudioCodecProfileType audioCodecProfile; + (AgoraLiveTranscoding *_Nonnull)defaultTranscoding; - (int)addUser:(AgoraLiveTranscodingUser *_Nonnull)user; - (int)removeUser:(NSUInteger)uid; - (void)setAdvancedFeatures:(NSString* _Nonnull)featureName opened:(BOOL)opened; - (NSArray<AgoraLiveStreamAdvancedFeature*>* _Nullable)getAdvancedFeatures; @end
Properties
- size
-
The size of the video (width and height in pixels).
- When pushing video streams to the CDN, note the following:
- The value range of the width is [64,1920]. If the value is less than 64, Agora server automatically adjusts it to 64; if the value is greater than 1920, Agora server automatically adjusts it to 1920.
- The value range of the height is [64,1080]. If the value is less than 64, Agora server automatically adjusts it to 64; if the value is greater than 1080, Agora server automatically adjusts it to 1080.
- When pushing audio streams to the CDN, set the width and height as 0.
- When pushing video streams to the CDN, note the following:
- videoBitrate
-
Bitrate of the output video stream for Media Push in Kbps. The default value is 400 Kbps.
Set this parameter according to the Video profile table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range.
- videoFrameRate
-
Frame rate (in fps) of the output video stream set for Media Push. The default value is 15 , and the value range is (0,30].
Attention: The Agora server adjusts any value over 30 to 30. - lowLatency
-
- Deprecated
- This parameter is deprecated.
Latency mode:
YES
: Low latency with unassured quality.NO
: (Default) High latency with assured quality.
- videoGop
- GOP (Group of Pictures) in fps of the video frames for Media Push. The default value is 30.
- videoCodecProfile
-
Video codec profile type for Media Push. Set it as 66, 77, or 100 (default). See AgoraVideoCodecProfileType for details.
Attention: If you set this parameter to any other value, Agora adjusts it to the default value. - videoCodecType
- Video codec profile types for Media Push. See AgoraVideoCodecTypeForStream.
- transcodingUsers
-
Manages the user layout configuration in the Media Push. Agora supports a maximum of 17 transcoding users in a Media Push channel. See AgoraLiveTranscodingUser.
- transcodingExtraInfo
-
Reserved property. Extra user-defined information to send SEI for the H.264/H.265 video stream to the CDN client. Maximum length: 4096 bytes. For more information on SEI, see SEI-related questions.
- backgroundColor
-
The background color in RGB hex.
The format is a hexadecimal integer defined by RGB, without the # sign, such as 0xFFB6C1 for light pink. The default value is 0x000000 (black).
COLOR_CLASS is a general name for the type:- iOS: UIColor
- macOS: NSColor
- watermark
-
- Deprecated
- Use watermarkArray.
The watermark on the live video. The image format needs to be PNG. See AgoraImage.
- backgroundImage
-
- Deprecated
- Use backgroundImageArraybackgroundImageArray instead.
The number of background images on the live video. The image format needs to be PNG. See AgoraImage.
- backgroundImageArray
- An array of background images on the live video. See AgoraImage. You can use backgroundImageArray to add one or more background images. The image format needs to be PNG. The total number of watermarks and background images on a live video must be greater than or equal to 0 and less than or equal to 10.
- audioSampleRate
-
The audio sampling rate (Hz) of the output media stream. See AgoraAudioSampleRateType.
- audioBitrate
-
Bitrate (Kbps) of the audio output stream for Media Push. The default value is 48, and the highest value is 128.
- audioChannels
-
The number of audio channels for Media Push. Agora recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose 3, 4, or 5.
- 1: (Default) Mono.
- 2: Stereo.
- 3: Three audio channels.
- 4: Four audio channels.
- 5: Five audio channels.
- audioCodecProfile
- Audio codec profile type for Media Push. See AgoraAudioCodecProfileType.
- watermarkArray
- The array of watermarks on the live video. See AgoraImage. You can add one or more watermarks using watermarkArray. The image format needs to be PNG. The total number of watermarks and background images on a live video must be greater than or equal to 0 and less than or equal to 10.
addUser
Adds a user for video mixing during the CDN live streaming.
- (int)addUser:(AgoraLiveTranscodingUser* _Nonnull)user;
Parameters
- user
- The transcoding user. See AgoraLiveTranscodingUser for details.
Returns
- 0: Success.
- < 0: Failure.
removeUser
Removes a user from video mixing during the CDN live streaming.
- (int)removeUser:(NSUInteger)uid;
Parameters
- uid
- The ID of the user to be removed.
Returns
- 0: Success.
- < 0: Failure.
defaultTranscoding
Creates a default transcoding object.
+ (AgoraLiveTranscoding* _Nonnull)defaultTranscoding;
Returns
The default AgoraLiveTranscoding object.
getAdvancedFeatures
Gets the status of the advanced features of streaming with transcoding.
- (NSArray<AgoraLiveStreamAdvancedFeature*>* _Nullable)getAdvancedFeatures;
If you want to enable the advanced features of streaming with transcoding, contact support@agora.io.
Returns
The feature name and whether the feature is enabled. See AgoraLiveStreamAdvancedFeature.
setAdvancedFeatures
Sets whether to enable the advanced features of streaming with transcoding.
- (void)setAdvancedFeatures:(NSString* _Nonnull)featureName opened:(BOOL)opened;
If you want to enable the advanced features of streaming with transcoding, contact support@agora.io.
Parameters
- featureName
- The feature names, including LBHQ (high-quality video with a lower bitrate) and VEO (optimized video encoder).
- opened
- Whether to enable the advanced features of streaming with transcoding:
YES
: Enable the advanced features.NO
: (Default) Do not enable the advanced features.
AgoraLiveStreamAdvancedFeature
The configuration for advanced features of the RTMP or RTMPS streaming with transcoding.
__attribute__((visibility("default"))) @interface AgoraLiveStreamAdvancedFeature : NSObject @property(copy, nonatomic) NSString* _Nullable featureName; @property(assign, nonatomic) BOOL opened; @end
If you want to enable the advanced features of streaming with transcoding, contact support@agora.io.
Properties
- featureName
- The feature names, including LBHQ (high-quality video with a lower bitrate) and VEO (optimized video encoder).
- opened
- Whether to enable the advanced features of streaming with transcoding:
YES
: Enable the advanced features.NO
: (Default) Do not enable the advanced features.
AgoraRtcLocalAudioStats
Local audio statistics.
__attribute__((visibility("default"))) @interface AgoraRtcLocalAudioStats : NSObject @property(assign, nonatomic) NSUInteger numChannels; @property(assign, nonatomic) NSUInteger sentSampleRate; @property(assign, nonatomic) NSUInteger sentBitrate; @property(assign, nonatomic) NSUInteger internalCodec; @property(assign, nonatomic) NSUInteger txPacketLossRate; @property(assign, nonatomic) NSUInteger audioDeviceDelay; @end
Properties
- numChannels
- The number of audio channels.
- sentSampleRate
- The sampling rate (Hz) of sending the local user's audio stream.
- sentBitrate
- The average bitrate (Kbps) of sending the local user's audio stream.
- txPacketLossRate
- The packet loss rate (%) from the local client to the Agora server before applying the anti-packet loss strategies.
- internalCodec
- The internal payload codec.
- audioDeviceDelay
- The delay of the audio device module when playing or recording audio.
AgoraRtcLocalVideoStats
The statistics of the local video stream.
__attribute__((visibility("default"))) @interface AgoraRtcLocalVideoStats : NSObject @property(assign, nonatomic) NSUInteger sentBitrate; @property(assign, nonatomic) NSUInteger sentFrameRate; @property(assign, nonatomic) NSUInteger uid; @property(assign, nonatomic) NSInteger captureFrameRate; @property(assign, nonatomic) NSInteger captureFrameWidth; @property(assign, nonatomic) NSInteger captureFrameHeight; @property(assign, nonatomic) NSInteger regulatedCaptureFrameRate; @property(assign, nonatomic) NSInteger regulatedCaptureFrameWidth; @property(assign, nonatomic) NSInteger regulatedCaptureFrameHeight; @property(assign, nonatomic) NSInteger encoderOutputFrameRate; @property(assign, nonatomic) NSInteger rendererOutputFrameRate; @property(assign, nonatomic) NSInteger targetFrameRate; @property(assign, nonatomic) AgoraVideoQualityAdaptIndication qualityAdaptIndication; @property(assign, nonatomic) NSInteger targetBitrate; @property(assign, nonatomic) NSInteger encodedBitrate; @property(assign, nonatomic) NSInteger encodedFrameWidth; @property(assign, nonatomic) NSInteger encodedFrameHeight; @property(assign, nonatomic) NSInteger encodedFrameCount; @property(assign, nonatomic) AgoraVideoCodecType codecType; @property(assign, nonatomic) NSInteger txPacketLossRate; @property(assign, nonatomic) AgoraCaptureBrightnessLevelType captureBrightnessLevel NS_SWIFT_NAME(captureBrightnessLevel); @end
Properties
- uid
- The user ID of the local user.
- sentBitrate
-
The actual bitrate (Kbps) while sending the local video stream.Attention: This value does not include the bitrate for resending the video after packet loss.
- sentFrameRate
- The actual frame rate (fps) while sending the local video stream.Attention: This value does not include the frame rate for resending the video after packet loss.
- captureFrameRate
- The frame rate (fps) for capturing the local video stream.
- captureFrameWidth
- The width (px) for capturing the local video stream.
- captureFrameHeight
- The height (px) for capturing the local video stream.
- regulatedCaptureFrameRate
- The frame rate (fps) adjusted by the built-in video capture adapter (regulator) of the SDK for capturing the local video stream. The regulator adjusts the frame rate of the video captured by the camera according to the video encoding configuration.
- regulatedCaptureFrameWidth
- The width (px) adjusted by the built-in video capture adapter (regulator) of the SDK for capturing the local video stream. The regulator adjusts the height and width of the video captured by the camera according to the video encoding configuration.
- regulatedCaptureFrameHeight
- The height (px) adjusted by the built-in video capture adapter (regulator) of the SDK for capturing the local video stream. The regulator adjusts the height and width of the video captured by the camera according to the video encoding configuration.
- encoderOutputFrameRate
- The output frame rate (fps) of the local video encoder.
- rendererOutputFrameRate
- The output frame rate (fps) of the local video renderer.
- targetBitrate
- The target bitrate (Kbps) of the current encoder. This is an estimate made by the SDK based on the current network conditions.
- targetFrameRate
- The target frame rate (fps) of the current encoder.
- qualityAdaptIndication
- The quality adaption of the local video stream in the reported interval (based on the target frame rate and target bitrate). See AgoraVideoQualityAdaptIndication.
- encodedBitrate
-
The bitrate (Kbps) while encoding the local video stream.Attention: This value does not include the bitrate for resending the video after packet loss.
- encodedFrameWidth
- The width of the encoded video (px).
- encodedFrameHeight
- The height of the encoded video (px).
- encodedFrameCount
- The number of sent video frames, represented by an aggregate value.
- codecType
- The codec type of the local video. See AgoraVideoCodecType.
- txPacketLossRate
- The video packet loss rate (%) from the local client to the Agora server before applying the anti-packet loss strategies.
- captureBrightnessLevel
- The brightness level of the video image captured by the local camera. See AgoraCaptureBrightnessLevelType.
AgoraLogConfig
Configuration of Agora SDK log files.
__attribute__((visibility("default"))) @interface AgoraLogConfig: NSObject @property (copy, nonatomic) NSString * _Nullable filePath; @property (assign, nonatomic) NSInteger fileSizeInKB; @property (assign, nonatomic) AgoraLogLevel level; @end
Properties
- filePath
-
The complete path of the log files. Ensure that the path for the log file exists and is writable. You can use this parameter to rename the log files.
The default path is:- If Sandbox is enabled: App~/Library/Logs/agorasdk.log. For example, /Users/<username>/Library/Containers/<AppBundleIdentifier>/Data/Library/Logs/agorasdk.log.
- If Sandbox is disabled: ~/Library/Logs/agorasdk.log.
- fileSizeInKB
- The size (KB) of an
agorasdk.log
file. The value range is [128,1024]. The default value is 1,024 KB. If you setfileSizeInKByte
to a value lower than 128 KB, the SDK adjusts it to 128 KB. If you setfileSizeInKBytes
to a value higher than 1,024 KB, the SDK adjusts it to 1,024 KB. - level
-
The output level of the SDK log file. See AgoraLogLevel.
For example, if you set the log level to WARN, the SDK outputs the logs within levels FATAL, ERROR, and WARN.
AgoraLowlightEnhanceOptions
The low-light enhancement options.
__attribute__((visibility("default"))) @interface AgoraLowlightEnhanceOptions : NSObject @property(nonatomic, assign) AgoraLowlightEnhanceMode mode; @property(nonatomic, assign) AgoraLowlightEnhanceLevel level; @end
Properties
- level
- The low-light enhancement level. See AgoraLowlightEnhanceLevel.
- mode
- The low-light enhancement mode. See AgoraLowlightEnhanceMode.
AgoraLowlightEnhanceMode
The low-light enhancement mode.
Enumerator
- AgoraLowlightEnhanceModeAuto
- 0: (Default) Automatic mode. The SDK automatically enables or disables the low-light enhancement feature according to the ambient light to compensate for the lighting level or prevent overexposure, as necessary.
- AgoraLowlightEnhanceModeManual
- 1: Manual mode. Users need to enable or disable the low-light enhancement feature manually.
AgoraLowlightEnhanceLevel
The low-light enhancement level.
Enumerator
- AgoraLowlightEnhanceLevelQuality
- 0: (Default) Promotes video quality during low-light enhancement. It processes the brightness, details, and noise of the video image. The performance consumption is moderate, the processing speed is moderate, and the overall video quality is optimal.
- AgoraLowlightEnhanceLevelFast
- 1: Promotes performance during low-light enhancement. It processes the brightness and details of the video image. The processing speed is faster.
AgoraMediaRecorderConfiguration
Configurations for the local audio and video recording.
__attribute__((visibility("default"))) @interface AgoraMediaRecorderConfiguration : NSObject @property(copy, nonatomic) NSString* _Nonnull storagePath; @property(assign, nonatomic) AgoraMediaRecorderContainerFormat containerFormat; @property(assign, nonatomic) AgoraMediaRecorderStreamType streamType; @property(assign, nonatomic) NSUInteger maxDurationMs; @property(assign, nonatomic) NSUInteger recorderInfoUpdateInterval;
Properties
- storagePath
- The absolute path (including the filename extensions) of the recording file. For example:
- Windows:
C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.mp4
- iOS:
/App Sandbox/Library/Caches/example.mp4
- macOS:
/Library/Logs/example.mp4
- Android:
/storage/emulated/0/Android/data/<package name>/files/example.mp4
Attention: Ensure that the directory for the log files exists and is writable. - Windows:
- containerFormat
- The format of the recording file. See AgoraMediaRecorderContainerFormat.
- streamType
- The recording content. See AgoraMediaRecorderStreamType.
- maxDurationMs
- The maximum recording duration, in milliseconds. The default value is 120000.
- recorderInfoUpdateInterval
- The interval (ms) of updating the recording information. The value range is [1000,10000]. Based on the value you set in this parameter, the SDK triggers the informationDidUpdated callback to report the updated recording information.
AgoraMediaSource
Information related to the media file to be played and the playback scenario configurations.
__attribute__((visibility("default"))) @interface AgoraMediaSource : NSObject @property(copy, nonatomic) NSString *_Nullable url; @property(copy, nonatomic) NSString *_Nullable uri; @property(assign, nonatomic) NSUInteger startPos; @property(assign, nonatomic) BOOL enableCache; @property(assign, nonatomic) BOOL autoPlay; @property(assign, nonatomic) BOOL isAgoraSource; @property(assign, nonatomic) BOOL isLiveSource; @property(copy, nonatomic) AgoraRtcMediaPlayerCustomSourceOnReadCallback _Nonnull playerOnReadCallback; @property(copy, nonatomic) AgoraRtcMediaPlayerCustomSourceOnSeekCallback _Nonnull playerOnSeekCallback; @end @end
Properties
- url
-
The URL of the media file to be played.
Note: If you need to open a custom media resource, you do not have to pass in a value to the url. - uri
- The URI (Uniform Resource Identifier) of the media file.
- startPos
- The starting position (ms) for playback. The default value is 0.
- autoPlay
- Whether to enable autoplay once the media file is opened:
YES
: (Default) Enable autoplay.NO
: Disable autoplay.
Note:If autoplay is disabled, you need to call the play method to play a media file after it is opened.
- enableCache
- Whether to cache the media file when it is being played:
YES
:Enable caching.NO
: (Default) Disable caching.
Note:- If you need to enable caching, pass in a value to uri; otherwise, caching is based on the url of the media file.
- If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See AgoraMediaPlayerCacheStatistics.
- isAgoraSource
- Whether the media resource to be opened is a live stream or on-demand video distributed through Media Broadcast service:
YES
: The media resource is a live stream or on-demand video distributed through Media Broadcast service.NO
: (Default) The media resource is not a live stream or on-demand video distributed through Media Broadcast service.
Note:If you need to open a live stream or on-demand video distributed through Broadcast Streaming service, pass in the URL of the media resource to url, and set isAgoraSource as
YES
; otherwise, you don't need to set the isAgoraSource parameter. - isLiveSource
- Whether the media resource to be opened is a live stream:
YES
: The media resource is a live stream.NO
: (Default) The media resource is not a live stream.
If the media resource you want to open is a live stream, Agora recommends that you set this parameter as
YES
so that the live stream can be loaded more quickly.Note:If the media resource you open is not a live stream, but you set isLiveSource as
YES
, the media resource is not to be loaded more quickly. - playerOnReadCallback
-
Occurs when the SDK reads the media resource data. See AgoraRtcMediaPlayerCustomSourceOnReadCallback.
Note:If you need to open a custom media resource, such as an encrypted media file, pass in values to playerOnReadCallback and playerOnSeekCallback instead of to url.
- playerOnSeekCallback
-
Occurs when the SDK seeks the media resource data. See AgoraRtcMediaPlayerCustomSourceOnSeekCallback.
Note:If you need to open a custom media resource, such as an encrypted media file, pass in values to playerOnReadCallback and playerOnSeekCallback instead of to url.
AgoraRtcMediaStreamInfo
The detailed information of the media stream.
__attribute__((visibility("default"))) @interface AgoraMediaStreamInfo : NSObject @property(nonatomic, assign) NSInteger streamIndex; @property(nonatomic, assign) AgoraMediaStreamType streamType; @property(nonatomic, copy) NSString *_Nonnull codecName; @property(nonatomic, copy) NSString *_Nullable language; @property(nonatomic, assign) NSInteger videoFrameRate; @property(nonatomic, assign) NSInteger videoBitRate; @property(nonatomic, assign) NSInteger videoWidth; @property(nonatomic, assign) NSInteger videoHeight; @property(nonatomic, assign) NSInteger audioSampleRate; @property(nonatomic, assign) NSInteger audioChannels; @property(nonatomic, assign) NSInteger duration; @property(nonatomic, assign) NSInteger rotation; @end
Properties
- streamIndex
- The index of the media stream.
- streamType
- The type of the media stream. See AgoraMediaStreamType.
- codecName
- The codec of the media stream.
- language
- The language of the media stream.
- videoFrameRate
- This parameter only takes effect for video streams, and indicates the video frame rate (fps).
- videoBitrate
- This parameter only takes effect for video streams, and indicates the video bitrate (bps).
- videoWidth
- This parameter only takes effect for video streams, and indicates the video width (pixel).
- videoHeight
- This parameter only takes effect for video streams, and indicates the video height (pixel).
- rotation
- This parameter only takes effect for video streams, and indicates the video rotation angle.
- audioSampleRate
- This parameter only takes effect for audio streams, and indicates the audio sample rate (Hz).
- audioChannels
- This parameter only takes effect for audio streams, and indicates the audio channel number.
- duration
- The total duration (s) of the media stream.
AgoraMediaPlayerUpdatedInfo
Information related to the media player.
__attribute__((visibility("default"))) @interface AgoraMediaPlayerUpdatedInfo : NSObject @property(copy, nonatomic) NSString *_Nullable playerId; @property(copy, nonatomic) NSString *_Nullable deviceId; @property(strong, nonatomic) AgoraMediaPlayerCacheStatistics *_Nullable cacheStatistics; @end
Properties
- playerId
- The ID of a media player.
- deviceId
- The ID of a deivce.
- CacheStatistics
-
The statistics about the media file being cached.
If you call the openWithMediaSource method and set enableCache as
YES
, the statistics about the media file being cached is updated every second after the media file is played. See AgoraMediaPlayerCacheStatistics.
AgoraMediaRecorderInfo
The information about the file that is recorded.
__attribute__((visibility("default"))) @interface AgoraMediaRecorderInfo : NSObject @property(copy, nonatomic) NSString* _Nonnull recorderFileName; @property(assign, nonatomic) NSUInteger durationMs; @property(assign, nonatomic) NSUInteger fileSize;
Properties
- recorderFileName
- The absolute path of the recording file.
- durationMs
- The recording duration (ms).
- fileSize
- The size (bytes) of the recording file.
AgoraRtcRemoteAudioStats
Audio statistics of the remote user.
__attribute__((visibility("default"))) @interface AgoraRtcRemoteAudioStats : NSObject @property(assign, nonatomic) NSUInteger uid; @property(assign, nonatomic) NSUInteger quality; @property(assign, nonatomic) NSUInteger networkTransportDelay; @property(assign, nonatomic) NSUInteger jitterBufferDelay; @property(assign, nonatomic) NSUInteger audioLossRate; @property(assign, nonatomic) NSUInteger numChannels; @property(assign, nonatomic) NSUInteger receivedSampleRate; @property(assign, nonatomic) NSUInteger receivedBitrate; @property(assign, nonatomic) NSUInteger totalFrozenTime; @property(assign, nonatomic) NSUInteger totalActiveTime; @property(assign, nonatomic) NSInteger publishDuration; @property(assign, nonatomic) NSUInteger frozenRate; @property(assign, nonatomic) NSUInteger mosValue; @property(assign, nonatomic) NSInteger qoeQuality; @property(assign, nonatomic) AgoraExperiencePoorReason qualityChangedReason; @end
Properties
- uid
- The user ID of the remote user.
- quality
-
The quality of the audio stream sent by the user. See AgoraNetworkQuality.
- networkTransportDelay
- The network delay (ms) from the sender to the receiver.
- jitterBufferDelay
-
The network delay (ms) from the audio receiver to the jitter buffer.Attention: When the receiving end is an audience member and audienceLatencyLevel of AgoraClientRoleOptions is 1, this parameter does not take effect.
- audioLossRate
- The frame loss rate (%) of the remote audio stream in the reported interval.
- numChannels
- The number of audio channels.
- receivedSampleRate
- The sampling rate of the received audio stream in the reported interval.
- receivedBitrate
- The average bitrate (Kbps) of the received audio stream in the reported interval.
- totalFrozenTime
- The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In a session, audio freeze occurs when the audio frame loss rate reaches 4%.
- frozenRate
- The total audio freeze time as a percentage (%) of the total time when the audio is available. The audio is considered available when the remote user neither stops sending the audio stream nor disables the audio module after joining the channel.
- totalActiveTime
-
The total active time (ms) between the start of the audio call and the callback of the remote user.
The active time refers to the total duration of the remote user without the mute state.
- publishDuration
-
The total duration (ms) of the remote audio stream.
- qoeQuality
-
The Quality of Experience (QoE) of the local user when receiving a remote audio stream. See AgoraExperienceQuality.
- qualityChangedReason
-
Reasons why the QoE of the local user when receiving a remote audio stream is poor. See AgoraExperiencePoorReason.
- mosValue
-
The quality of the remote audio stream in the reported interval. The quality is determined by the Agora real-time audio MOS (Mean Opinion Score) measurement method. The return value range is [0, 500]. Dividing the return value by 100 gets the MOS score, which ranges from 0 to 5. The higher the score, the better the audio quality.
The subjective perception of audio quality corresponding to the Agora real-time audio MOS scores is as follows:MOS score Perception of audio quality Greater than 4 Excellent. The audio sounds clear and smooth. From 3.5 to 4 Good. The audio has some perceptible impairment but still sounds clear. From 3 to 3.5 Fair. The audio freezes occasionally and requires attentive listening. From 2.5 to 3 Poor. The audio sounds choppy and requires considerable effort to understand. From 2 to 2.5 Bad. The audio has occasional noise. Consecutive audio dropouts occur, resulting in some information loss. The users can communicate only with difficulty. Less than 2 Very bad. The audio has persistent noise. Consecutive audio dropouts are frequent, resulting in severe information loss. Communication is nearly impossible.
AgoraRtcRemoteVideoStats
Statistics of the remote video stream.
__attribute__((visibility("default"))) @interface AgoraRtcRemoteVideoStats : NSObject @property(assign, nonatomic) NSUInteger uid; @property(assign, nonatomic) NSUInteger delay __deprecated; @property(assign, nonatomic) NSUInteger width; @property(assign, nonatomic) NSUInteger height; @property(assign, nonatomic) NSUInteger receivedBitrate; @property(assign, nonatomic) NSUInteger receivedFrameRate; @property(assign, nonatomic) AgoraVideoStreamType rxStreamType; @property(assign, nonatomic) NSInteger decoderOutputFrameRate; @property(assign, nonatomic) NSInteger rendererOutputFrameRate; @property(assign, nonatomic) NSInteger frameLossRate; @property(assign, nonatomic) NSInteger packetLossRate; @property(assign, nonatomic) NSInteger totalFrozenTime; @property(assign, nonatomic) NSInteger frozenRate; @property(assign, nonatomic) NSUInteger totalActiveTime; @property(assign, nonatomic) NSInteger publishDuration; @property(assign, nonatomic) NSInteger avSyncTimeMs; @property(assign, nonatomic) NSInteger superResolutionType; @end
Properties
- uid
- The user ID of the remote user sending the video stream.
- delay
-
- Deprecated:
- In scenarios where audio and video are synchronized, you can get the video delay data from networkTransportDelay and jitterBufferDelay in AgoraRtcRemoteAudioStats.
The video delay (ms).
- width
- The width (pixels) of the video.
- height
- The height (pixels) of the video.
- receivedBitrate
- The bitrate (Kbps) of the remote video received since the last count.
- receivedFramerate
- The frame rate (Kbps) received since the last count.
- decoderOutputFrameRate
- The frame rate (fps) of decoding the remote video.
- rendererOutputFrameRate
- The frame rate (fps) of rendering the remote video.
- frameLossRate
- The packet loss rate (%) of the remote video.
- packetLossRate
- The packet loss rate (%) of the remote video after using the anti-packet-loss technology.
- rxStreamType
- The type of the video stream. See AgoraVideoStreamType.
- totalFrozenTime
- The total freeze time (ms) of the remote video stream after the remote user joins the channel. In a video session where the frame rate is set to no less than 5 fps, video freeze occurs when the time interval between two adjacent renderable video frames is more than 500 ms.
- frozenRate
- The total video freeze time as a percentage (%) of the total time the video is available. The video is considered available as long as that the remote user neither stops sending the video stream nor disables the video module after joining the channel.
- totalActiveTime
-
The total active time (ms) of the video.
As long as the remote user or host neither stops sending the video stream nor disables the video module after joining the channel, the video is available.
- publishDuration
-
The total duration (ms) of the remote video stream.
- superResolutionType
- The state of super resolution:
- >0: Super resolution is enabled.
- =0: Super resolution is not enabled.
- avSyncTimeMs
- The amount of time (ms) that the audio is ahead of the video.Attention: If this value is negative, the audio is lagging behind the video.
AgoraRemoteVoicePositionInfo
The spatial position of the remote user or the media player.
__attribute__((visibility("default"))) @interface AgoraRemoteVoicePositionInfo : NSObject @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull position; @property(strong, nonatomic) NSArray<NSNumber*> * _Nullable forward; @end
Properties
- position
- The coordinates in the world coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
- forward
- The unit vector of the x axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
AgoraRtcConnection
Contains connection information.
__attribute__((visibility("default"))) @interface AgoraRtcConnection: NSObject <NSCopying> @property (nonatomic, copy) NSString *_Nonnull channelId; @property (nonatomic, assign) NSUInteger localUid; @end
Properties
- channelId
- The channel name.
- localUid
- The ID of the local user.
AgoraRtcEngineConfig
Configurations for the AgoraRtcEngineConfig instance.
__attribute__((visibility("default"))) @interface AgoraRtcEngineConfig: NSObject @property (copy, nonatomic) NSString * _Nullable appId; @property (assign, nonatomic) AgoraChannelProfile channelProfile; @property (assign, nonatomic) AgoraAudioScenario audioScenario; @property (assign, nonatomic) AgoraAreaCodeType areaCode; @property (strong, nonatomic) AgoraLogConfig * _Nullable logConfig; @property (copy, nonatomic) NSArray<id<AgoraMediaFilterExtensionDelegate>>* _Nullable mediaFilterExtensions; @property (weak, nonatomic) id<AgoraMediaFilterEventDelegate> _Nullable eventDelegate; @end
Properties
- appId
- The App ID issued by Agora for your project. Only users in apps with the same App ID can join the same channel and communicate with each other. An App ID can only be used to create one AgoraRtcEngineKit instance. To change your App ID, call destroy to destroy the current AgoraRtcEngineKit instance, and then create a new one.
- channelProfile
-
The channel profile. See AgoraChannelProfile.
- audioScenario
- The audio scenarios. See AgoraAudioScenario. Under different audio scenarios, the device uses different volume types.
- areaCode
- The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions. For details on supported regions, see AgoraAreaCodeType. The area codes support bitwise operation.
- logConfig
-
The log files that the SDK outputs. See AgoraLogConfig.
By default, the SDK generates five SDK log files and five API call log files with the following rules:
- The SDK log files are:
agorasdk.log
,agorasdk.1.log
,agorasdk.2.log
,agorasdk.3.log
, andagorasdk.4.log
. - The API call log files are:
agoraapi.log
,agoraapi.1.log
,agoraapi.2.log
,agoraapi.3.log
, andagoraapi.4.log
. - The default size for each SDK log file is 1,024 KB; the default size for each API call log file is 2,048 KB. These log files are encoded in UTF-8.
- The SDK writes the latest logs in
agorasdk.log
oragoraapi.log
. - When
agorasdk.log
is full, the SDK processes the log files in the following order:- Delete the
agorasdk.4.log
file (if any). - Rename
agorasdk.3.log
toagorasdk.4.log
. - Rename
agorasdk.2.log
toagorasdk.3.log
. - Rename
agorasdk.1.log
toagorasdk.2.log
. - Create a new
agorasdk.log
file.
- Delete the
- The overwrite rules for the
agoraapi.log
file are the same as foragorasdk.log
.
- The SDK log files are:
- eventDelegate
- The AgoraMediaFilterEventDelegate instance.
- mediaFilterExtensions
- The AgoraMediaFilterExtensionDelegate instance.
AgoraImage
Image properties.
__attribute__((visibility("default"))) @interface AgoraImage : NSObject @property(strong, nonatomic) NSURL *_Nonnull url; @property(assign, nonatomic) CGRect rect; @property (assign, nonatomic) NSInteger zOrder; @property(assign, nonatomic) double alpha; @end
This class sets the properties of the watermark and background images in the live video.
Properties
- url
- The HTTP/HTTPS URL address of the image in the live video. The maximum length of this parameter is 1024 bytes.
- rect
- The position and size of the image on the video frame. The data type is CGRect.
- zOrder
- The layer index of the watermark or background image. When you use the watermark array to add a watermark or multiple watermarks, you must pass a value to zOrder in the range [1,255]; otherwise, the SDK reports an error. In other cases, zOrder can optionally be passed in the range [0,255], with 0 being the default value. 0 means the bottom layer and 255 means the top layer.
- alpha
- The transparency of the watermark or background image. The value ranges between 0.0 and 1.0:
- 0.0: Completely transparent.
- 1.0: (Default) Opaque.
AgoraChannelStats
Statistics of the channel.
__attribute__((visibility("default"))) @interface AgoraChannelStats : NSObject @property(assign, nonatomic) NSUInteger duration; @property(assign, nonatomic) NSUInteger txBytes; @property(assign, nonatomic) NSUInteger rxBytes; @property(assign, nonatomic) NSUInteger txAudioKBitrate; @property(assign, nonatomic) NSUInteger rxAudioKBitrate; @property(assign, nonatomic) NSUInteger txVideoKBitrate; @property(assign, nonatomic) NSUInteger rxVideoKBitrate; @property(assign, nonatomic) NSUInteger txAudioBytes; @property(assign, nonatomic) NSUInteger txVideoBytes; @property(assign, nonatomic) NSUInteger rxAudioBytes; @property(assign, nonatomic) NSUInteger rxVideoBytes; @property(assign, nonatomic) NSUInteger lastmileDelay; @property(assign, nonatomic) NSUInteger userCount; @property(assign, nonatomic) double cpuAppUsage; @property(assign, nonatomic) double cpuTotalUsage; @property(assign, nonatomic) NSInteger gatewayRtt; @property(assign, nonatomic) double memoryAppUsageRatio; @property(assign, nonatomic) double memoryTotalUsageRatio; @property(assign, nonatomic) NSInteger memoryAppUsageInKbytes; @property(assign, nonatomic) NSInteger connectTimeMs; @property(assign, nonatomic) NSUInteger txKBitRate; @property(assign, nonatomic) NSUInteger rxKBitRate; @property(assign, nonatomic) NSInteger txPacketLossRate; @property(assign, nonatomic) NSInteger rxPacketLossRate; @end
Properties
- duration
- Call duration of the local user in seconds, represented by an aggregate value.
- txBytes
- Total number of bytes transmitted, represented by an aggregate value.
- rxBytes
- Total number of bytes received, represented by an aggregate value.
- txAudioBytes
- Total number of audio bytes sent, represented by an aggregate value.
- txVideoBytes
- The total number of video bytes sent, represented by an aggregate value.
- rxAudioBytes
- The total number of audio bytes received, represented by an aggregate value.
- rxVideoBytes
- The total number of video bytes received, represented by an aggregate value.
- txKBitRate
- Video transmission bitrate (Kbps), represented by an instantaneous value.
- rxKBitRate
- The receiving bitrate (Kbps), represented by an instantaneous value.
- rxAudioKBitRate
- Audio receive bitrate (Kbps), represented by an instantaneous value.
- txAudioKBitRate
- The bitrate (Kbps) of sending the audio packet.
- rxVideoKBitRate
- Video receive bitrate (Kbps), represented by an instantaneous value.
- txVideoKBitRate
- The bitrate (Kbps) of sending the video.
- lastmileDelay
- The client-to-server delay (ms).
- txPacketLossRate
- The packet loss rate (%) from the client to the Agora server before applying the anti-packet-loss algorithm.
- rxPacketLossRate
- The packet loss rate (%) from the Agora server to the client before using the anti-packet-loss method.
- userCount
- The number of users in the channel.
- cpuAppUsage
- Application CPU usage (%).Attention:
- The value of cpuTotalUsage is always reported as 0 in the didLeaveChannelWithStats callback.
- cpuTotalUsage
-
The system CPU usage (%).
Attention:- The value of cpuTotalUsage is always reported as 0 in the didLeaveChannelWithStats callback.
- connectTimeMs
- The duration (ms) between the SDK starts connecting and the connection is established. If the value reported is 0, it means invalid.
- gatewayRtt
- The round-trip time delay (ms) from the client to the local router.
- memoryAppUsageRatio
-
The memory ratio occupied by the app (%).
Attention: This value is for reference only. Due to system limitations, you may not get this value. - memoryTotalUsageRatio
-
The memory occupied by the system (%).
Attention: This value is for reference only. Due to system limitations, you may not get this value. - memoryAppUsageInKbytes
-
The memory size occupied by the app (KB).
Attention: This value is for reference only. Due to system limitations, you may not get this value.
AgoraScreenCaptureParameters
Screen sharing configurations.
__attribute__((visibility("default"))) @interface AgoraScreenCaptureParameters: NSObject @property (assign, nonatomic) CGSize dimensions; @property (assign, nonatomic) NSInteger frameRate; @property (assign, nonatomic) NSInteger bitrate; @property(assign, nonatomic) BOOL captureMouseCursor; @property(assign, nonatomic) BOOL windowFocus; @property(copy, nonatomic) NSArray* _Nullable excludeWindowList; @property(assign, nonatomic) BOOL highLighted; @property(strong, nonatomic) COLOR_CLASS* _Nullable highLightColor; @property(assign, nonatomic) NSUInteger highLightWidth; @end
Properties
- dimensions
-
The video encoding resolution of the shared screen stream.
If the screen dimensions are different from the value of this parameter, Agora applies the following strategies for encoding. Suppose dimensions is set to 1920 x 1080:- If the value of the screen dimensions is lower than that of dimensions, for example, 1000 x 1000 pixels, the SDK uses 1000 x 1000 pixels for encoding.
- If the value of the screen dimensions is higher than that of dimensions, for example, 2000 x 1500, the SDK uses the maximum value under dimensions with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 x 1080.
- frameRate
- The video encoding resolution of the shared screen stream. The frame rate (fps) of the shared region. The default value is 5. We do not recommend setting this to a value greater than 15.
- bitrate
- The video encoding bitrate of the shared screen stream. The bitrate (Kbps) of the shared region. The default value is 0 (the SDK works out a bitrate according to the dimensions of the current screen).
- captureMouseCursor
-
Whether to capture the mouse in screen sharing:
YES
: (Default) Capture the mouse.NO
: Do not capture the mouse.
- windowFocus
-
Whether to bring the window to the front when calling the startScreenCaptureByWindowId method to share it:
YES
:Bring the window to the front.NO
: (Default) Do not bring the window to the front.
- excludeWindowList
- The ID list of the windows to be blocked. When calling startScreenCaptureByDisplayId to start screen sharing, you can use this parameter to block a specified window. When calling updateScreenCaptureParameters to update screen sharing configurations, you can use this parameter to dynamically block a specified window.
- highLighted
- Whether to place a border around the shared window or screen:
YES
: Place a border.NO
: (Default) Do not place a border.
Note: When you share a part of a window or screen, the SDK places a border around the entire window or screen if you set this parameter toYES
. - highLightColor
- The color of the border in RGBA format. The default value is 0xFF8CBF26.Note: On macOS,
COLOR_CLASS
refers toNSColor
. - highLightWidth
- The width (px) of the border. The default value is 5, and the value range is (0, 50].Note: This parameter only takes effect when highLighted is set to
YES
.
AgoraScreenCaptureSourceInfo
The information about the specified shareable window or screen.
__attribute__((visibility("default"))) @interface AgoraScreenCaptureSourceInfo : NSObject @property(assign, nonatomic) AgoraScreenCaptureSourceType type; @property(assign, nonatomic) CGWindowID sourceId; @property(copy, nonatomic) NSString* _Nonnull sourceName; @property(strong, nonatomic) NSImage* _Nonnull thumbImage; @property(strong, nonatomic) NSImage* _Nullable iconImage; @property(copy, nonatomic) NSString* _Nonnull processPath; @property(copy, nonatomic) NSString* _Nonnull sourceTitle; @property(assign, nonatomic) BOOL primaryMonitor; @end
Properties
- type
- The type of the shared target. See AgoraScreenCaptureSourceType.
- sourceId
- The window ID for a window or the display ID for a screen.
- sourceName
- The name of the window or screen. UTF-8 encoding.
- thumbImage
- The image content of the thumbnail. See NSImage.
- iconImage
- The image content of the icon. See NSImage.
- processPath
- The process to which the window belongs. UTF-8 encoding.
- sourceTitle
- The title of the window. UTF-8 encoding.
- primaryMonitor
- Determines whether the screen is the primary display:
YES
: The screen is the primary display.NO
: The screen is not the primary display.
AgoraSegmentationProperty
Processing properties for background images.
__attribute__((visibility("default"))) @interface AgoraSegmentationProperty: NSObject @property(nonatomic, assign) SegModelType modelType; @property(nonatomic, assign) float greenCapacity; @end
Properties
- modelType
- The type of algorithms to user for background processing. See SegModelType.
- greenCapacity
-
The range of accuracy for identifying green colors (different shades of green) in the view. The value range is [0,1], and the default value is 0.5. The larger the value, the wider the range of identifiable shades of green. When the value of this parameter is too large, the edge of the portrait and the green color in the portrait range are also detected. Agora recommends that you dynamically adjust the value of this parameter according to the actual effect.
Note: This parameter only takes effect when modelType is set to SegModelAgoraGreen.
AgoraSimulcastStreamConfig
The configuration of the low-quality video stream.
__attribute__((visibility("default"))) @interface AgoraSimulcastStreamConfig: NSObject @property (assign, nonatomic) int bitrate; @property (assign, nonatomic) int framerate; @property (assign, nonatomic) CGSize dimensions; @end
Properties
- dimensions
- The video dimension. . The default value is 160 × 120.
- bitrate
- Video receive bitrate (Kbps). The default value is 65.
- framerate
- The capture frame rate (fps) of the local video. The default value is 5.
SpatialAudioParams
The spatial audio parameters.
__attribute__((visibility("default"))) @interface AgoraSpatialAudioParams : NSObject @property(assign, nonatomic) double speaker_azimuth; @property(assign, nonatomic) double speaker_elevation; @property(assign, nonatomic) double speaker_distance; @property(assign, nonatomic) NSInteger speaker_orientation; @property(assign, nonatomic) BOOL enable_blur; @property(assign, nonatomic) BOOL enable_air_absorb; @property(assign, nonatomic) double speaker_attenuation; @property(assign, nonatomic) BOOL enable_doppler; @end
Properties
- speaker_azimuth
- The azimuth angle of the remote user or media player relative to the local user. The value range is [0,360], and the unit is degrees, as follows:
- 0: (Default) 0 degrees, which means directly in front on the horizontal plane.
- 90: 90 degrees, which means directly to the left on the horizontal plane.
- 180: 180 degrees, which means directly behind on the horizontal plane.
- 270: 270 degrees, which means directly to the right on the horizontal plane.
- 360: 360 degrees, which means directly in front on the horizontal plane.
- speaker_elevation
- The elevation angle of the remote user or media player relative to the local user. The value range is [-90,90], and the unit is degrees, as follows:
- 0: (Default) 0 degrees, which means that the horizontal plane is not rotated.
- -90: -90 degrees, which means that the horizontal plane is rotated 90 degrees downwards.
- 90: 90 degrees, which means that the horizontal plane is rotated 90 degrees upwards.
- speaker_distance
- The distance of the remote user or media player relative to the local user. The value range is [1,50], and the unit is meters. The default value is 1 meter.
- speaker_orientation
- The orientation of the remote user or media player relative to the local user. The value range is [0,180], and the unit is degrees, as follows:
- 0: (Default) 0 degrees, which means that the sound source and listener face the same direction.
- 180: 180 degrees, which means that the sound source and listener face each other.
- enable_blur
- Whether to enable audio blurring:
YES
: Enable audio blurring.NO
: (Default) Disable audio blurring.
- enable_air_absorb
- Whether to enable air absorption, that is, to simulate the sound attenuation effect of sound transmitting in the air; under a certain transmission distance, the attenuation speed of high-frequency sound is fast, and the attenuation speed of low-frequency sound is slow.
YES
: (Default) Enable air absorption. Make sure that the value of speaker_attenuation is not0
; otherwise, this setting does not take effect.NO
: Disable air absorption.
- speaker_attenuation
- The sound attenuation coefficient of the remote user or media player. The value range is [0,1]. The values are as follows:
- 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance.
- (0,0.5): Weak attenuation mode, where the volume and timbre only have a weak attenuation during the propagation, and the sound can travel farther than that in a real environment. enable_air_absorb needs to be enabled at the same time.
- 0.5: (Default) Simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the speaker_attenuation parameter.
- (0.5,1]: Strong attenuation mode, where volume and timbre attenuate rapidly during the propagation. enable_air_absorb needs to be enabled at the same time.
- enable_doppler
- Whether to enable the Doppler effect: When there is a relative displacement between the sound source and the receiver of the sound source, the tone heard by the receiver changes.
YES
: Enable the Doppler effect.NO
: (Default) Disable the Doppler effect.
CAUTION:- This parameter is suitable for scenarios where the sound source is moving at high speed (for example, racing games). It is not recommended for common audio and video interactive scenarios (for example, voice chat, cohosting, or online KTV).
- When this parameter is enabled, Agora recommends that you set a regular period (such as 30 ms), and then call the updatePlayerPositionInfo, updateSelfPosition, and updateRemotePosition methods to continuously update the relative distance between the sound source and the receiver. The following factors can cause the Doppler effect to be unpredictable or the sound to be jittery: the period of updating the distance is too long, the updating period is irregular, or the distance information is lost due to network packet loss or delay.
SpatialAudioZone
Sound insulation area settings.
__attribute__((visibility("default"))) @interface AgoraSpatialAudioZone : NSObject @property(assign, nonatomic) NSInteger zoneSetId; @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull position; @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull forward; @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull right; @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull up; @property(assign, nonatomic) float forwardLength; @property(assign, nonatomic) float rightLength; @property(assign, nonatomic) float upLength; @property(assign, nonatomic) float audioAttenuation; @end
- Since
- v4.0.1
Properties
- zoneSetId
- The ID of the sound insulation area.
- position
- The spatial center point of the sound insulation area. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
- forward
- Starting at position, the forward unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
- right
- Starting at position, the right unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
- up
- Starting at position, the up unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
- forwardLength
- The entire sound insulation area is regarded as a cube; this represents the length of the forward side in the unit length of the game engine.
- rightLength
- The entire sound insulation area is regarded as a cube; this represents the length of the right side in the unit length of the game engine.
- upLength
- The entire sound insulation area is regarded as a cube; this represents the length of the up side in the unit length of the game engine.
- audioAttenuation
- The sound attenuation coefficient when users within the sound insulation area communicate with external users. The value range is [0,1]. As shown below:
- 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance.
- (0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment.
- 0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the audioAttenuation parameter.
- (0.5,1]: Strong attenuation mode (default value is 1), that is, the volume and timbre attenuate rapidly during propagation.
AgoraMediaPlayerSrcInfo
Information about the video bitrate of the media resource being played.
__attribute__((visibility("default"))) @interface AgoraMediaPlayerSrcInfo : NSObject @property(assign, nonatomic) int bitrateInKbps; @property(copy, nonatomic) NSString *_Nullable name; @end
Properties
- bitrateInKbps
- The video bitrate (Kbps) of the media resource being played.
- name
- The name of the media resource.
AgoraLiveTranscodingUser
Transcoding configurations of each host.
__attribute__((visibility("default"))) @interface AgoraLiveTranscodingUser : NSObject @property(assign, nonatomic) NSUInteger uid; @property(assign, nonatomic) CGRect rect; @property(assign, nonatomic) NSInteger zOrder; @property(assign, nonatomic) double alpha; @property(assign, nonatomic) NSInteger audioChannel; @end
Properties
- uid
-
The user ID of the host.
- rect
- The position and size of the host's video in the output image. The data size is CGRect.
- zOrder
-
The layer index number of the host's video. The value range is [0, 100].
- 0: (Default) The host's video is the bottom layer.
- 100: The host's video is the top layer.
Attention:- If the value is less than 0 or greater than 100, AgoraErrorCodeInvalidArgument error is returned.
- Setting zOrder to 0 is supported.
- alpha
-
The transparency of the host's video. The value range is [0.0,1.0].
- 0.0: Completely transparent.
- 1.0: (Default) Opaque.
- audioChannel
-
The audio channel used by the host's audio in the output audio. The default value is 0, and the value range is [0, 5].
0
: (Recommended) The defaut setting, which supports dual channels at most and depends on the upstream of the host.1
: The host's audio uses the FL audio channel. If the host's upstream uses multiple audio channels, the Agora server mixes them into mono first.2
: The host's audio uses the FC audio channel. If the host's upstream uses multiple audio channels, the Agora server mixes them into mono first.3
: The host's audio uses the FR audio channel. If the host's upstream uses multiple audio channels, the Agora server mixes them into mono first.4
: The host's audio uses the BL audio channel. If the host's upstream uses multiple audio channels, the Agora server mixes them into mono first.5
: The host's audio uses the BR audio channel. If the host's upstream uses multiple audio channels, the Agora server mixes them into mono first.0xFF
or a value greater than5
: The host's audio is muted, and the Agora server removes the host's audio.
Attention: If the value is not0
, a special player is required.
AgoraUplinkNetworkInfo
The uplink network information.
__attribute__((visibility("default"))) @interface AgoraUplinkNetworkInfo : NSObject @property(nonatomic, assign) int videoEncoderTargetBitrateBps; @end
Properties
- videoEncoderTargetBitrateBps
- The target video encoder bitrate (bps).
AgoraAudioSpectrumInfo
Audio spectrum information of the remote user.
__attribute__((visibility("default"))) @interface AgoraAudioSpectrumInfo : NSObject @property(nonatomic, assign) NSInteger uid; @property(nonatomic, strong) NSArray<NSNumber *> * _Nullable audioSpectrumData; @end
Properties
- uid
- The user ID of the remote user.
- audioSpectrumData
-
Audio spectrum information of the remote user.
AgoraUserInfo
The information of the user.
__attribute__((visibility("default"))) @interface AgoraUserInfo: NSObject @property(assign, nonatomic) NSUInteger uid; @property (copy, nonatomic) NSString * _Nullable userAccount; @end
Properties
- uid
- The user ID.
- userAccount
- User account.
AgoraRtcVideoCanvas
Attributes of video canvas object.
__attribute__((visibility("default"))) @interface AgoraRtcVideoCanvas : NSObject @property(strong, nonatomic) VIEW_CLASS *_Nullable view; @property(assign, nonatomic) AgoraVideoRenderMode renderMode; @property(assign, nonatomic) AgoraVideoMirrorMode mirrorMode; @property(assign, nonatomic) NSUInteger uid; @property(copy, nonatomic) NSString *_Nullable userId; @property(nonatomic, assign) AgoraVideoSourceType sourceType; @property(nonatomic, assign) int sourceId; @end
Properties
- view
- Video display window.
- renderMode
-
The rendering mode of the video. See AgoraVideoRenderMode.
- mirrorMode
-
The mirror mode of the view. See AgoraVideoMirrorMode.
Attention:- For the mirror mode of the local video view: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
- For the remote user: The mirror mode is disabled by default.
- uid
- The user ID.
- sourceType
- The type of the video source, see AgoraVideoSourceType.
- sourceId
- The ID of the video source.
AgoraVideoDenoiserOptions
Video noise reduction options.
__attribute__((visibility("default"))) @interface AgoraVideoDenoiserOptions : NSObject @property(nonatomic, assign) AgoraVideoDenoiserMode mode; @property(nonatomic, assign) AgoraVideoDenoiserLevel level; @end
Properties
- level
- Video noise reduction level. For more details, see AgoraVideoDenoiserLevel.
- mode
- Video noise reduction mode. For more details, see AgoraVideoDenoiserMode.
AgoraVideoDenoiserMode
Video noise reduction mode.
Enumerator
- AgoraVideoDenoiserModeAuto
- 0: (Default) Automatic mode. The SDK automatically enables or disables the video noise reduction feature according to the ambient light.
- AgoraVideoDenoiserModeManual
- 1: Manual mode. Users need to enable or disable the video noise reduction feature manually.
AgoraVideoDenoiserLevel
The video noise reduction level.
Enumerator
- AgoraVideoDenoiserLevelHighQuality
- 0: (Default) Promotes video quality during video noise reduction. balances performance consumption and video noise reduction quality. The performance consumption is moderate, the video noise reduction speed is moderate, and the overall video quality is optimal.
- AgoraVideoDenoiserLevelFast
- 1: Promotes reducing performance consumption during video noise reduction. prioritizes reducing performance consumption over video noise reduction quality. The performance consumption is lower, and the video noise reduction speed is faster. To avoid a noticeable shadowing effect (shadows trailing behind moving objects) in the processed video, Agora recommends that you use this settinging when the camera is fixed.
- AgoraVideoDenoiserLevelStrength
- 2: Enhanced video noise reduction. prioritizes video noise reduction quality over reducing performance consumption. The performance consumption is higher, the video noise reduction speed is slower, and the video noise reduction quality is better. If AgoraVideoDenoiserLevelHighQuality is not enough for your video noise reduction needs, you can use this enumerator.
AgoraVideoEncoderConfiguration
Video encoder configurations.
__attribute__((visibility("default"))) @interface AgoraVideoEncoderConfiguration : NSObject @property(assign, nonatomic) CGSize dimensions; @property(assign, nonatomic) AgoraVideoCodecType codecType; @property(assign, nonatomic) AgoraVideoFrameRate frameRate; @property(assign, nonatomic) NSInteger bitrate; @property(assign, nonatomic) NSInteger minBitrate; @property(assign, nonatomic) AgoraVideoOutputOrientationMode orientationMode; @property(assign, nonatomic) AgoraVideoMirrorMode mirrorMode; @property (assign, nonatomic) AgoraDegradationPreference degradationPreference; - (instancetype _Nonnull)initWithSize:(CGSize)size frameRate:(AgoraVideoFrameRate)frameRate bitrate:(NSInteger)bitrate orientationMode:(AgoraVideoOutputOrientationMode)orientationMode mirrorMode:(AgoraVideoMirrorMode)mirrorMode; - (instancetype _Nonnull)initWithWidth:(NSInteger)width height:(NSInteger)height frameRate:(AgoraVideoFrameRate)frameRate bitrate:(NSInteger)bitrate orientationMode:(AgoraVideoOutputOrientationMode)orientationMode mirrorMode:(AgoraVideoMirrorMode)mirrorMode; @end
Properties
- dimensions
-
Users can set the resolution by themselves, or directly select the desired resolution from the following list:
- AgoraVideoDimension120x120: The video resolution is 120 × 120.
- AgoraVideoDimension160x120: The video resolution is 160 × 120.
- AgoraVideoDimension180x180: The video resolution is 180 × 180.
- AgoraVideoDimension240x180: The video resolution is 240 × 180.
- AgoraVideoDimension320x180: The video resolution is 320 × 180.
- AgoraVideoDimension240x240: The video resolution is 240 × 240.
- AgoraVideoDimension320x240: The video resolution is 320 × 240.
- AgoraVideoDimension424x240: The video resolution is 424 × 240.
- AgoraVideoDimension360x360: The video resolution is 360 × 360.
- AgoraVideoDimension480x360: The video resolution is 480 × 360.
- AgoraVideoDimension640x360: The video resolution is 640 × 360.
- AgoraVideoDimension480x480: The video resolution is 480 × 480.
- AgoraVideoDimension640x480: The video resolution is 640 × 480.
- AgoraVideoDimension840x480: The video resolution is 840 × 480.
- AgoraVideoDimension960x720: The video resolution is 960 × 720.
- AgoraVideoDimension1280x720: The video resolution is 1280 × 720.
- AgoraVideoDimension1920x1080: The video resolution is 1920 × 1080.
- AgoraVideoDimension2540x1440: The video resolution is 2540 × 1440.
- AgoraVideoDimension3840x2160: The video resolution is 3840 × 2160.
Attention:- Whether the 720p resolution or above can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the set value.
- The default value is 640 × 360.
- codecType
- The codec type of the local video stream. See AgoraVideoCodecType.
- frameRate
- The frame rate (fps) of the encoding video frame. The default value is 15. See AgoraVideoFrameRate.
- minFramerate
- The minimum encoding frame rate of the video. The default value is -1.
- bitrate
-
The encoding bitrate (Kbps) of the video.
- STANDARD_BITRATE: (Recommended) Standard bitrate mode. In this mode, the video bitrate is twice the base bitrate.
- COMPATIBLE_BITRATE: Adaptive bitrate mode In this mode, the video bitrate is the same as the base bitrate. If you choose this mode in the LIVE_BROADCASTING profile, the video frame rate may be lower than the set value.
- minBitrate
-
The minimum encoding bitrate (Kbps) of the video.
The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and sacrifice the smoothness of the video transmission. Unless you have special requirements for image quality, Agora does not recommend changing this value.
Attention: This parameter only applies to the interactive streaming profile. - orientationMode
- The orientation mode of the encoded video. See AgoraVideoOutputOrientationMode.
- degradationPreference
- Video degradation preference under limited bandwidth. See AgoraDegradationPreference.
- mirrorMode
-
Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See AgoraVideoMirrorMode.
Attention: By default, the video is not mirrored.
initWithSize
Specifies the video resolution and initializes the AgoraVideoEncoderConfiguration object.
- (instancetype _Nonnull)initWithSize:(CGSize)size frameRate:(AgoraVideoFrameRate)frameRate bitrate:(NSInteger)bitrate orientationMode:(AgoraVideoOutputOrientationMode)orientationMode mirrorMode:(AgoraVideoMirrorMode)mirrorMode;
Parameters
- size
- The video resolution.
- frameRate
- Video frame rate. See AgoraVideoFrameRate.
- bitrate
- The bitrate of the encoding video.
- orientationMode
- The orientation of the encoding video. See AgoraVideoOutputOrientationMode.
- mirrorMode
- Whether to enable mirroring mode when sending encoded video, only affects the video images seen by remote users. See AgoraVideoMirrorMode.
Returns
The initialized AgoraVideoEncoderConfiguration object.
initWithWidth
Specifies the video width and height, and initializes the AgoraVideoEncoderConfiguration object.
- (instancetype _Nonnull)initWithWidth:(NSInteger)width height:(NSInteger)height frameRate:(AgoraVideoFrameRate)frameRate bitrate:(NSInteger)bitrate orientationMode:(AgoraVideoOutputOrientationMode)orientationMode mirrorMode:(AgoraVideoMirrorMode)mirrorMode;
Parameters
- width
- The width of the video.
- height
- The height of the video.
- frameRate
- Video frame rate. See AgoraVideoFrameRate.
- bitrate
- The bitrate of the encoding video.
- orientationMode
- The orientation of the encoding video. See AgoraVideoOutputOrientationMode.
- mirrorMode
- Whether to enable mirroring mode when sending encoded video, only affects the video images seen by remote users. See AgoraVideoMirrorMode.
Returns
The initialized AgoraVideoEncoderConfiguration object.
AgoraOutputVideoFrame
Configurations of the video frame.
__attribute__((visibility("default"))) @interface AgoraOutputVideoFrame : NSObject @property (nonatomic, assign) NSInteger type; @property (nonatomic, assign) int width; @property (nonatomic, assign) int height; @property (nonatomic, assign) int yStride; @property (nonatomic, assign) int uStride; @property (nonatomic, assign) int vStride; @property (nonatomic, assign) uint8_t* _Nullable yBuffer; @property (nonatomic, assign) uint8_t* _Nullable uBuffer; @property (nonatomic, assign) uint8_t* _Nullable vBuffer; @property (nonatomic, assign) int rotation; @property (nonatomic, assign) int64_t renderTimeMs; @property (nonatomic, assign) int avSyncType; @property(assign, nonatomic) CVPixelBufferRef _Nullable pixelBuffer; @end
The video data format is YUV420. Note that the buffer provides a pointer to a pointer. This interface cannot modify the pointer of the buffer, but it can modify the content of the buffer.
Properties
- type
- The format of the incoming video frame. This parameter must be specified as one of the following values:
- 1: I420
- 2: BGRA
- 3: NV21
- 4: RGBA
- 5: IMC2
- 7: ARGB
- 8: NV12
- 12: iOS texture (CVPixelBufferRef)
- 16: I422.
- width
- The width of the video, in pixels.
- height
- The height of the video, in pixels.
- yStride
- For YUV data, the line span of the Y buffer; for RGBA data, the total data length.
- uStride
- For YUV data, the line span of the U buffer; for RGBA data, the value is 0.
- vStride
- For YUV data, the line span of the V buffer; for RGBA data, the value is 0.
- yBuffer
- For YUV data, the pointer to the Y buffer; for RGBA data, the data buffer.
- uBuffer
- For YUV data, the pointer to the U buffer; for RGBA data, the value is 0.
- vBuffer
- For YUV data, the pointer to the V buffer; for RGBA data, the value is 0.
- rotation
- The clockwise rotation of the video frame before rendering. Supported values include 0, 90, 180, and 270 degrees.
- renderTimeMs
- The Unix timestamp (ms) when the video frame is rendered. This timestamp can be used to guide the rendering of the video frame. It is required.
- avsync_type
- Reserved for future use.
- pixelBuffer
- Fills the data to CVPixelBuffer.
- alphaBuffer
-
Indicates the output data of the portrait segmentation algorithm, which is consistent with the size of the video frame. The value range of each pixel is [0,255], where 0 represents the background; 255 represents the foreground (portrait).
In the custom video renderer scenario, you can use this parameter to render the video background into various effects, such as transparent, solid color, picture, video, and so on.Note: To use this parameter, contact contact technical support.
AgoraVirtualBackgroundSource
The custom background image.
__attribute__((visibility("default"))) @interface AgoraVirtualBackgroundSource : NSObject @property(nonatomic, assign) AgoraVirtualBackgroundSourceType backgroundSourceType NS_SWIFT_NAME(backgroundSourceType); @property(nonatomic, assign) NSUInteger color NS_SWIFT_NAME(color); @property(nonatomic, copy) NSString* _Nullable source NS_SWIFT_NAME(source); @property(nonatomic, assign) AgoraBlurDegree blurDegree; @end
Properties
- backgroundSourceType
- The type of the custom background image. See AgoraVirtualBackgroundSourceType.
- color
- The type of the custom background image. The color of the custom background image. The format is a hexadecimal integer defined by RGB, without the # sign, such as 0xFFB6C1 for light pink. The default value is 0xFFFFFF, which signifies white. The value range is [0x000000, 0xffffff]. If the value is invalid, the SDK replaces the original background image with a white background image.Attention: This parameter takes effect only when the type of the custom background image is AgoraVirtualBackgroundColor.
- source
- The local absolute path of the custom background image. PNG and JPG formats are supported. If the path is invalid, the SDK replaces the original background image with a white background image.Attention: This parameter takes effect only when the type of the custom background image is AgoraVirtualBackgroundImg.
- blurDegree
- The degree of blurring applied to the custom background image. See AgoraBlurDegree.
Attention: This parameter takes effect only when the type of the custom background image is AgoraVirtualBackgroundBlur.
WatermarkOptions
Configurations of the watermark image.
__attribute__((visibility("default"))) @interface WatermarkOptions : NSObject @property(assign, nonatomic) BOOL visibleInPreview; @property(assign, nonatomic) CGRect positionInLandscapeMode; @property(assign, nonatomic) CGRect positionInPortraitMode; @end
Properties
- visibleInPreview
- Reserved for future use.
- positionInLandscapeMode
- The area to display the watermark image in landscape mode. This parameter contains the following members.
- x: The horizontal position of the watermark relative to the upper left corner.
- y: The vertical position of the watermark relative to the upper left corner.
- width: The width (pixels) of the watermark area.
- height: The height (pixels) of the watermark area.
- positionInPortraitMode
- The area to display the watermark image in portrait mode. This parameter contains the following members.
- x: The horizontal position of the watermark relative to the upper left corner.
- y: The vertical position of the watermark relative to the upper left corner.
- width: The width (pixels) of the watermark area.
- height: The height (pixel) of the watermark area.