Closed LAGonauta closed 6 years ago
Have you double-checked that this works correctly with stereo unsigned 8-bit files? The header's description of the raw function is kind of vague on the return value.
You are correct, I was mistaken thinking it behaved the same as readf. The following page elucidates the ambiguity: http://www.mega-nerd.com/libsndfile/api.html#raw
The raw read and write functions return the number of bytes read or written (which should be the same as the bytes parameter).
Thus I should actually convert "got" back to frames. Just fixed it and also took the liberty to change the if-else to a switch statement, I hope this is OK. (seemed more readable as there are two lines of code to read U8 now)
Almost all sound files that I have to read are U8, and reading them as 16-bit was using more memory than could be used. Thus, I added support for unsigned 8-bit to the libsndfile decoder.
Very simple commit, however there is no problem if I have to change anything. (maybe change read() to a switch case?)