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

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

#  QNMicrophoneAudioTrack

最近更新时间: 2023-11-20 10:33:12

本地音频麦克风 Track 类

Hierarchy

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

Index

Core Properties

  * userID
  * trackID
  * kind
  * tag
  * muted
  * delegate
  * microphoneDelegate

Core Methods

  * updateMute
  * destroy
  * startRecording
  * stopRecording

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/8855/QNMicrophoneAudioTrack-iOS/9254) kind;
  * 标识该路 Track 是音频还是视频

tag

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

muted

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

delegate

  * @property (nonatomic, weak) id<[QNLocalAudioTrackDelegate](https://developer.qiniu.com/rtc/8855/QNMicrophoneAudioTrack-iOS/11969/QNLocalAudioTrackDelegate)> delegate;
  * 本地音频 Track 回调代理

microphoneDelegate

  * @property (nonatomic, weak) id<[QNMicrophoneAudioTrackDelegate](https://developer.qiniu.com/rtc/8855/QNMicrophoneAudioTrack-iOS/12582/QNMicrophoneAudioTrackDelegate)> microphoneDelegate;
  * 麦克风 Track 回调代理

Core Methods

updateMute

  * \- (void)updateMute:(BOOL)mute;
  * 更新当前 Track 的 mute 值，静默后，SDK 将会发送静默帧数据

当静默状态改变后，远端用户将会收到
[QNRemoteAudioTrackDelegate.didMuteStateChanged](https://developer.qiniu.com/rtc/8855/QNMicrophoneAudioTrack-
iOS/11948) 的回调

Parameters

    * mute: BOOL 

是否静默 Track

destroy

  * \- (void)destroy;
  * 销毁本地音/视频 Track

> 在不使用该 Track 之后，请务必调用此接口

startRecording

  * \- (BOOL)startRecording;
  * 开始麦克风采集

> 请根据调用此接口返回的结果，进行下一步业务逻辑处理

Returns 是否调用成功

stopRecording

  * \- (BOOL)stopRecording;
  * 停止麦克风采集

> 请根据调用此接口返回的结果，进行下一步业务逻辑处理

Returns 是否调用成功

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