8 #import <Foundation/Foundation.h>
42 - (BOOL)onRecordAudioFrame:(
AgoraAudioFrame* _Nonnull)frame channelId:(NSString * _Nonnull)channelId;
59 - (BOOL)onPlaybackAudioFrame:(
AgoraAudioFrame* _Nonnull)frame channelId:(NSString * _Nonnull)channelId;
76 - (BOOL)onMixedAudioFrame:(
AgoraAudioFrame* _Nonnull)frame channelId:(NSString * _Nonnull)channelId;
94 - (BOOL)onPlaybackAudioFrameBeforeMixing:(
AgoraAudioFrame* _Nonnull)frame channelId:(NSString * _Nonnull)channelId uid:(NSUInteger)uid ;
123 - (BOOL)onEncodedVideoFrame:(NSData * _Nonnull )videoData length:(
size_t)length info:(
AgoraEncodedVideoFrameInfo * _Nonnull)videoFrameInfo;
221 - (BOOL)onRenderVideoFrame:(
AgoraOutputVideoFrame * _Nonnull)videoFrame uid:(NSUInteger)uid channelId:(NSString * _Nonnull)channelId;
239 - (BOOL)onMediaPlayerVideoFrame:(
AgoraOutputVideoFrame * _Nonnull)videoFrame mediaPlayerId:(NSInteger)mediaPlayerId;
374 didChangedToPosition:(NSInteger)position;
385 elapsedTime:(NSInteger)elapsedTime
386 message:(NSString *_Nullable)message;
400 didReceiveData:(NSString *_Nullable)data
401 length:(NSInteger)length;
410 didPlayBufferUpdated:(NSInteger)playCachedBuffer;
448 volumeIndicationDidReceive:(NSInteger)volume;
504 message:(NSString *_Nullable)message;
540 - (NSData * _Nullable)readyToSendMetadataAtTimestamp:(NSTimeInterval)timestamp sourceType:(
AgoraVideoSourceType)sourceType;
556 - (void)receiveMetadata:(NSData * _Nonnull)data fromUser:(NSInteger)uid atTimestamp:(NSTimeInterval)timestamp;
569 #pragma mark Delegate Methods
579 #pragma mark Core Delegate Methods
593 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didOccurWarning:(AgoraWarningCode)warningCode;
603 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didOccurError:(AgoraErrorCode)errorCode;
646 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine tokenPrivilegeWillExpire:(NSString *_Nonnull)token;
740 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didApiCallExecute:(NSInteger)error api:(NSString * _Nonnull)api result:(NSString * _Nonnull)result;
748 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didRefreshRecordingServiceStatus:(NSInteger)status;
750 #if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
764 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine device:(NSString * _Nonnull)deviceId type:(AgoraMediaDeviceType)deviceType stateChanged:(NSInteger) state;
781 #pragma mark Local User Core Delegate Methods
796 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didJoinChannel:(NSString * _Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
811 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didRejoinChannel:(NSString * _Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger) elapsed;
858 #pragma mark Local User Audio Delegate Methods
870 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine firstLocalAudioFramePublished:(NSInteger)elapsed;
903 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didAudioRouteChanged:(AgoraAudioOutputRouting)routing;
920 - (void)rtcEngineDidAudioEffectFinish:(
AgoraRtcEngineKit * _Nonnull)engine soundId:(
int)soundId;
923 #pragma mark Local User Video Delegate Methods
944 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine cameraFocusDidChangedToRect:(CGRect)rect;
951 - (void)rtcEngine:(
AgoraRtcEngineKit* _Nonnull)engine cameraExposureDidChangedToRect:(CGRect)rect;
967 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine firstLocalVideoFramePublishedWithElapsed:(NSInteger)elapsed;
977 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine firstLocalVideoFrameWithSize:(CGSize)size elapsed:(NSInteger)elapsed;
992 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine localVideoStats:(AgoraRtcLocalVideoStats * _Nonnull)stats;
1004 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didLocalPublishFallbackToAudioOnly:(BOOL)isFallbackOrRecover;
1007 #pragma mark Remote User Core Delegate Methods
1033 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
1063 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData * _Nonnull)data;
1077 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached;
1080 #pragma mark Remote User Audio Delegate Methods
1094 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine firstRemoteAudioFrameOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
1115 - (void)rtcEngine:(
AgoraRtcEngineKit* _Nonnull)engine firstRemoteAudioFrameDecodedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
1133 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didAudioMuted:(BOOL)muted byUid:(NSUInteger)uid;
1186 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine activeSpeaker:(NSUInteger)speakerUid;
1194 - (void)rtcEngineRemoteAudioMixingDidStart:(
AgoraRtcEngineKit * _Nonnull)engine;
1200 - (void)rtcEngineRemoteAudioMixingDidFinish:(
AgoraRtcEngineKit * _Nonnull)engine;
1222 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine audioTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate;
1252 - (void)rtcEngine:(
AgoraRtcEngineKit *_Nonnull)engine didAudioSubscribeStateChange:(NSString * _Nonnull)channelId
1253 uid:(
unsigned int)uid
1256 elapseSinceLastState:(
int)elapseSinceLastState;
1266 - (void)rtcEngine:(
AgoraRtcEngineKit *_Nonnull)engine didAudioPublishStateChange:(NSString * _Nonnull)channelId
1269 elapseSinceLastState:(
int)elapseSinceLastState;
1271 #pragma mark String UID
1279 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didLocalUserRegisteredWithUserId:(NSUInteger)uid userAccount:(NSString * _Nonnull)userAccount;
1292 #pragma mark Rhythm Player Delegates Methods
1297 #pragma mark Remote User Video Delegates Methods
1319 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine firstRemoteVideoDecodedOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed __deprecated;
1328 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine firstRemoteVideoFrameOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed;
1337 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation;
1339 - (void)rtcEngine:(
AgoraRtcEngineKit* _Nonnull)engine snapshotTaken:(NSString* _Nonnull)channel uid:(NSUInteger)uid filePath:(NSString* _Nonnull)filePath width:(NSInteger)width height:(NSInteger)height errCode:(NSInteger)errCode;
1365 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(
AgoraVideoRemoteReason)reason elapsed:(NSInteger)elapsed;
1410 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didVideoMuted:(BOOL)muted byUid:(NSUInteger)uid __deprecated_msg("use rtcEngine:remoteVideoStateChangedOfUid:state:reason: instead.");
1426 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid __deprecated_msg("use rtcEngine:remoteVideoStateChangedOfUid:state:reason: instead.");
1438 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid __deprecated_msg("use rtcEngine:remoteVideoStateChangedOfUid:state:reason: instead.");
1447 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine remoteUserStateChangedOfUid:(NSUInteger)uid state:(NSUInteger)state;
1475 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine didRemoteSubscribeFallbackToAudioOnly:(BOOL)isFallbackOrRecover byUid:(NSUInteger)uid;
1487 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine videoTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate;
1499 - (void)rtcEngine:(
AgoraRtcEngineKit *_Nonnull)engine didVideoSubscribeStateChange:(NSString * _Nonnull)channelId
1500 uid:(
unsigned int)uid
1503 elapseSinceLastState:(
int)elapseSinceLastState;
1514 - (void)rtcEngine:(
AgoraRtcEngineKit *_Nonnull)engine didVideoPublishStateChange:(NSString * _Nonnull)channelId
1517 elapseSinceLastState:(
int)elapseSinceLastState;
1519 #pragma mark Stream Publish Delegate Methods
1563 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine streamPublishedWithUrl:(NSString * _Nonnull)url errorCode:(AgoraErrorCode)errorCode;
1570 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine streamUnpublishedWithUrl:(NSString * _Nonnull)url;
1585 - (void)rtcEngine:(
AgoraRtcEngineKit * _Nonnull)engine streamInjectedStatusOfUrl:(NSString * _Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status;
1592 - (void)rtcEngine:(
AgoraRtcEngineKit *_Nonnull)engine audioMixingStateChanged:(AgoraAudioMixingStateType)state
1593 errorCode:(AgoraAudioMixingErrorType)errorCode;
1595 #if TARGET_OS_IPHONE
1596 #pragma mark Face Detection Delegate Methods
1624 - (void)rtcEngine:(
AgoraRtcEngineKit* _Nonnull)engine facePositionDidChangeWidth:(
int)width previewHeight:(
int)height faces:(NSArray<
AgoraFacePositionInfo*>* _Nullable)faces NS_SWIFT_NAME(rtcEngine(_:facePositionDidChangeWidth:previewHeight:faces:));
1629 #pragma mark - AgoraRtcEngineKit
1643 #pragma mark Core Methods
1656 @property(nonatomic, weak) id<AgoraRtcEngineDelegate> _Nullable
delegate;
1720 - (int)joinChannelByToken:(NSString * _Nullable)token
1721 channelId:(NSString * _Nonnull)channelId
1722 info:(NSString * _Nullable)info
1724 joinSuccess:(
void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))joinSuccessBlock;
1786 - (int)joinChannelByToken:(NSString * _Nullable)token
1787 channelId:(NSString * _Nonnull)channelId
1790 joinSuccess:(
void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))joinSuccessBlock;
1792 - (int)startMultipleVideoStreams:(
VIEW_CLASS * _Nonnull)view screen:(
VIEW_CLASS * _Nonnull)screenView remotes:(NSArray * _Nullable)remoteViews;
1820 - (int)leaveChannel:(
void(^ _Nullable)(
AgoraChannelStats * _Nonnull stat))leaveChannelBlock;
1849 leaveChannelBlock:(void (^ _Nullable)(
AgoraChannelStats * _Nonnull))leaveChannelBlock;
1942 - (int)renewToken:(NSString * _Nonnull)token;
2018 #if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
2024 - (int)stopLocalVideoTranscoder;
2037 - (int)enableWebSdkInteroperability:(BOOL)enabled
__deprecated;
2053 + (instancetype _Nonnull)sharedEngineWithAppId:(NSString * _Nonnull)appId
2097 #pragma mark Core Audio
2154 - (int)enableLocalAudio:(BOOL)enabled;
2194 - (int)enableAudioVolumeIndication:(NSInteger)interval
2195 smooth:(NSInteger)smooth
2196 reportVad:(BOOL)reportVad;
2199 #if TARGET_OS_IPHONE
2217 - (int)setEnableSpeakerphone:(BOOL)enableSpeaker;
2228 - (BOOL)isSpeakerphoneEnabled;
2257 - (int)setDefaultAudioRouteToSpeakerphone:(BOOL)defaultToSpeaker;
2271 - (int)adjustRecordingSignalVolume:(NSInteger)volume;
2284 - (int)adjustPlaybackSignalVolume:(NSInteger)volume;
2305 - (int)adjustUserPlaybackSignalVolume:(NSUInteger)uid volume:(int)volume;
2315 -(int)muteRecordingSignal:(BOOL)muted;
2327 - (int)muteLocalAudioStream:(BOOL)mute;
2342 - (int)muteRemoteAudioStream:(NSUInteger)uid mute:(BOOL)mute;
2369 - (int)muteAllRemoteAudioStreams:(BOOL)mute;
2385 - (int)setDefaultMuteAllRemoteAudioStreams:(BOOL)mute
__deprecated;
2387 - (int)enableExtensionWithVendor:(NSString * __nonnull)provider extension:(NSString * __nonnull)extension enabled:(BOOL)enabled;
2403 - (int)enableExtensionWithVendor:(NSString * __nonnull)provider
2404 extension:(NSString * __nonnull)extension
2405 enabled:(BOOL)enabled
2419 - (int)setExtensionProviderPropertyWithVendor:(NSString * __nonnull)provider
2420 key:(NSString * __nonnull)key
2421 value:(NSString * __nonnull)value;
2423 - (int)setExtensionPropertyWithVendor:(NSString * __nonnull)provider
2424 extension:(NSString * __nonnull)extension
2425 key:(NSString * __nonnull)key
2426 value:(NSString * __nonnull)value;
2441 - (int)setExtensionPropertyWithVendor:(NSString * __nonnull)provider
2442 extension:(NSString * __nonnull)extension
2443 key:(NSString * __nonnull)key
2444 value:(NSString * __nonnull)value
2447 #if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
2468 - (int)enableLoopbackRecording:(BOOL)enabled deviceName:(NSString* _Nullable)deviceName;
2482 - (int)adjustLoopbackRecordingVolume:(NSInteger)volume;
2490 - (int)getLoopbackRecordingVolume;
2494 #pragma mark Core Video
2554 - (int)enableLocalVideo:(BOOL)enabled;
2573 - (int)setVideoEncoderConfiguration:(AgoraVideoEncoderConfiguration * _Nonnull)config;
2600 - (int)setLocalVideoMirrorMode:(AgoraVideoMirrorMode)mode
__deprecated;
2605 - (int)setLocalRenderMode:(NSUInteger)uid
2627 mirror:(AgoraVideoMirrorMode)mirror;
2674 - (int)setRemoteRenderMode:(NSUInteger)uid
2676 mirror:(AgoraVideoMirrorMode)mirror;
2691 - (int)muteLocalVideoStream:(BOOL)mute;
2718 - (int)muteAllRemoteVideoStreams:(BOOL)mute;
2734 - (int)setDefaultMuteAllRemoteVideoStreams:(BOOL)mute
__deprecated;
2751 - (int)muteRemoteVideoStream:(NSUInteger)uid
2767 - (int)setBeautyEffectOptions:(BOOL)enable options:(
AgoraBeautyOptions* _Nullable)options;
2816 - (int)enableVirtualBackground:(BOOL)enable backData:(
AgoraVirtualBackgroundSource* _Nullable)backData NS_SWIFT_NAME(enableVirtualBackground(_:backData:));
2818 #if TARGET_OS_IPHONE
2875 - (int)enableRemoteSuperResolution:(NSUInteger)uid enable:(BOOL)enable;
2877 #pragma mark Audio Effect
2893 - (int)setLocalVoicePitch:(
double)pitch;
2902 - (int)setLocalVoiceEqualizationOfBandFrequency:(AgoraAudioEqualizationBandFrequency)bandFrequency withGain:(NSInteger)gain;
2911 - (int)setLocalVoiceReverbOfType:(AgoraAudioReverbType)reverbType withValue:(NSInteger)value;
2913 #pragma mark Audio Effect Playback
2943 - (int)preloadEffect:(
int)soundId
2944 filePath:(NSString* _Nonnull)filePath;
2971 - (int)preloadEffect:(
int)soundId
2972 filePath:(NSString* _Nonnull)filePath
2973 startPos:(
int)startPos;
2998 - (int)playEffect:(
int)soundId
2999 filePath:(NSString* _Nonnull)filePath
3000 loopCount:(NSInteger)loopCount
3003 gain:(NSInteger)gain;
3029 - (int)playEffect:(
int)soundId
3030 filePath:(NSString* _Nonnull)filePath
3031 loopCount:(NSInteger)loopCount
3034 gain:(NSInteger)gain
3035 startPos:(
int)startPos;
3068 - (int)playEffect:(
int)soundId
3069 filePath:(NSString* _Nonnull)filePath
3070 loopCount:(NSInteger)loopCount
3073 gain:(NSInteger)gain
3074 publish:(BOOL)publish;
3108 - (int)playEffect:(
int)soundId
3109 filePath:(NSString* _Nonnull)filePath
3110 loopCount:(NSInteger)loopCount
3113 gain:(NSInteger)gain
3114 publish:(BOOL)publish
3115 startPos:(int)startPos;
3147 - (int)playAllEffectsWithLoopCount:(NSInteger)loopCount
3150 gain:(NSInteger)gain
3151 publish:(BOOL)publish;
3160 - (int)getEffectsVolume;
3171 - (int)setEffectsVolume:(NSInteger)volume;
3183 - (int)setVolumeOfEffect:(
int)soundId
3184 withVolume:(int)volume;
3195 - (int)getVolumeOfEffect:(
int)soundId;
3204 - (int)pauseEffect:(
int)soundId;
3211 - (int)pauseAllEffects;
3220 - (int)resumeEffect:(
int)soundId;
3227 - (int)resumeAllEffects;
3236 - (int)stopEffect:(
int)soundId;
3244 - (int)stopAllEffects;
3253 - (int)unloadEffect:(
int)soundId;
3261 - (int)unloadAllEffects;
3263 #pragma mark beautifier effect
3340 - (int)setAudioEffectPreset:(AgoraAudioEffectPreset)preset;
3456 - (int)setAudioEffectParameters:(AgoraAudioEffectPreset)preset param1:(int)param1 param2:(
int)param2;
3518 #pragma mark Sound Position Indication
3538 - (int)enableSoundPositionIndication:(BOOL)enabled;
3563 - (int)setRemoteVoicePosition:(NSUInteger)uid pan:(double)pan gain:(
double)gain;
3575 - (int)enableSpatialAudio:(BOOL)enabled;
3592 - (int)setRemoteUserSpatialAudioParams:(NSUInteger)uid
3593 params:(AgoraSpatialAudioParams* _Nonnull)params;
3596 #pragma mark Audio Mixing
3637 - (int)startAudioMixing:(NSString * _Nonnull)filePath
3638 loopback:(BOOL)loopback
3639 replace:(BOOL)replace
3640 cycle:(NSInteger)cycle;
3677 - (int)startAudioMixing:(NSString * _Nonnull)filePath
3678 loopback:(BOOL)loopback
3679 replace:(BOOL)replace
3680 cycle:(NSInteger)cycle
3681 startPos:(NSInteger)startPos;
3692 - (int)stopAudioMixing;
3702 - (int)pauseAudioMixing;
3713 - (int)resumeAudioMixing;
3725 - (int)adjustAudioMixingVolume:(NSInteger)volume;
3736 - (int)adjustAudioMixingPublishVolume:(NSInteger)volume;
3746 - (int)getAudioMixingPublishVolume;
3756 - (int)adjustAudioMixingPlayoutVolume:(NSInteger)volume;
3766 - (int)getAudioMixingPlayoutVolume;
3778 - (int)getAudioMixingDuration;
3788 - (int)getAudioMixingCurrentPosition;
3800 - (int)setAudioMixingPosition:(NSInteger)pos;
3811 - (int)setAudioMixingPitch:(NSInteger)pitch;
3813 #pragma mark Audio Recording
3835 - (int)startAudioRecording:(NSString * _Nonnull)filePath
3836 quality:(AgoraAudioRecordingQuality)quality;
3848 - (int)stopAudioRecording;
3850 #pragma mark Echo Test
3869 - (int)startEchoTest:(
void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))successBlock;
3891 - (int)startEchoTestWithInterval:(NSInteger)interval
3892 successBlock:(void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))successBlock;
3901 - (int)stopEchoTest;
3904 #pragma mark Miscellaneous Audio Control
3921 - (int)enableInEarMonitoring:(BOOL)enabled;
3947 - (int)setInEarMonitoringVolume:(NSInteger)volume;
3949 #if TARGET_OS_IPHONE
3959 - (void)setAudioSessionOperationRestriction:(AgoraAudioSessionOperationRestriction)restriction;
3963 #pragma mark Dual Video Mode
3980 - (int)enableDualStreamMode:(BOOL)enabled;
4019 enabled:(BOOL)enabled
4041 - (int)setRemoteVideoStream:(NSUInteger)uid
4058 #pragma mark Stream Fallback
4082 - (int)setLocalPublishFallbackOption:(AgoraStreamFallbackOptions)option;
4095 - (int)setRemoteSubscribeFallbackOption:(AgoraStreamFallbackOptions)option;
4097 #pragma mark Video Quality Control
4114 - (int)setVideoQualityParameters:(BOOL)preferFrameRateOverImageQuality;
4116 #pragma mark External Media Source
4163 #pragma mark External Audio Data
4176 - (void)enableExternalAudioSink:(NSUInteger)sampleRate
4177 channels:(NSUInteger)channels;
4200 - (BOOL)pullPlaybackAudioFrameRawData:(
void * _Nonnull)data
4201 lengthInByte:(NSUInteger)lengthInByte;
4226 - (CMSampleBufferRef _Nullable)pullPlaybackAudioFrameSampleBufferByLengthInByte:(NSUInteger)lengthInByte;
4247 - (int)setExternalAudioSource:(BOOL)enabled
4248 sampleRate:(NSInteger)sampleRate
4249 channels:(NSInteger)channels;
4251 - (int)enableEchoCancellationExternal:(BOOL)enabled
4252 audioSourceDelay:(NSInteger)audioSourceDelay;
4272 - (int)setExternalAudioSource:(BOOL)enabled
4273 sampleRate:(NSInteger)sampleRate
4274 channels:(NSInteger)channels
4275 sourceNumber:(NSInteger)sourceNumber
4276 localPlayback:(BOOL)localPlayback
4277 publish:(BOOL)publish;
4293 - (int)enableCustomAudioLocalPlayback:(NSInteger)sourceId enabled:(BOOL)enabled;
4303 - (int)pushExternalAudioFrameNSData:(NSData * _Nonnull)data
4304 sourceId:(NSInteger)sourceId
4305 timestamp:(NSTimeInterval)timestamp;
4316 - (int)pushExternalAudioFrameRawData:(
void * _Nonnull)data
4317 samples:(NSInteger)samples
4318 sourceId:(NSInteger)sourceId
4319 timestamp:(NSTimeInterval)timestamp;
4334 - (int)pushExternalAudioFrameRawData:(
void* _Nonnull)data
4335 samples:(NSInteger)samples
4336 sampleRate:(NSInteger)sampleRate
4337 channels:(NSInteger)channels
4338 sourceId:(NSInteger)sourceId
4339 timestamp:(NSTimeInterval)timestamp;
4348 - (int)pushExternalAudioFrameSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer;
4360 - (int)setDirectExternalAudioSource:(BOOL)enabled;
4370 - (int)setDirectExternalAudioSource:(BOOL)enabled localPlayback:(BOOL)localPlayback;
4379 - (int)pushDirectAudioFrameNSData:(NSData* _Nonnull)data;
4393 - (int)pushDirectAudioFrameRawData:(
void* _Nonnull)data
4394 samples:(NSInteger)samples
4395 sampleRate:(NSInteger)sampleRate
4396 channels:(NSInteger)channels;
4408 - (int)enableExternalAudioSourceLocalPlayback:(BOOL)enable;
4433 - (int)setRecordingAudioFrameParametersWithSampleRate:(NSInteger)sampleRate
4434 channel:(NSInteger)channel
4436 samplesPerCall:(NSInteger)samplesPerCall;
4461 - (int)setPlaybackAudioFrameParametersWithSampleRate:(NSInteger)sampleRate
4462 channel:(NSInteger)channel
4464 samplesPerCall:(NSInteger)samplesPerCall;
4483 - (int)setMixedAudioFrameParametersWithSampleRate:(NSInteger)sampleRate
4484 channel:(NSInteger)channel
4485 samplesPerCall:(NSInteger)samplesPerCall;
4500 - (int)setPlaybackAudioFrameBeforeMixingParametersWithSampleRate:(NSInteger)sampleRate
4501 channel:(NSInteger)channel;
4511 - (int)adjustCustomAudioPublishVolume:(NSInteger)sourceId volume:(NSInteger)volume;
4522 - (int)adjustCustomAudioPlayoutVolume:(NSInteger)sourceId volume:(NSInteger)volume;
4524 #pragma mark Audio spectrum monitor
4536 - (int)enableAudioSpectrumMonitor:(
int)intervalInMS;
4559 - (int)registerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable )
delegate;
4569 - (int) unregisterAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)
delegate;
4571 #pragma mark Built-in Encryption
4605 #pragma mark Data Stream
4630 - (int)createDataStream:(NSInteger * _Nonnull)streamId
4631 reliable:(BOOL)reliable
4632 ordered:(BOOL)ordered;
4642 - (int)createDataStream:(NSInteger * _Nonnull)streamId
4667 - (int)sendStreamMessage:(NSInteger)streamId
4668 data:(NSData * _Nonnull)data;
4670 #pragma mark Stream Publish
4690 - (int)addPublishStreamUrl:(NSString * _Nonnull)url transcodingEnabled:(BOOL)transcodingEnabled;
4702 - (int)removePublishStreamUrl:(NSString * _Nonnull)url;
4711 - (int)setLiveTranscoding:(AgoraLiveTranscoding *_Nullable)transcoding;
4720 - (int)startRtmpStreamWithoutTranscoding:(NSString* _Nonnull)url;
4730 - (int)startRtmpStreamWithTranscoding:(NSString* _Nonnull)url transcoding:(AgoraLiveTranscoding* _Nullable)transcoding;
4748 - (int)updateRtmpTranscoding:(AgoraLiveTranscoding* _Nullable)transcoding;
4767 - (int)stopRtmpStream:(NSString* _Nonnull)url;
4779 - (int)addInjectStreamUrl:(NSString * _Nonnull)url config:(AgoraLiveInjectStreamConfig * _Nonnull)config;
4788 - (int)removeInjectStreamUrl:(NSString * _Nonnull)url;
4791 #pragma mark Deprecated CDN Publisher
4807 - (int)configPublisher:(AgoraPublisherConfiguration * _Nonnull)config
__deprecated;
4826 - (int)setVideoCompositingLayout:(AgoraRtcVideoCompositingLayout * _Nonnull)layout
__deprecated;
4836 #if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
4837 #pragma mark Screen Capture
4862 - (int)startScreenCaptureByDisplayId:(UInt32)displayId
4863 regionRect:(CGRect)regionRect
4885 - (int)startScreenCaptureByWindowId:(UInt32)windowId
4886 regionRect:(CGRect)regionRect
4896 - (int)stopScreenCapture;
4907 - (int)updateScreenCaptureRegion:(CGRect)rect;
4922 #if TARGET_OS_IPHONE
4923 #pragma mark Camera Control
4937 - (BOOL)isCameraZoomSupported;
4953 - (CGFloat)setCameraZoomFactor:(CGFloat)zoomFactor;
4962 - (BOOL)isCameraFocusPositionInPreviewSupported;
4971 - (BOOL)setCameraFocusPositionInPreview:(CGPoint)position;
4980 - (BOOL)isCameraExposurePositionSupported;
4989 - (BOOL)setCameraExposurePosition:(CGPoint)positionInView;
4999 - (BOOL)isCameraTorchSupported;
5012 - (BOOL)setCameraTorchOn:(BOOL)isOn;
5021 - (BOOL)isCameraAutoFocusFaceModeSupported;
5034 - (BOOL)setCameraAutoFocusFaceModeEnabled:(BOOL)enable;
5043 - (BOOL)isCameraAutoExposureFaceModeSupported;
5056 - (BOOL)setCameraAutoExposureFaceModeEnabled:(BOOL)enable;
5079 - (int)setCameraCapturerConfiguration:(AgoraCameraCapturerConfiguration * _Nullable)config;
5083 #if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
5084 #pragma mark macOS Device
5097 - (void)monitorDeviceChange:(BOOL)enabled;
5111 - (NSArray<AgoraRtcDeviceInfo *> * _Nullable)enumerateDevices:(AgoraMediaDeviceType)type;
5120 - (AgoraRtcDeviceInfo * _Nullable)getDeviceInfo:(AgoraMediaDeviceType)type;
5132 - (int)setDevice:(AgoraMediaDeviceType)type deviceId:(NSString * _Nonnull)deviceId;
5142 - (int)getDeviceVolume:(AgoraMediaDeviceType)type;
5153 - (int)setDeviceVolume:(AgoraMediaDeviceType)type volume:(int)volume;
5165 - (int)startRecordingDeviceTest:(
int)indicationInterval;
5176 - (int)stopRecordingDeviceTest;
5192 - (int)startPlaybackDeviceTest:(NSString * _Nonnull)audioFileName;
5203 - (int)stopPlaybackDeviceTest;
5218 -(int)startAudioDeviceLoopbackTest:(
int)indicationInterval;
5227 -(int)stopAudioDeviceLoopbackTest;
5237 - (int)startCaptureDeviceTest:(NSView * _Nonnull)view;
5245 - (int)stopCaptureDeviceTest;
5249 #pragma mark Server Recording
5258 - (int)startRecordingService:(NSString * _Nonnull)recordingKey;
5262 - (int)stopRecordingService:(NSString * _Nonnull)recordingKey;
5269 - (int)refreshRecordingServiceStatus;
5271 #pragma mark Face Detection
5273 #if TARGET_OS_IPHONE
5298 - (int)enableFaceDetection:(
bool)enable NS_SWIFT_NAME(enableFaceDetection(_:));
5301 #pragma mark Watermark
5314 - (int)addVideoWatermark:(AgoraImage * _Nonnull)watermark NS_SWIFT_NAME(addVideoWatermark(_:))__deprecated_msg(
"use addVideoWatermark:url options instead.");
5341 - (int)addVideoWatermark:(NSURL* _Nonnull)url options:(
WatermarkOptions* _Nonnull)options;
5347 - (int)clearVideoWatermarks;
5353 -(int)switchChannel:(NSString* _Nonnull)token channelName:(NSString* _Nonnull)channelName;
5354 #pragma mark String UID
5387 - (int)registerLocalUserAccountWithAppID:(NSString * _Nonnull)appID userAccount:(NSString * _Nonnull)userAccount;
5423 - (int)joinChannelByToken:(NSString * _Nullable)token
5424 channelId:(NSString * _Nonnull)channelId
5425 userAccount:(NSString * _Nonnull)userAccount
5426 joinSuccess:(void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))joinSuccessBlock;
5463 - (int)joinChannelByToken:(NSString * _Nullable)token
5464 channelId:(NSString * _Nonnull)channelId
5465 userAccount:(NSString * _Nonnull)userAccount
5467 joinSuccess:(
void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))joinSuccessBlock;
5479 - (
AgoraUserInfo* _Nullable)getUserInfoByUserAccount:(NSString* _Nonnull)userAccount withError:(AgoraErrorCode* _Nullable)error;
5491 - (
AgoraUserInfo* _Nullable)getUserInfoByUid:(NSUInteger)uid withError:(AgoraErrorCode* _Nullable)error;
5493 #pragma mark Custom Audio PCM Frame
5501 - (BOOL)setAudioFrameDelegate:(id<AgoraAudioFrameDelegate> _Nullable)
delegate;
5503 #pragma mark Custom Video Frame
5516 - (BOOL)setVideoFrameDelegate:(id<AgoraVideoFrameDelegate> _Nullable)
delegate;
5518 #pragma mark Encoded Video Frame
5531 - (BOOL)setEncodedVideoFrameDelegate:(id<AgoraEncodedVideoFrameDelegate> _Nullable)
delegate;
5533 #pragma mark Custom Media Metadata
5557 - (BOOL)setMediaMetadataDataSource:(id<AgoraMediaMetadataDataSource> _Nullable)metadataDataSource withType:(
AgoraMetadataType)type;
5574 - (BOOL)setMediaMetadataDelegate:(id<AgoraMediaMetadataDelegate> _Nullable)metadataDelegate withType:(
AgoraMetadataType)type;
5576 #pragma mark Miscellaneous Methods
5595 + (NSString* _Nonnull)getErrorDescription: (NSInteger)error;
5602 - (
void * _Nullable)getNativeHandle;
5628 - (int)setLogFile:(NSString * _Nonnull)filePath;
5644 - (int)setLogFilter:(NSUInteger)filter;
5660 - (int)setLogFileSize:(NSUInteger)fileSizeInKBytes;
5703 - (int)rate:(NSString * _Nonnull)callId
5704 rating:(NSInteger)rating
5705 description:(NSString * _Nullable)description;
5724 - (int)complain:(NSString * _Nonnull)callId
5725 description:(NSString * _Nullable)description;
5738 - (int)enableMainQueueDispatch:(BOOL)enabled;
5778 - (int)setParameters:(NSString * _Nonnull)options;
5785 - (NSString * _Nullable)getParameter:(NSString * _Nonnull)parameter
5786 args:(NSString * _Nullable)args;
5788 #pragma mark MediaPlayer
5798 - (id<AgoraRtcMediaPlayerProtocol>_Nullable)createMediaPlayerWithDelegate:(id<AgoraRtcMediaPlayerDelegate>_Nullable)
delegate;
5811 - (int)destroyMediaPlayer:(id<AgoraRtcMediaPlayerProtocol>_Nullable)mediaPlayer;
5818 - (id<AgoraRtcMediaPlayerProtocol> _Nullable)getMediaPlayer:(
int)mediaPlayerId;
5820 #pragma mark rhythm player
5832 - (int)startRhythmPlayer:(NSString * _Nonnull)sound1 sound2:(NSString * _Nonnull)sound2 config:(
AgoraRhythmPlayerConfig * _Nullable)config;
5852 #pragma mark Streaming Kit
5882 - (int)setDirectCdnStreamingVideoConfiguration:(AgoraVideoEncoderConfiguration * _Nonnull)config;
5895 - (int)startDirectCdnStreaming:(id<AgoraDirectCdnStreamingEventDelegate> _Nonnull)
delegate
5896 publishUrl:(NSString * _Nonnull)publishUrl
5929 - (int)pushDirectCdnStreamingCustomVideoFrame:(
AgoraVideoFrame * _Nonnull)frame;
5932 #pragma mark Deprecated Methods
5950 - (void)audioVolumeIndicationBlock:(
void(^ _Nullable)(NSArray * _Nonnull speakers, NSInteger totalVolume))audioVolumeIndicationBlock __deprecated_msg(
"use delegate instead.");
5960 - (void)firstLocalVideoFrameBlock:(
void(^ _Nullable)(NSInteger width, NSInteger height, NSInteger elapsed))firstLocalVideoFrameBlock __deprecated_msg(
"use delegate instead.");
5972 - (void)firstRemoteVideoDecodedBlock:(
void(^ _Nullable)(NSUInteger uid, NSInteger width, NSInteger height, NSInteger elapsed))firstRemoteVideoDecodedBlock __deprecated_msg(
"use delegate instead.");
5983 - (void)firstRemoteVideoFrameBlock:(
void(^ _Nullable)(NSUInteger uid, NSInteger width, NSInteger height, NSInteger elapsed))firstRemoteVideoFrameBlock __deprecated_msg(
"use delegate instead.");
5994 - (void)userJoinedBlock:(
void(^ _Nullable)(NSUInteger uid, NSInteger elapsed))userJoinedBlock __deprecated_msg(
"use delegate instead.");
6004 - (void)userOfflineBlock:(
void(^ _Nullable)(NSUInteger uid))userOfflineBlock __deprecated_msg(
"use delegate instead.");
6015 - (void)userMuteAudioBlock:(
void(^ _Nullable)(NSUInteger uid, BOOL muted))userMuteAudioBlock __deprecated_msg(
"use delegate instead.");
6031 - (void)userMuteVideoBlock:(
void(^ _Nullable)(NSUInteger uid, BOOL muted))userMuteVideoBlock __deprecated_msg(
"use delegate instead.");
6040 - (void)localVideoStatBlock:(
void(^ _Nullable)(NSInteger sentBitrate, NSInteger sentFrameRate))localVideoStatBlock __deprecated_msg(
"use delegate instead.");
6051 - (void)remoteVideoStatBlock:(
void(^ _Nullable)(NSUInteger uid, NSInteger delay, NSInteger receivedBitrate, NSInteger receivedFrameRate))remoteVideoStatBlock __deprecated_msg(
"use delegate instead.");
6056 - (void)cameraReadyBlock:(
void(^ _Nullable)(void))cameraReadyBlock __deprecated_msg(
"use delegate instead.");
6061 - (void)connectionLostBlock:(
void(^ _Nullable)(void))connectionLostBlock __deprecated_msg(
"use delegate instead.");
6073 - (void)rejoinChannelSuccessBlock:(
void(^ _Nullable)(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed))rejoinChannelSuccessBlock __deprecated_msg(
"use delegate instead.");
6081 - (void)rtcStatsBlock:(
void(^ _Nullable)(
AgoraChannelStats * _Nonnull stat))rtcStatsBlock __deprecated_msg(
"use delegate instead.");
6091 - (void)leaveChannelBlock:(
void(^ _Nullable)(
AgoraChannelStats * _Nonnull stat))leaveChannelBlock __deprecated_msg(
"use delegate instead.");
6102 - (void)audioQualityBlock:(
void(^ _Nullable)(NSUInteger uid,
AgoraNetworkQuality quality, NSUInteger delay, NSUInteger lost))audioQualityBlock __deprecated_msg(
"use delegate instead.");
6112 - (void)networkQualityBlock:(
void(^ _Nullable)(NSUInteger uid,
AgoraNetworkQuality txQuality,
AgoraNetworkQuality rxQuality))networkQualityBlock __deprecated_msg(
"use delegate instead.");
6120 - (void)lastmileQualityBlock:(
void(^ _Nullable)(
AgoraNetworkQuality quality))lastmileQualityBlock __deprecated_msg(
"use delegate instead.");
6125 - (void)mediaEngineEventBlock:(
void(^ _Nullable)(NSInteger code))mediaEngineEventBlock __deprecated_msg(
"use delegate instead.");
6136 - (int)pauseAudio __deprecated_msg(
"use disableAudio instead.");
6147 - (int)resumeAudio __deprecated_msg(
"use enableAudio instead.");
6155 + (instancetype _Nonnull)sharedEngineWithAppId:(NSString * _Nonnull)AppId
6156 error:(void(^ _Nullable)(AgoraErrorCode errorCode))errorBlock __deprecated_msg(
"use sharedEngineWithAppId:delegate: instead.");
6163 - (int)setHighQualityAudioParametersWithFullband:(BOOL)fullband
6165 fullBitrate:(BOOL)fullBitrate __deprecated_msg(
"use setAudioProfile:scenario: instead.");
6184 - (int)setVideoProfile:(AgoraVideoProfile)profile
6185 swapWidthAndHeight:(BOOL)swapWidthAndHeight __deprecated_msg(
"use setVideoEncoderConfiguration: instead.");
6205 - (int)setVideoResolution:(CGSize)size andFrameRate:(NSInteger)frameRate bitrate:(NSInteger)bitrate __deprecated_msg(
"use setVideoEncoderConfiguration: instead.");
6234 - (NSString * _Nullable)getDeviceId:(AgoraMediaDeviceType)type __deprecated_msg(
"use getDeviceInfo: instead.");
6236 #if (!(TARGET_OS_IPHONE) && (TARGET_OS_MAC))
6246 - (int)setSpeakerphoneVolume:(NSUInteger)volume __deprecated_msg(
"use setDeviceVolume:volume: instead.");
6248 - (int)startScreenCapture:(NSUInteger)windowId
6249 withCaptureFreq:(NSInteger)captureFreq
6250 bitRate:(NSInteger)bitRate
6251 andRect:(CGRect)rect __deprecated_msg(
"use startScreenCaptureByWindowId:regionRect:captureParams: instead.");
6259 + (NSString * _Nonnull)getMediaEngineVersion
__deprecated;
6261 - (int)setAudioOptionParams:(NSString * _Nonnull)params;
6262 - (NSString * _Nullable)getAudioOptionParams;
6263 - (int)setAudioSessionParams:(NSString * _Nonnull)params;
6264 - (NSString * _Nullable)getAudioSessionParams;
6287 - (int)sendCustomReportMessage:(NSString * _Nullable)messageId
6288 category:(NSString * _Nullable)category
6289 event:(NSString * _Nullable)
event
6290 label:(NSString * _Nullable)label
6291 value:(NSInteger)value;
6325 - (int)setEncryptionMode:(NSString * _Nullable)encryptionMode __deprecated_msg(
"use enableEncryption: instead.");
6341 - (int)setEncryptionSecret:(NSString * _Nullable)secret __deprecated_msg(
"use enableEncryption: instead.");
6343 - (NSInteger)takeSnapshot:(NSString* _Nonnull)channel uid:(NSInteger)uid filePath:(NSString* _Nonnull)filePath completion:(id<AgoraSnapshotCallbackDelegate> _Nonnull)snapshotDelegate;
6409 - (int) enableFishCorrection:(BOOL)enable
6422 - (int) setAVSyncSource:(NSString* _Nonnull)channelId uid:(NSUInteger)uid;