/
AudioSignalAnalyzer.h
54 lines (44 loc) · 1023 Bytes
/
AudioSignalAnalyzer.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
52
53
54
//
// AudioSignalAnalyzer.h
// iNfrared
//
// Created by George Dean on 11/28/08.
// Copyright 2008 Perceptive Development. All rights reserved.
//
#import "AudioQueueObject.h"
#import "PatternRecognizer.h"
//#define DETAILED_ANALYSIS
typedef struct
{
int lastFrame;
int lastEdgeSign;
unsigned lastEdgeWidth;
int edgeSign;
int edgeDiff;
unsigned edgeWidth;
unsigned plateauWidth;
#ifdef DETAILED_ANALYSIS
SInt64 edgeSum;
int edgeMin;
int edgeMax;
SInt64 plateauSum;
int plateauMin;
int plateauMax;
#endif
}
analyzerData;
@interface AudioSignalAnalyzer : AudioQueueObject {
BOOL stopping;
analyzerData pulseData;
NSMutableArray* recognizers;
}
@property (readwrite) BOOL stopping;
@property (readonly) analyzerData* pulseData;
- (void) addRecognizer: (id<PatternRecognizer>)recognizer;
- (void) setupRecording;
- (void) record;
- (void) stop;
- (void) edge: (int)height width:(unsigned)width interval:(unsigned)interval;
- (void) idle: (unsigned)samples;
- (void) reset;
@end