Rewrite attempt number two. Now using array lists of audio chunks, with each chunk having its format and optionally losslessness stashed along with it. This replaces the old virtual ring buffer method. As a result of this, the HRIR toggle now works instantaneously. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
42 lines
708 B
Objective-C
42 lines
708 B
Objective-C
//
|
|
// AudioChunk.h
|
|
// CogAudio Framework
|
|
//
|
|
// Created by Christopher Snowhill on 2/5/22.
|
|
//
|
|
|
|
#ifndef AudioChunk_h
|
|
#define AudioChunk_h
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <CoreAudio/CoreAudio.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface AudioChunk : NSObject {
|
|
AudioStreamBasicDescription format;
|
|
NSMutableData * chunkData;
|
|
BOOL formatAssigned;
|
|
BOOL lossless;
|
|
}
|
|
|
|
@property AudioStreamBasicDescription format;
|
|
@property BOOL lossless;
|
|
|
|
- (id) init;
|
|
|
|
- (void) assignSamples:(const void *)data frameCount:(size_t)count;
|
|
|
|
- (NSData *) removeSamples:(size_t)frameCount;
|
|
|
|
- (BOOL) isEmpty;
|
|
|
|
- (size_t) frameCount;
|
|
|
|
- (double) duration;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
#endif /* AudioChunk_h */
|