mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Refactoring of CUETools.Codecs.
This commit is contained in:
24
CUETools.Codecs/AudioPCMConfig.cs
Normal file
24
CUETools.Codecs/AudioPCMConfig.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user