Now the API makes both PCM and FFT data optional, and will do nothing if neither are requested. Also, it now supports a latency offset in seconds with floating point precision. The two built-in visualizations currently request zero larency. Increasing the latency asks for even older samples while specifying a negative count requests samples from the "future" relative to what the listener is hearing. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
30 lines
645 B
Objective-C
30 lines
645 B
Objective-C
//
|
|
// VisualizationController.h
|
|
// CogAudio Framework
|
|
//
|
|
// Created by Christopher Snowhill on 2/12/22.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface VisualizationController : NSObject {
|
|
double sampleRate;
|
|
double latency;
|
|
float *visAudio;
|
|
int visAudioCursor, visAudioSize;
|
|
}
|
|
|
|
+ (VisualizationController *)sharedController;
|
|
|
|
- (void)postLatency:(double)latency;
|
|
|
|
- (void)postSampleRate:(double)sampleRate;
|
|
- (void)postVisPCM:(const float *)inPCM amount:(int)amount;
|
|
- (double)readSampleRate;
|
|
- (void)copyVisPCM:(float *)outPCM visFFT:(float *)outFFT latencyOffset:(double)latency;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|