v1.6.0 release: soundfile format expansion (WAV int depths + RF64 >4GB, AIFF/CAF, AAC/ALAC compressed, 4GB guard, unified AudioFileFormat)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 17:45:34 -07:00
parent 62b2f5dbec
commit 8eb64f883f
33 changed files with 2650 additions and 352 deletions
+39
View File
@@ -6,6 +6,7 @@
import Testing
import Foundation
import AudioToolbox
@testable @_spi(LyrebirdExtensions) import LyrebirdSynth
/// NRT `build`-closure shim.
@@ -286,6 +287,44 @@ struct EngineHostTests {
}
}
@Test func renderConcurrentHonoursJobFormat() async throws {
let (dir, cleanup): (URL, () -> Void) = try makeScratchDir()
defer { cleanup() }
let host: EngineHost = EngineHost()
// A non-default format (WAV / Int16) must reach the output file.
let outURL: URL = dir.appendingPathComponent("stem.wav")
let jobs: [NRTJob] = [
NRTJob(
outputURL: outURL,
duration: 0.05,
format: .wavInt16,
blockSize: 64,
sampleRate: 44100,
numOutputChannels: 2
) { engine in
try nrtBuildAdd(engine) { ConstSynth(value: 0.25) }
}
]
var results: [NRTResult] = []
for try await result: NRTResult in host.renderConcurrent(jobs: jobs) {
results.append(result)
}
#expect(results.count == 1)
var fileRef: ExtAudioFileRef?
#expect(ExtAudioFileOpenURL(outURL as CFURL, &fileRef) == noErr)
let ref: ExtAudioFileRef = try #require(fileRef)
defer { ExtAudioFileDispose(ref) }
var asbd: AudioStreamBasicDescription = AudioStreamBasicDescription()
var size: UInt32 = UInt32(MemoryLayout<AudioStreamBasicDescription>.size)
#expect(ExtAudioFileGetProperty(ref, kExtAudioFileProperty_FileDataFormat, &size, &asbd) == noErr)
#expect(asbd.mBitsPerChannel == 16)
#expect(asbd.mFormatFlags & kAudioFormatFlagIsSignedInteger != 0)
#expect(asbd.mFormatFlags & kAudioFormatFlagIsFloat == 0)
}
@Test func renderConcurrentPropagatesBuildFailure() async throws {
let (dir, cleanup): (URL, () -> Void) = try makeScratchDir()
defer { cleanup() }