2022-01-26 00:50:42 +00:00
|
|
|
//
|
|
|
|
// HeadphoneFilter.h
|
|
|
|
// CogAudio Framework
|
|
|
|
//
|
|
|
|
// Created by Christopher Snowhill on 1/24/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef HeadphoneFilter_h
|
|
|
|
#define HeadphoneFilter_h
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
2022-01-26 00:50:42 +00:00
|
|
|
|
2022-06-06 15:18:33 +00:00
|
|
|
#import "pffft.h"
|
|
|
|
|
2022-01-26 00:50:42 +00:00
|
|
|
@interface HeadphoneFilter : NSObject {
|
2022-06-06 15:18:33 +00:00
|
|
|
PFFFT_Setup *fftSetup;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
size_t fftSize;
|
|
|
|
size_t bufferSize;
|
|
|
|
size_t paddedBufferSize;
|
|
|
|
size_t channelCount;
|
|
|
|
|
2022-06-06 15:18:33 +00:00
|
|
|
float *workBuffer;
|
|
|
|
|
|
|
|
float **impulse_responses;
|
|
|
|
|
|
|
|
float **prevInputs;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
float *left_result;
|
|
|
|
float *right_result;
|
|
|
|
|
|
|
|
float *paddedSignal;
|
2022-01-26 00:50:42 +00:00
|
|
|
}
|
|
|
|
|
2022-01-26 05:30:33 +00:00
|
|
|
+ (BOOL)validateImpulseFile:(NSURL *)url;
|
|
|
|
|
2022-02-07 08:56:05 +00:00
|
|
|
- (id)initWithImpulseFile:(NSURL *)url forSampleRate:(double)sampleRate withInputChannels:(size_t)channels withConfig:(uint32_t)config;
|
2022-01-26 00:50:42 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (void)process:(const float *)inBuffer sampleCount:(size_t)count toBuffer:(float *)outBuffer;
|
2022-01-26 00:50:42 +00:00
|
|
|
|
2022-02-01 23:28:24 +00:00
|
|
|
- (void)reset;
|
|
|
|
|
2022-01-26 00:50:42 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* HeadphoneFilter_h */
|