mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
25 lines
931 B
C#
25 lines
931 B
C#
|
|
namespace CUETools.Codecs
|
|||
|
|
{
|
|||
|
|
public class AudioPCMConfig
|
|||
|
|
{
|
|||
|
|
public static readonly AudioPCMConfig RedBook = new AudioPCMConfig(16, 2, 44100);
|
|||
|
|
|
|||
|
|
private int _bitsPerSample;
|
|||
|
|
private int _channelCount;
|
|||
|
|
private int _sampleRate;
|
|||
|
|
|
|||
|
|
public int BitsPerSample { get { return _bitsPerSample; } }
|
|||
|
|
public int ChannelCount { get { return _channelCount; } }
|
|||
|
|
public int SampleRate { get { return _sampleRate; } }
|
|||
|
|
public int BlockAlign { get { return _channelCount * ((_bitsPerSample + 7) / 8); } }
|
|||
|
|
public bool IsRedBook { get { return _bitsPerSample == 16 && _channelCount == 2 && _sampleRate == 44100; } }
|
|||
|
|
|
|||
|
|
public AudioPCMConfig(int bitsPerSample, int channelCount, int sampleRate)
|
|||
|
|
{
|
|||
|
|
_bitsPerSample = bitsPerSample;
|
|||
|
|
_channelCount = channelCount;
|
|||
|
|
_sampleRate = sampleRate;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|