Using ofURLFileLoader i download a mp3 file, and write it to the hard disk. On Mac, everything works just fine. Running the same script on Windows scrambles the MP3.
When I open the file in notepad, the difference between the original MP3 and the downloaded are some line breaks. It looks like ofURLFileLoader adds a line break after each buffer (1024).
Could someone give me a clue of how to remove/disable these line breaks?
What is the need of working with a buffer size of 1024 bytes? isn’t the request done at the moment the program reaches line 151? Can’t we just write the buffer to the file at once?
It seems iOS::binary should be iOS_base::binary on windows.
function openStream, file: ofFileUtils.cpp, line 241
But it only work when i directly insert it into the function fstream::open() on line 250.
When is use the var binary_mode to hold the iOS_base::binary, it adds newlines [0x0D] again. Are these different types?
can you try changing the other flags to ios_base, like ios_base::in ios_base::out…
and see if that makes it work with the variable. it’s pretty weird that it doesn’t work as a var since it’s an enum, if they were different types it should fail when compiling