Closed tzachshabtay closed 8 years ago
I can't really find a bug inside of the FlacDecoder. If I compare it with the original libflac used by audacity it looks like this: http://fs5.directupload.net/images/160605/r32suxq9.png It is of the exactly same length (387072 samples). What are you using to decode the file?
Hmm, not sure what you mean, isn't the FlacFile class enough to decode? Anyway, here's a sample project to illustrate the problem. I tested on Windows as well: On Mac the beginning of the file is skipped. On Windows (both 7 and 10) I'm getting an "invalid value" from OpenAL when loading the buffer. I compared the created buffers from the FlacFile on mac and windows, the buffer is the same. So I'm not sure if the issue is from CSCore, OpenTK or something I'm doing wrong.
I also have a wav file for comparison, if you comment the load flac and uncomment the load wav it plays fine on both mac and windows.
I would guess the problem is somewhere within the OpenAL implementation. You can try it out with the experimental OpenAL implementation of CSCore (see corresponding branch).
Tried to read the following FLAC file (and feeding it to OpenAL via OpenTK):
1.FLAC.zip
It skips a few seconds of the beginning of the sample (the file itself is very small, so it only plays the last 3 seconds or so). I tried a large FLAC file and it sounded fine.
The code I used to load the buffer:
I compiled CSCore source (downloaded today) with Mono 4.5 on a Mac (don't know if it's relevant).