-
Notifications
You must be signed in to change notification settings - Fork 11
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 flac.Decode handling of io.EOF #127
Conversation
Is there a way we could mock even a simple and super small audio file so that we can inject it into the test itself? I think it's important to have these tests as part of the automated builds and tests |
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.
see above
I've been thinking about mocking the flac library itself to really test fail scenario's etc. Ofc with mocking this would make some assumptions on how the flac package works, but I think that's the best option. |
I'm just thinking without having to copy over the entire library itself, the flac packaging protocol itself, we implement that ourselves and synthetically create a valid flac format string of binary that can be saved in a buffer that is passed to the 'file open'. It doesn't even have to be valid audio or an actual song or noise.. just something that is valid flac to test that the decode/encode works properly. I'm not very familiar with implementing audio formats, but this is a good start? |
My original thought was mocking We've been working on flac encoding so it's also possible to just encode some data. However, that is not possible for some of the other formats Beep supports. I think it's easier to create audio test files manually than programmatically. Audio formats can be pretty complex. |
okay fair enough. I don't mind adding audio files to the repo for testing, let's try to keep them very small in size and reuse them for all tests... one for flac, one for mp3, etc... |
Thanks for keeping me sharp! I've added a testfile and test. I've moved existing test functions into the |
Resolves #126
Testscript I used to check the return codes are conform the
Streamer
interface below. I've not included the test in the codebase because I don't want to add another audio file to the repo.