Generate MIDI file and play it without saving it to disk
问题 I found this module that can create midi files. I can play the output file using pygame mixer.music easily, but if I try to play without having to save to a file(play the object) it doesn't work, I get pygame.error: Couldn't read from RWops . I tried using StringIO with no success. I get the same error above. Does anyone one know any module that can play MIDI objects, maybe create them too? 回答1: did you remember to rewind your StringIO buffer? I went through all the steps you did, and got the