[Audio Output / Debugging] Fix sample logging
Fix the sample logging function that is optionally compiled into debug versions. Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
38832d9ce9
commit
eb0c1a8463
|
@ -254,7 +254,8 @@ static OSStatus eqRenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioA
|
||||||
currentPtsLock = [[NSLock alloc] init];
|
currentPtsLock = [[NSLock alloc] init];
|
||||||
|
|
||||||
#ifdef OUTPUT_LOG
|
#ifdef OUTPUT_LOG
|
||||||
_logFile = fopen("/tmp/CogAudioLog.raw", "wb");
|
NSString *logName = [NSTemporaryDirectory() stringByAppendingPathComponent:@"CogAudioLog.raw"];
|
||||||
|
_logFile = fopen([logName UTF8String], "wb");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -837,6 +838,10 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
|
||||||
CMBlockBufferRef blockBuffer = nil;
|
CMBlockBufferRef blockBuffer = nil;
|
||||||
size_t dataByteSize = samplesRendered * sizeof(float) * streamFormat.mChannelsPerFrame;
|
size_t dataByteSize = samplesRendered * sizeof(float) * streamFormat.mChannelsPerFrame;
|
||||||
|
|
||||||
|
#ifdef OUTPUT_LOG
|
||||||
|
fwrite(samplePtr, 1, dataByteSize, _logFile);
|
||||||
|
#endif
|
||||||
|
|
||||||
status = CMBlockBufferCreateWithMemoryBlock(kCFAllocatorDefault, nil, dataByteSize, kCFAllocatorDefault, nil, 0, dataByteSize, kCMBlockBufferAssureMemoryNowFlag, &blockBuffer);
|
status = CMBlockBufferCreateWithMemoryBlock(kCFAllocatorDefault, nil, dataByteSize, kCFAllocatorDefault, nil, 0, dataByteSize, kCMBlockBufferAssureMemoryNowFlag, &blockBuffer);
|
||||||
|
|
||||||
if(status != noErr || !blockBuffer) {
|
if(status != noErr || !blockBuffer) {
|
||||||
|
|
Loading…
Reference in New Issue