mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Flake: support for samplerates 88200, 176400, 192000
This commit is contained in:
@@ -34,7 +34,7 @@ namespace CUETools.Codecs.FLAKE
|
||||
public const int FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN = 16; /* bits */
|
||||
|
||||
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,
|
||||
0, 0, 0, 0
|
||||
};
|
||||
|
||||
@@ -325,7 +325,7 @@ namespace CUETools.Codecs.FLAKE
|
||||
frame.blocksize = Flake.flac_blocksizes[frame.bs_code0];
|
||||
|
||||
// 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 == 13 -> sr == bitreader.readbits(16);
|
||||
|
||||
@@ -1805,11 +1805,11 @@ new int[] { // 30
|
||||
{
|
||||
if (_IO == null)
|
||||
_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);
|
||||
if (_IO.CanSeek)
|
||||
first_frame_offset = _IO.Position;
|
||||
inited = true;
|
||||
}
|
||||
|
||||
buff.Prepare(this);
|
||||
@@ -1997,7 +1997,7 @@ new int[] { // 30
|
||||
ch_code = channels - 1;
|
||||
|
||||
// find samplerate in table
|
||||
for (i = 4; i < 12; i++)
|
||||
for (i = 1; i < 12; i++)
|
||||
{
|
||||
if (_pcm.SampleRate == Flake.flac_samplerates[i])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user