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:
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user