Skip to content
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

load music considered harmful? #5

Open
soupi opened this issue Jun 28, 2018 · 0 comments
Open

load music considered harmful? #5

soupi opened this issue Jun 28, 2018 · 0 comments

Comments

@soupi
Copy link

soupi commented Jun 28, 2018

sorry for the generic title.

I just finished debugging an issue where I used load to read a music file from disk and play it.
I also kept all the Music values I loaded in a Map.
I ran into all kinds of strange bugs, music jumping forward at a specific place,
trying to play music I already played wouldn't do anything after playing something else, music starting from the middle of the file, etc.

Then I thought that maybe the ByteString content of the file was garbage collected and/or overwritten or something. So instead of keeping a Map of Music I kept a Map of ByteString which is the result of readFile and I played music using playMusic Forever <=< decode. This fixed the issues I had.

Am I correct in my assumptions? Maybe the load API is problematic and should be removed?

I just wanted to share this so it might help others if they trip on these kind of bugs.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant