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

Fix MP3 music #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Fix MP3 music #3

wants to merge 9 commits into from

Conversation

dnicolson
Copy link

This pull request utilises some unused code to play MP3 music if there are music files in the music directory. If the files do not exist the default MIDI music will play.

It is important that the third argument of the AudioFileReadPacketData function be calculated by multiplying the number of packets by the maximum packet size unlike the deprecated AudioFileReadPackets function. There is a brief mention of this in the discussion in the AudioFile.h file:

In particular, for AudioFileReadPacketData ioNumBytes must be initialized to the buffer size.
AudioFileReadPackets assumes you have allocated your buffer to ioNumPackets times the maximum packet size.

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

Successfully merging this pull request may close these issues.

1 participant