Read FLAC as well as WAV, behind one reader that dispatches on content - #4
Merged
Conversation
AudioFileReader is a Sequence over either container, chosen by inspecting the file rather than trusting its extension, so callers that only ever wanted samples stop caring which format they were handed. FlacReader decodes through a vendored dr_flac in CDrFlac; audio-file-compare exists to diff the two readers over the same material. The 9 AudioFileReaderTests cover the dispatch, slice repeatability and the FLAC fixtures in Tests/Flacs.
Member
Author
|
FYI @reckjn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AudioFileReaderis aSequenceover either container, chosen by inspecting the file's contents rather than trusting its extension, so callers that only want samples stop caring which format they were handed.FlacReaderdecodes through a vendoreddr_flacin a newCDrFlactarget; theaudio-file-compareexecutable exists to diff the two readers over the same material.Based on
memory-map-slice(0bd273c), which is the branchAudioToMIDI-Trainingpins, so merging here moves that pin with no manifest change.Why this is needed downstream
AudioToMIDI-Trainingalready callsAudioFileReaderfromDataset.swift,EntryPoint+Transcription.swiftandMelSegments.swift. Those call sites cannot compile against the pinned revision, and the failure is confusing rather than obvious:swift package editrecords the edit in.build/workspace-state.json, butxcodebuildreads its own.build/xcode/SourcePackages/workspace-state.json, which still sayssourceControlCheckout. So xcodebuild silently compiles the pinned checkout and reportscannot find 'AudioFileReader' in scopewhile the type sits right there in the working tree.Verification
swift buildclean.swift test: 10/10 pass, including 9AudioFileReaderTestscovering content-based dispatch, slice repeatability, and the FLAC fixtures inTests/Flacs.Contents
Sources/WavReader/AudioFileReader.swiftSources/WavReader/FlacReader.swiftSources/CDrFlac/dr_flac(528 K, 3 files)Sources/AudioFileCompare/audio-file-comparediff toolTests/Flacs/Package.swift