Try binary mode. open(mp3Name, "wb") probably get a line open(mp3Name, "wb") .
The file is binary, yes. This is a regime that was not there. When a file is opened, it can be configured as a text file (this is the default). When he does, he will convert the line endings to the platform. On Windows, line endings \r\n In most other places, this is either \r or \n . This change spoiled the data stream.
source share