-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wav files not being rewound, such as when they are missing their file extension #48
Fix wav files not being rewound, such as when they are missing their file extension #48
Conversation
1592506
to
dab3999
Compare
Pull Request Test Coverage Report for Build 10354779343Details
💛 - Coveralls |
Hey @aidewoode , let me know what you think on this one, or if I should add any new tests or fixes. |
Sorry for late reply, and thanks for your great PR to remind me the issue of |
@aidewoode An alternative would be to do the Putting it in The downside of putting it in I'm fine either way -- if you think it belongs best in |
@scouttyg , I think we could add Don't worry about test right now. Just ignore the test. I will write some tests cover both scenarios later, because I don't want to let you spend too much time flighting with test. I am more familiar with those test cases. |
…th this issue for other files potentially in the future
# Rewind after reading the signature to not mess with the file position | ||
io.rewind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aidewoode Added rewind
to the helper (I'll also be adding it to the Tag
class as discussed)
# Rewinding at the start just in case some other helper class or parser already read from the file | ||
@file_io.rewind | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aidewoode Added rewind
to the Tag
class instead of the specific RiffTag
class
Thanks! Released in v1.6.5 |
If a file doesn't have an extension,
WahWah
will attempt to understand the format from the signature:This moves the position of the IO, but
parse
withinRiffTag
doesn't take this into account.To fix this, I do
@file_io.rewind
at the begining ofparse
withinRiffTag
now.Strangely, I was surprised this didn't affect other tags -- if
file_format_from_signature
was moving the position, wouldn't this not just affectRiffTag
?Looking around, I guess the answer was "no" --
Mp3Tag
rewinds at the start viaparse_id3_tag
,FlacTag
conditionally rewinds, andMp4Tag
seems to seek to some known attributes.I still wonder if there's some issues with this other places, but for now this at least fixes
RiffTag
.