Repository navigation
feat: Read MP3, FLAC, and WAV without the audio payload - #105
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
- Coverage 93.07% 92.97% -0.11%
==========================================
Files 278 282 +4
Lines 53151 54202 +1051
Branches 4831 4961 +130
==========================================
+ Hits 49470 50392 +922
- Misses 2168 2260 +92
- Partials 1513 1550 +37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
decriptor
force-pushed
the
fix/read-stream
branch
from
November 17, 2026 03:21
95a44a6 to
abf6879
Compare
MediaFile.Read and ReadAsync accept a stream. A seekable MP3, FLAC, or WAV is read from its tags and headers, so a scan does not allocate the audio. A stream that cannot seek is copied once.
MediaFile.Read and ReadAsync still record the path so a later save can find the file. A stream opened with only a path hint does not.
decriptor
force-pushed
the
fix/read-stream
branch
from
November 17, 2026 07:45
49f488a to
d76f0f4
Compare
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.
Summary
MediaFile.ReadandReadAsyncaccept aStream, so an upload does not have to be written to a temp file first. The caller keeps ownership of the stream.SaveToFile()can write it back. A stream opened with only a path hint does not.Fixes #54
Part of #20
Test plan
ReadAllBytesMediaFile.ReadandReadAsyncon a Matroska path setSourcePathand a save round-tripsnetstandard2.0,netstandard2.1,net8.0, andnet10.0Still open on #20
AIFF, MP4, Ogg, WavPack, Musepack, Monkey's Audio, DSF, DFF, ASF, and Matroska still read the whole file into one array. AIFF is the chunked sibling of WAV.