CjAudioCapture
CjAudioCapture.h
Go to the documentation of this file.
1 //
2 // CjAudioCapture.h
3 // CjAudioCapture
4 //
5 // Created by CJ on 3/21/19.
6 // Copyright © 2019 Seajei. All rights reserved.
7 //
8 
15 #import <Foundation/Foundation.h>
16 #include <AudioToolbox/AudioToolbox.h>
17 
18 NS_ASSUME_NONNULL_BEGIN
19 
23 typedef enum {
24  AudioCaptureFormatPCM,
25  AudioCaptureFormatOpus
27 
28 @protocol CjAudioCaptureDelegate;
29 
30 @interface CjAudioCapture : NSObject
31 
38 - (id)initWithSampleRate:(NSInteger)sampleRate frameSize:(NSInteger)frameSize audioFormat:(AudioCaptureFormat)audioFormat;
39 
43 - (void)start;
44 
48 - (void)stop;
49 
54 - (void)pause;
55 
59 - (void)resume;
60 
65 - (BOOL)isPaused;
66 
70 - (void)deinit;
71 
72 @property (nonatomic, weak) id<CjAudioCaptureDelegate> delegate;
73 
74 @end
75 
76 @protocol CjAudioCaptureDelegate <NSObject>
77 
82 - (void)audioFramesCaptured:(NSData *)audioFrames;
83 
84 @end
85 
86 
87 NS_ASSUME_NONNULL_END
AudioCaptureFormat
Audio format used.
Definition: CjAudioCapture.h:23
void deinit()
Deinitializes the CjAudioCapture class.
Definition: CjAudioCapture.h:30
Definition: CjAudioCapture.h:76
BOOL isPaused()
Check if audio capture is paused.
void start()
Start capturing the audio.
void pause()
Pause capturing the audio.
void stop()
Stop capturing the audio.
void resume()
Resume capturing the audio.