DOOM-iOS icon indicating copy to clipboard operation
DOOM-iOS copied to clipboard

Fix MP3 music

Open dnicolson opened this issue 5 years ago • 0 comments

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.

dnicolson avatar Oct 18 '20 13:10 dnicolson