Cog/Audio/Chain/ChunkList.h
Christopher Snowhill 477feaab1d Now properly supports sample format changing
Sample format can now change dynamically at play time, and the player
will resample it as necessary, extrapolating edges between changes to
reduce the potential for gaps.

Currently supported formats for this:

- FLAC
- Ogg Vorbis
- Any format supported by FFmpeg, such as MP3 or AAC

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-07 19:18:45 -08:00

45 lines
831 B
Objective-C

//
// ChunkList.h
// CogAudio Framework
//
// Created by Christopher Snowhill on 2/5/22.
//
#import <CoreAudio/CoreAudio.h>
#import <Foundation/Foundation.h>
#import "AudioChunk.h"
#import "Semaphore.h"
NS_ASSUME_NONNULL_BEGIN
@interface ChunkList : NSObject {
NSMutableArray<AudioChunk *> *chunkList;
double listDuration;
double maxDuration;
BOOL inAdder;
BOOL inRemover;
BOOL inPeeker;
BOOL stopping;
}
@property(readonly) double listDuration;
@property(readonly) double maxDuration;
- (id)initWithMaximumDuration:(double)duration;
- (void)reset;
- (BOOL)isEmpty;
- (BOOL)isFull;
- (void)addChunk:(AudioChunk *)chunk;
- (AudioChunk *)removeSamples:(size_t)maxFrameCount;
- (BOOL)peekFormat:(nonnull AudioStreamBasicDescription *)format channelConfig:(nonnull uint32_t *)config;
@end
NS_ASSUME_NONNULL_END