I'm using libFlac to convert a mono wave file to flac.
I'm using a sample file from the wav section in wikipedia, that can be downloaded here
The example code that comes with libFlac says in the documentation that it only supports 16-bit stereo files.
According to libFlac documentation, the library supports 1-8 channels, so there shouldn't be any problem.
I tried changing the example code to simply allow encoding a mono file by simply replacing the lines
//channels = 2;
channels = 1;
The rest of the code looks like it should support one channel without any problems, but when I try to encode a mono file I get a corrupted audio. (The original audio but with "holes" in the audio).
Does any one have a libFlac example that supports encoding a mono file?