Some fixes to WAV reader - #918
Open
madah81pnz1 wants to merge 1 commit into
Open
Conversation
madah81pnz1
commented
Jul 10, 2026
| data_bytes -= 40; | ||
| } | ||
|
|
||
| e->info.bytes_per_wide_sample = channels * (bps / 8); |
Contributor
Author
There was a problem hiding this comment.
This is the main issue, if bps < 8 then bytes_per_wide_sample ends up 0
madah81pnz1
commented
Jul 10, 2026
| } | ||
|
|
||
| /* truncation in the division removes any padding byte that was counted in encoder_session.fmt.iff.data_bytes */ | ||
| total_samples_in_input = encoder_session.fmt.iff.data_bytes / encoder_session.info.bytes_per_wide_sample; |
Contributor
Author
There was a problem hiding this comment.
crashes here if bytes_per_wide_sample is 0
madah81pnz1
commented
Jul 10, 2026
| done | ||
| for f in bps-*.rf64 ; do | ||
| bps_test $f ".rf64" | ||
| # RF64 differs from WAV how it handles WAVE_FORMAT_EXTENSIBLE |
Contributor
Author
There was a problem hiding this comment.
This was a bit suprising though. There is no way to force RF64 or WAVE64 and also force or disable WAVE_FORMAT_EXTENSIBLE at the same time (due to "ERROR: only one of force format options allowed"):
--force-rf64-format Decode to RF64 format
--force-wave64-format Decode to Wave64 format
--force-legacy-wave-format Decode to legacy wave format
--force-extensible-wave-format Decode to extensible wave format
So what happens with --keep-foreign-metadata is that RF64/WAVE64 is not able to restore back the exact 'fmt ' chunk like WAV is able to do. (ERROR verifying foreign metadata restore from file.flac to file.rf64: restore of foreign metadata failed)
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.
Fixes #873
Fixes #917