Agora RTC Objective-C API Reference Refactor

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