We implement this function to return the current latency buffered, regardless of how often this function may be called. In practice, it is only called on track completion, to time the reporting of the next track display. We also avoid using Rubber Band's latency function, as in most cases, this function will be called from other threads, and also, it currently only gets called after Rubber Band has been emptied out, so it would otherwise calculate zero samples buffered. And thirdly, Rubber Band's latency function doesn't account for the buffered samples already removed from it and waiting to be fed out. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
32 lines
510 B
Objective-C
32 lines
510 B
Objective-C
//
|
|
// DSPRubberbandNode.h
|
|
// CogAudio
|
|
//
|
|
// Created by Christopher Snowhill on 2/10/25.
|
|
//
|
|
|
|
#ifndef DSPRubberbandNode_h
|
|
#define DSPRubberbandNode_h
|
|
|
|
#import "DSPNode.h"
|
|
|
|
@interface DSPRubberbandNode : DSPNode {
|
|
}
|
|
|
|
- (id _Nullable)initWithController:(id _Nonnull)c previous:(id _Nullable)p latency:(double)latency;
|
|
|
|
- (BOOL)setup;
|
|
- (void)cleanUp;
|
|
|
|
- (void)resetBuffer;
|
|
|
|
- (BOOL)paused;
|
|
|
|
- (void)process;
|
|
- (AudioChunk * _Nullable)convert;
|
|
|
|
- (double)secondsBuffered;
|
|
|
|
@end
|
|
|
|
#endif /* DSPRubberbandNode_h */
|