RCPCMPlayer.h 648 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // RCPCMPlayer.h
  3. // VclustersGemini
  4. //
  5. // Created by APPLE on 2020/5/23.
  6. // Copyright © 2020 APPLE. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <AudioToolbox/AudioToolbox.h>
  10. #import <AVFoundation/AVFoundation.h>
  11. #define QUEUE_BUFFER_SIZE 4 //队列缓冲个数
  12. //#define AUDIO_BUFFER_SIZE 2048 //数据区大小
  13. #define MAX_BUFFER_SIZE 80000 //
  14. @interface RCPCMPlayer : NSObject <AVAudioPlayerDelegate>
  15. -(BOOL)start;
  16. -(void)play:(NSData *)data;
  17. -(void)stop;
  18. - (id)initWithAudioBufferSize:(NSInteger)audioBufferSize mSampleRate:(NSInteger)mSampleRate mChannelsPerFrame:(NSInteger)mChannelsPerFrame;
  19. @end