1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //
- // RCAACPlayer.h
- // VclustersGemini
- //
- // Created by APPLE on 2020/5/23.
- // Copyright © 2020 APPLE. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #import <AudioToolbox/AudioToolbox.h>
- #import <AVFoundation/AVFoundation.h>
- #define kNumberBuffers 3
- @interface RCMAACPlayer : NSObject {
- // AudioStreamBasicDescription mDataFormat;
- // AudioQueueRef mQueue;
- // AudioQueueBufferRef mBuffers[kNumberBuffers];
- // BOOL isUseingAudioQueueBuffer[kNumberBuffers];
- //
- // UInt32 bufferByteSize; UInt32 mNumPacketsToRead;
- // bool mIsRunning;
- // NSCondition *mAACAudioLock;
- //
- // unsigned char dataNoVol[88];
- }
- /**
- * @brief 初始化AAC音频播放器
- *
- * @param formatID 音频格式暂定为kAudioFormatMPEG4AAC
- *
- */
- - (instancetype)initWithAudioFormatID:(AudioFormatID)formatID;
- /**
- * @brief 填充音频数据
- *
- * @param samples 音频数据
- *
- * @param length 音频数据长度
- *
- */
- - (void)playAudioData:(void *)samples length:(int)length;
- /**
- * @brief 开始播放
- *
- */
- - (BOOL)start;
- /**
- * @brief 结束播放
- *
- */
- - (BOOL)stop;
- @end
|