Agora RTC Objective-C API Reference Refactor

AgoraSpatialAudioKit.h
Go to the documentation of this file.
1 //
2 // AgoraSpatialAudioKit.h
3 // AgoraRtcKit
4 //
5 // Copyright (c) 2018 Agora. All rights reserved.
6 //
7
8 #ifndef AgoraSpatialAudioKit_h
9 #define AgoraSpatialAudioKit_h
10
11 #import <Foundation/Foundation.h>
12 #import "AgoraEnumerates.h"
13 #import "AgoraObjects.h"
14
15 __attribute__((visibility("default"))) @interface AgoraRemoteVoicePositionInfo : NSObject
16 @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull position;
17 @property(strong, nonatomic) NSArray<NSNumber*> * _Nullable forward;
18 @end
19
20 __attribute__((visibility("default"))) @interface AgoraSpatialAudioZone : NSObject
21 //the zone id
22 @property(assign, nonatomic) NSInteger zoneSetId;
23 //zone center point
24 @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull position;
25 //forward direction
26 @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull forward;
27 //right direction
28 @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull right;
29 //up direction
30 @property(strong, nonatomic) NSArray<NSNumber*> * _Nonnull up;
31 //the forward side length of the zone
32 @property(assign, nonatomic) float forwardLength;
33 //tehe right side length of the zone
34 @property(assign, nonatomic) float rightLength;
35 //the up side length of the zone
36 @property(assign, nonatomic) float upLength;
37 //the audio attenuation of zone
38 @property(assign, nonatomic) float audioAttenuation;
39 @end
40
41 @class AgoraRtcEngineKit, AgoraBaseSpatialAudioKit, AgoraLocalSpatialAudioKit;
42
43 __attribute__((visibility("default"))) @interface AgoraCloudSpatialAudioConfig : NSObject
44 @property(assign, nonatomic) AgoraRtcEngineKit* _Nullable rtcEngine;
47 @property(copy, nonatomic) NSString* _Nullable appId;
50 @property(assign, nonatomic) NSUInteger deployRegion;
51 @end
52
53 __attribute__((visibility("default"))) @interface AgoraLocalSpatialAudioConfig : NSObject
54 @property(assign, nonatomic) AgoraRtcEngineKit* _Nullable rtcEngine;
55 @end
56
57 __attribute__((visibility("default"))) @interface AgoraBaseSpatialAudioKit : NSObject
58
59 - (int)setMaxAudioRecvCount:(NSUInteger)maxCount NS_SWIFT_NAME(setMaxAudioRecvCount(_:));
60
61 - (int)setAudioRecvRange:(float)range NS_SWIFT_NAME(setAudioRecvRange(_:));
62
63 - (int)setDistanceUnit:(float)unit NS_SWIFT_NAME(setDistanceUnit(_:));
64
65 - (int)updatePlayerPositionInfo:(NSInteger)playerId positionInfo:(AgoraRemoteVoicePositionInfo* _Nonnull)positionInfo NS_SWIFT_NAME(updatePlayerPositionInfo(_:positionInfo:));
66
67 - (int)updateSelfPosition:(NSArray<NSNumber*>* _Nonnull)position axisForward:(NSArray<NSNumber*>* _Nonnull)axisForward axisRight:(NSArray<NSNumber*>* _Nonnull)axisRight axisUp:(NSArray<NSNumber*>* _Nonnull)axisUp NS_SWIFT_NAME(updateSelfPosition(_:axisForward:axisRight:axisUp:));
68
69 - (int)updateSelfPositionEx:(NSArray<NSNumber*>* _Nonnull)position
70 axisForward:(NSArray<NSNumber*>* _Nonnull)axisForward
71 axisRight:(NSArray<NSNumber*>* _Nonnull)axisRight
72 axisUp:(NSArray<NSNumber*>* _Nonnull)axisUp
73 connection:(AgoraRtcConnection * _Nonnull)connection NS_SWIFT_NAME(updateSelfPositionEx(_:axisForward:axisRight:axisUp:connection:));
74
75 - (int)muteLocalAudioStream:(BOOL)mute NS_SWIFT_NAME(muteLocalAudioStream(_:));
76
77 - (int)muteAllRemoteAudioStreams:(BOOL)mute NS_SWIFT_NAME(muteAllRemoteAudioStreams(_:));
78
79 - (int)setZones:(NSArray<AgoraSpatialAudioZone*> * _Nullable)zones NS_SWIFT_NAME(setZones(_:));
80
81 - (int)setPlayerAttenuation:(double)attenuation playerId:(NSUInteger)playerId forceSet:(BOOL)forceSet NS_SWIFT_NAME(setPlayerAttenuation(_:playerId:forceSet:));
82
83 - (int)muteRemoteAudioStream:(NSUInteger)uid mute:(BOOL)mute NS_SWIFT_NAME(muteRemoteAudioStream(_:mute:));
84
85 @end
86 __attribute__((visibility("default"))) @interface AgoraLocalSpatialAudioKit : AgoraBaseSpatialAudioKit
87
88 + (instancetype _Nonnull)sharedLocalSpatialAudioWithConfig:(AgoraLocalSpatialAudioConfig* _Nonnull)config NS_SWIFT_NAME(sharedLocalSpatialAudio(with:));
89
90 + (void)destroy NS_SWIFT_NAME(destroy());
91
92 - (int)updateRemotePosition:(NSUInteger)uid positionInfo:(AgoraRemoteVoicePositionInfo* _Nonnull)posInfo NS_SWIFT_NAME(updateRemotePosition(_:positionInfo:));
93
94 - (int)updateRemotePositionEx:(NSUInteger)uid positionInfo:(AgoraRemoteVoicePositionInfo* _Nonnull)posInfo connection:(AgoraRtcConnection * _Nonnull)connection NS_SWIFT_NAME(updateRemotePositionEx(_:positionInfo:connection:));
95
96 - (int)removeRemotePosition:(NSUInteger)uid NS_SWIFT_NAME(removeRemotePosition(_:));
97
98 - (int)removeRemotePositionEx:(NSUInteger)uid connection:(AgoraRtcConnection * _Nonnull)connection NS_SWIFT_NAME(removeRemotePositionEx(_:connection:));
99
100 - (int)clearRemotePositions NS_SWIFT_NAME(clearRemotePositions());
101
102 - (int)clearRemotePositionsEx:(AgoraRtcConnection * _Nonnull)connection NS_SWIFT_NAME(clearRemotePositionsEx(_:));
103
104 - (int)setRemoteAudioAttenuation:(double)attenuation userId:(NSUInteger)uid forceSet:(BOOL)forceSet NS_SWIFT_NAME(setRemoteAudioAttenuation(_:userId:forceSet:));
105
106 @end
107
108 #endif /* AgoraSpatialAudioKit_h */
AgoraRtcEngineKit
Definition: AgoraRtcEngineKit.h:1813
+[AgoraLocalSpatialAudioKit destroy]
void destroy()
AgoraRemoteVoicePositionInfo
Definition: AgoraSpatialAudioKit.h:16
AgoraRemoteVoicePositionInfo::position
NSArray< NSNumber * > *_Nonnull position
Definition: AgoraSpatialAudioKit.h:16
AgoraEnumerates.h
AgoraCloudSpatialAudioConfig
Definition: AgoraSpatialAudioKit.h:44
AgoraLocalSpatialAudioKit
Definition: AgoraSpatialAudioKit.h:87
AgoraLocalSpatialAudioConfig
Definition: AgoraSpatialAudioKit.h:54
AgoraRemoteVoicePositionInfo::forward
NSArray< NSNumber * > *_Nullable forward
Definition: AgoraSpatialAudioKit.h:17
-[AgoraLocalSpatialAudioKit clearRemotePositions]
int clearRemotePositions()
AgoraBaseSpatialAudioKit
Definition: AgoraSpatialAudioKit.h:58
AgoraObjects.h
AgoraRtcConnection
Definition: AgoraObjects.h:2897
AgoraSpatialAudioZone
Definition: AgoraSpatialAudioKit.h:21