Note
Do not use pygame2.sdlmixer and pygame2.sdl.audio at the same time. As they both deal with audio hardware access, this can lead to problems and weird behaviour.
Note
The file object must support binary read and write access. This is especially important for Python 3.x users.