Files
cuetools.net/CUETools.Codecs.LAME/LameWriterVBR.cs

52 lines
1.3 KiB
C#
Raw Normal View History

2011-10-23 23:05:45 +00:00
using System;
using System.IO;
namespace CUETools.Codecs.LAME
{
[AudioEncoderClass("lame2 VBR", "mp3", false, "V9 V8 V7 V6 V5 V4 V3 V2 V1 V0", "V2", 2, typeof(LAMEEncoderVBRSettings))]
public class LameWriterVBR : LameWriter
{
private int quality = 0;
public LameWriterVBR(string path, Stream IO, AudioPCMConfig pcm)
: base(IO, pcm)
{
}
public LameWriterVBR(string path, AudioPCMConfig pcm)
: base(path, pcm)
{
}
public override int CompressionLevel
{
get
{
return 9 - quality;
}
set
{
if (value < 0 || value > 9)
throw new Exception("unsupported compression level");
quality = 9 - value;
}
}
LAMEEncoderVBRSettings _settings = new LAMEEncoderVBRSettings();
public override object Settings
{
get
{
return _settings;
}
set
{
if (value as LAMEEncoderVBRSettings == null)
throw new Exception("Unsupported options " + value);
_settings = value as LAMEEncoderVBRSettings;
}
}
}
}