-
Notifications
You must be signed in to change notification settings - Fork 6
/
AudioDecodeController.h
executable file
·51 lines (34 loc) · 1.09 KB
/
AudioDecodeController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#import "Frames.h"
#define kNumAQBufs 3
#define kAudioBufferSeconds 3
typedef enum _AUDIO_STATE {
AUDIO_STATE_READY = 0,
AUDIO_STATE_STOP = 1,
AUDIO_STATE_PLAYING = 2,
AUDIO_STATE_PAUSE = 3,
AUDIO_STATE_SEEKING = 4
} AUDIO_STATE;
@interface AudioDecodeController : NSObject {
NSString *playingFilePath_;
AudioStreamBasicDescription audioStreamBasicDesc_;
AudioQueueRef audioQueue_;
AudioQueueBufferRef audioQueueBuffer_[kNumAQBufs];
BOOL started_, finished_;
NSTimeInterval durationTime_, startedTime_;
NSInteger state_;
NSTimer *seekTimer_;
NSLock *decodeLock_;
}
- (void)_startAudio;
- (void)_stopAudio;
- (BOOL)createAudioQueue;
- (void)removeAudioQueue;
- (void)audioQueueDecodeCallback:(AudioQueueRef)inAQ inBuffer:(AudioQueueBufferRef)inBuffer;
- (void)audioDecodeIsRunningCallback;
- (OSStatus)enqueueBuffer:(AudioQueueBufferRef)buffer;
- (id)initWithStreamer:(Frames*)streamer;
- (OSStatus)startQueue;
@end