Flake: support for samplerates 88200, 176400, 192000

This commit is contained in:
Grigory Chudov
2013-03-11 23:02:25 -04:00
parent 0f9f8d08a3
commit f528356880
3 changed files with 5 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ namespace CUETools.Codecs.FLAKE
public const int FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN = 16; /* bits */ public const int FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN = 16; /* bits */
public static readonly int[] flac_samplerates = new int[16] { public static readonly int[] flac_samplerates = new int[16] {
0, 0, 0, 0, 0, 88200, 176400, 192000,
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
0, 0, 0, 0 0, 0, 0, 0
}; };

View File

@@ -325,7 +325,7 @@ namespace CUETools.Codecs.FLAKE
frame.blocksize = Flake.flac_blocksizes[frame.bs_code0]; frame.blocksize = Flake.flac_blocksizes[frame.bs_code0];
// custom sample rate // custom sample rate
if (sr_code0 < 4 || sr_code0 > 11) if (sr_code0 < 1 || sr_code0 > 11)
{ {
// sr_code0 == 12 -> sr == bitreader.readbits(8) * 1000; // sr_code0 == 12 -> sr == bitreader.readbits(8) * 1000;
// sr_code0 == 13 -> sr == bitreader.readbits(16); // sr_code0 == 13 -> sr == bitreader.readbits(16);

View File

@@ -1805,11 +1805,11 @@ new int[] { // 30
{ {
if (_IO == null) if (_IO == null)
_IO = new FileStream(_path, FileMode.Create, FileAccess.Write, FileShare.Read); _IO = new FileStream(_path, FileMode.Create, FileAccess.Write, FileShare.Read);
int header_size = flake_encode_init(); inited = true;
int header_size = flake_encode_init();
_IO.Write(header, 0, header_size); _IO.Write(header, 0, header_size);
if (_IO.CanSeek) if (_IO.CanSeek)
first_frame_offset = _IO.Position; first_frame_offset = _IO.Position;
inited = true;
} }
buff.Prepare(this); buff.Prepare(this);
@@ -1997,7 +1997,7 @@ new int[] { // 30
ch_code = channels - 1; ch_code = channels - 1;
// find samplerate in table // find samplerate in table
for (i = 4; i < 12; i++) for (i = 1; i < 12; i++)
{ {
if (_pcm.SampleRate == Flake.flac_samplerates[i]) if (_pcm.SampleRate == Flake.flac_samplerates[i])
{ {