The output now uses AVSampleBufferAudioRenderer to play all formats, and uses that to resample. It also supports Spatial Audio on macOS 12.0 or newer. Note that there are some outstanding bugs with Spatial Audio support. Namely that it appears to be limited to only 192 kHz at mono or stereo, or 352800 Hz at surround configurations. This breaks DSD64 playback at stereo formats, as well as possibly other things. This is entirely an Apple bug. I have reported it to Apple with reference code FB10441301 for reference, in case anyone else wants to complain that it isn't fixed. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
75 lines
1.5 KiB
Objective-C
75 lines
1.5 KiB
Objective-C
//
|
|
// ConverterNode.h
|
|
// Cog
|
|
//
|
|
// Created by Zaphod Beeblebrox on 8/2/05.
|
|
// Copyright 2005 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
#import <AudioUnit/AudioUnit.h>
|
|
#import <CoreAudio/AudioHardware.h>
|
|
|
|
#import "Node.h"
|
|
|
|
#define DSD_DECIMATE 1
|
|
|
|
@interface ConverterNode : Node {
|
|
NSDictionary *rgInfo;
|
|
|
|
void *inputBuffer;
|
|
size_t inputBufferSize;
|
|
size_t inpSize, inpOffset;
|
|
|
|
BOOL stopping;
|
|
BOOL convertEntered;
|
|
BOOL paused;
|
|
|
|
float volumeScale;
|
|
|
|
void *floatBuffer;
|
|
size_t floatBufferSize;
|
|
size_t floatSize, floatOffset;
|
|
|
|
#if DSD_DECIMATE
|
|
void **dsd2pcm;
|
|
size_t dsd2pcmCount;
|
|
int dsd2pcmLatency;
|
|
#endif
|
|
|
|
BOOL rememberedLossless;
|
|
|
|
AudioStreamBasicDescription inputFormat;
|
|
AudioStreamBasicDescription floatFormat;
|
|
AudioStreamBasicDescription dmFloatFormat; // downmixed/upmixed float format
|
|
|
|
uint32_t inputChannelConfig;
|
|
|
|
BOOL streamFormatChanged;
|
|
AudioStreamBasicDescription newInputFormat;
|
|
uint32_t newInputChannelConfig;
|
|
|
|
AudioChunk *lastChunkIn;
|
|
|
|
void *hdcd_decoder;
|
|
}
|
|
|
|
@property AudioStreamBasicDescription inputFormat;
|
|
|
|
- (id)initWithController:(id)c previous:(id)p;
|
|
|
|
- (BOOL)setupWithInputFormat:(AudioStreamBasicDescription)inputFormat withInputConfig:(uint32_t)inputConfig isLossless:(BOOL)lossless;
|
|
- (void)cleanUp;
|
|
|
|
- (void)process;
|
|
- (int)convert:(void *)dest amount:(int)amount;
|
|
|
|
- (void)setRGInfo:(NSDictionary *)rgi;
|
|
|
|
- (void)inputFormatDidChange:(AudioStreamBasicDescription)format inputConfig:(uint32_t)inputConfig;
|
|
|
|
- (void)refreshVolumeScaling;
|
|
|
|
@end
|