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
16 __attribute__((visibility("default"))) @interface AgoraRemoteVoicePositionInfo : NSObject
21 @property(assign, nonatomic) simd_float3 position;
26 @property(assign, nonatomic) simd_float3 forward;
27 @end
28
29
33 __attribute__((visibility("default"))) @interface AgoraSpatialAudioZone : NSObject
34 //the zone id
38 @property(assign, nonatomic) NSInteger zoneSetId;
39 //zone center point
44 @property(nonatomic) simd_float3 position;
45 //forward direction
50 @property(nonatomic) simd_float3 forward;
51 //right direction
56 @property(nonatomic) simd_float3 right;
57 //up direction
62 @property(nonatomic) simd_float3 up;
63 //the forward side length of the zone
68 @property(assign, nonatomic) float forwardLength;
69 //tehe right side length of the zone
74 @property(assign, nonatomic) float rightLength;
75 //the up side length of the zone
80 @property(assign, nonatomic) float upLength;
81 //the audio attenuation of zone
94 @property(assign, nonatomic) float audioAttenuation;
95 @end
96
100 __attribute__((visibility("default"))) @interface AgoraLocalSpatialAudioConfig : NSObject
104 @property(assign, nonatomic) AgoraRtcEngineKit* _Nullable rtcEngine;
105 @end
106
107
108 NS_ASSUME_NONNULL_BEGIN
109
110 __attribute__((visibility("default"))) @interface AgoraSpatialAudioKitBase : NSObject
111
127 - (int)setMaxAudioRecvCount:(NSUInteger)maxCount NS_SWIFT_NAME(setMaxAudioRecvCount(_:));
128
144 - (int)setAudioRecvRange:(float)range NS_SWIFT_NAME(setAudioRecvRange(_:));
145
165 - (int)setDistanceUnit:(float)unit NS_SWIFT_NAME(setDistanceUnit(_:));
166
183 - (int)updatePlayerPositionInfo:(NSInteger)playerId positionInfo:(AgoraRemoteVoicePositionInfo* _Nonnull)positionInfo NS_SWIFT_NAME(updatePlayerPositionInfo(_:positionInfo:));
184
208 - (int)updateSelfPosition:(simd_float3)position axisForward:(simd_float3)axisForward axisRight:(simd_float3)axisRight axisUp:(simd_float3)axisUp NS_SWIFT_NAME(updateSelfPosition(_:axisForward:axisRight:axisUp:));
209
223 - (int)updateSelfTransform:(simd_float4x4)transform NS_SWIFT_NAME(updateSelfTransform(_:));
224
247 - (int)muteLocalAudioStream:(BOOL)mute NS_SWIFT_NAME(muteLocalAudioStream(_:));
248
274 - (int)muteAllRemoteAudioStreams:(BOOL)mute NS_SWIFT_NAME(muteAllRemoteAudioStreams(_:));
275
307 - (int)setZones:(NSArray<AgoraSpatialAudioZone*> * _Nullable)zones NS_SWIFT_NAME(setZones(_:));
308
340 - (int)setPlayerAttenuation:(double)attenuation playerId:(NSUInteger)playerId forceSet:(BOOL)forceSet NS_SWIFT_NAME(setPlayerAttenuation(_:playerId:forceSet:));
341
363 - (int)muteRemoteAudioStream:(NSUInteger)uid mute:(BOOL)mute NS_SWIFT_NAME(muteRemoteAudioStream(_:mute:));
364
365 - (int)clearRemotePositions NS_SWIFT_NAME(clearRemotePositions());
366
367 @end
368
369 __attribute__((visibility("default"))) @interface AgoraLocalSpatialAudioKit : AgoraSpatialAudioKitBase
370
386 + (instancetype _Nonnull)sharedLocalSpatialAudioWithConfig:(AgoraLocalSpatialAudioConfig*)config NS_SWIFT_NAME(sharedLocalSpatialAudio(with:));
387
403 + (void)destroy NS_SWIFT_NAME(destroy());
404
423 - (int)updateRemotePosition:(NSUInteger)uid positionInfo:(AgoraRemoteVoicePositionInfo*)posInfo NS_SWIFT_NAME(updateRemotePosition(_:positionInfo:));
424
425 - (int)updateRemotePositionEx:(NSUInteger)uid positionInfo:(AgoraRemoteVoicePositionInfo*)posInfo connection:(AgoraRtcConnection *)connection NS_SWIFT_NAME(updateRemotePositionEx(_:positionInfo:connection:));
426
445 - (int)removeRemotePosition:(NSUInteger)uid NS_SWIFT_NAME(removeRemotePosition(_:));
446
447 - (int)removeRemotePositionEx:(NSUInteger)uid connection:(AgoraRtcConnection *)connection NS_SWIFT_NAME(removeRemotePositionEx(_:connection:));
448
461 - (int)clearRemotePositionsEx:(AgoraRtcConnection *)connection NS_SWIFT_NAME(clearRemotePositionsEx(_:));
462
494 - (int)setRemoteAudioAttenuation:(double)attenuation uid:(NSUInteger)uid forceSet:(BOOL)forceSet NS_SWIFT_NAME(setRemoteAudioAttenuation(_:uid:forceSet:));
495
496 - (int)updateSelfPositionEx:(simd_float3)position
497 axisForward:(simd_float3)axisForward
498 axisRight:(simd_float3)axisRight
499 axisUp:(simd_float3)axisUp
500 connection:(AgoraRtcConnection *)connection NS_SWIFT_NAME(updateSelfPositionEx(_:axisForward:axisRight:axisUp:connection:));
501
502 @end
503
504 NS_ASSUME_NONNULL_END
AgoraRtcEngineKit
Definition: AgoraRtcEngineKit.h:48
+[AgoraLocalSpatialAudioKit destroy]
void destroy()
Destroys AgoraLocalSpatialAudioKit.
AgoraRemoteVoicePositionInfo
The spatial position of the remote user or the media player.
Definition: AgoraSpatialAudioKit.h:17
AgoraEnumerates.h
AgoraRemoteVoicePositionInfo::forward
simd_float3 forward
Definition: AgoraSpatialAudioKit.h:26
AgoraLocalSpatialAudioKit
Definition: AgoraSpatialAudioKit.h:370
AgoraLocalSpatialAudioConfig
The configuration of AgoraLocalSpatialAudioKit.
Definition: AgoraSpatialAudioKit.h:101
AgoraRemoteVoicePositionInfo::position
simd_float3 position
Definition: AgoraSpatialAudioKit.h:21
AgoraSpatialAudioKitBase
Definition: AgoraSpatialAudioKit.h:111
AgoraObjects.h
AgoraRtcConnection
Contains connection information.
Definition: AgoraObjects.h:3788
-[AgoraSpatialAudioKitBase clearRemotePositions]
int clearRemotePositions()
AgoraSpatialAudioZone
Sound insulation area settings.
Definition: AgoraSpatialAudioKit.h:34