forked from alexwinston/ExternalAccessory
/
EAAudioRecorder.h
48 lines (40 loc) · 1.03 KB
/
EAAudioRecorder.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
//
// EAAudioRecorder.h
// ExternalAccessory
//
// Created by Alex Winston on 8/16/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <AudioToolbox/AudioToolbox.h>
#define kAudioFormatSampleRate 96000
#define kAudioQueueBufferSize 512
#define kAudioQueueBufferRefSize 2
#define kDataQueueBufferSize 128
#define kDataQueueBufferMaxIdleCount 1024
@interface EAAudioRecorder : NSObject {
AudioQueueRef audioQueue;
AudioQueueBufferRef audioQueueBuffers[kAudioQueueBufferRefSize];
AudioStreamBasicDescription audioFormat;
id delegate;
BOOL buffering;
unsigned char buffer[kDataQueueBufferSize];
int bufferLength;
int bufferIdleCount;
BOOL synchronized;
BOOL started;
int bitCount;
float sample;
float sampleAdjust;
float sampleAdjust2;
int sampleCount;
BOOL sampleBit;
unsigned char byte;
float samples[4];
float differences[4];
}
+ (EAAudioRecorder *)sharedAudioRecorder;
- (id)delegate;
- (void)setDelegate:(id)aDelegate;
- (void)start;
- (void)stop;
@end