CjAudioPlayer
CjAudioPlayer.h
Go to the documentation of this file.
1 //
2 // CjAudioPlayer.h
3 // PlaySineChooseOutput
4 //
5 // Created by CJ on 4/1/19.
6 // Copyright © 2019 Seajei. All rights reserved.
7 //
8 
14 #import <Foundation/Foundation.h>
15 #include <AudioToolbox/AudioToolbox.h>
16 
20 typedef enum {
21  AudioPlayerFormatPCM,
22  AudioPlayerFormatOpus
24 
25 @protocol CjAudioPlayerDelegate;
26 
27 @interface CjAudioPlayer : NSObject
28 
36 - (id)initWithSampleRate:(NSInteger)sampleRate frameSize:(NSInteger)frameSize maxFramesToBuffer:(NSInteger)maxFramesToBuffer audioFormat:(AudioPlayerFormat)audioFormat;
37 
41 - (void)start;
42 
46 - (void)stop;
47 
51 - (void)mute;
52 
56 - (void)unmute;
57 
62 - (BOOL)isMute;
63 
68 - (void)queueAudioFrames:(NSData *)audioFrames;
69 
70 @property (weak, nonatomic) id<CjAudioPlayerDelegate> delegate;
71 
72 @end
73 
74 @protocol CjAudioPlayerDelegate <NSObject>
75 
76 @optional
81 - (void)audioPlayedVolumePercentage:(float)volumePercentage;
82 
83 @end
Definition: CjAudioPlayer.h:27
void stop()
Stop the audio player.
BOOL isMute()
Check if the audio player is mute.
Definition: CjAudioPlayer.h:74
AudioPlayerFormat
Audio format used.
Definition: CjAudioPlayer.h:20
void mute()
Mute the audio player.
void start()
Start the audio player.
void unmute()
Unmute the audio player.