human: 如何处理七牛云的实时音视频QNRemoteAudioTrack

gpt: [实时音视频](https://developer.qiniu.com/rtc) > API 文档 > iOS >QNRemoteAudioTrack

#  QNRemoteAudioTrack

最近更新时间: 2024-01-18 16:06:26

音频远端 Track 类

Hierarchy

  * [QNTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8851/QNTrack-iOS)
    * [QNLocalTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8847/QNLocalTrack-iOS)
      * [QNLocalVideoTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8849/QNLocalVideoTrack-iOS)
        * [QNCameraVideoTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8852/QNCameraVideoTrack-iOS)
        * [QNScreenVideoTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8850/QNScreenVideoTrack-iOS)
        * [QNCustomVideoTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8853/QNCustomVideoTrack-iOS)
      * [QNLocalAudioTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8854/QNLocalAudioTrack-iOS)
        * [QNMicrophoneAudioTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8855/QNMicrophoneAudioTrack-iOS)
        * [QNCustomAudioTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8856/QNCustomAudioTrack-iOS)
    * [QNRemoteTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8857/QNRemoteTrack-iOS)
      * [QNRemoteVideoTrack](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/8858/QNRemoteVideoTrack-iOS)
      * QNRemoteAudioTrack 

Index

Core Properties

  * userID
  * trackID
  * kind
  * tag
  * muted
  * isSubscribed
  * delegate
  * decryptDelegate

Core Methods

  * setVolume
  * getVolumeLevel

Core Properties

userID

  * @property (nonatomic, readonly) NSString *userID;
  * 一路 Track 所属用户的唯一标识

trackID

  * @property (nonatomic, strong) NSString *trackID;
  * 一路 Track 在 Server 端的唯一标识

> 发布成功时由 SDK 自动生成，订阅/Mute 等操作依据此 trackID 来确定相应的 Track

kind

  * @property (nonatomic, readonly) [QNTrackKind](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/9254) kind;
  * 标识该路 Track 是音频还是视频

tag

  * @property (nonatomic, strong) NSString *tag;
  * Track 的 tag

muted

  * @property (nonatomic, assign, readonly) BOOL muted;
  * 标识 Track 是否为 mute 状态

isSubscribed

  * @property (nonatomic, readonly)BOOL isSubscribed;
  * 是否已订阅

delegate

  * @property (nonatomic, weak) id<[QNRemoteAudioTrackDelegate](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/11948/QNRemoteAudioTrackDelegate)> delegate;
  * 远端音频 Track 的代理

decryptDelegate

  * @property (nonatomic, weak) id<[QNAudioDecryptDelegate](https://developer.qiniu.com/rtc/8859/QNRemoteAudioTrack-iOS/12617/qnaudiodecryptdelegate)> decryptDelegate;
  * 远端音频 Track 解密的代理

Core Methods

setVolume

  * \- (void)setVolume:(double)volume;
  * 设置当前 Track 播放音量大小，范围 0.0 ～ 10.0，默认为 1.0

> 音量值在 0.0 ~ 1.0 之间为软件缩小；1.0 为原始音量；大于 1.0 且小于 10.0 为软件放大
>
> 在需要放大时，应从 1.x 开始设置，用最小的放大值来取得合适的播放效果，过大将会导致音频音调异常
>
> 该设置可以用于适度对播放音量做放大或者缩小，不影响远端音频数据的原始音量

> 部分机型调整音量放大会出现低频噪音

Parameters

    * volume: double 

播放音量大小

getVolumeLevel

  * \- (float)getVolumeLevel;
  * 获取当前 Track 播放音量大小

> 可通过定时调用该方法获取音量值的方式来判断当前用户是否在讲话
>
> 在安静的环境下，获取到 0.0x 大小的数值为预期现象，您可根据您的需求自行决定判断的阈值

Returns float

以上内容是否对您有帮助？