2011-10-25 04:47:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs.LAME
|
|
|
|
|
|
{
|
2013-04-01 23:03:22 -04:00
|
|
|
|
[AudioEncoderClass("CBR (libmp3lame)", "mp3", false, 1, typeof(LameWriterCBRSettings))]
|
2011-10-25 04:47:05 +00:00
|
|
|
|
public class LameWriterCBR : LameWriter
|
|
|
|
|
|
{
|
|
|
|
|
|
public LameWriterCBR(string path, Stream IO, AudioPCMConfig pcm)
|
|
|
|
|
|
: base(IO, pcm)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public LameWriterCBR(string path, AudioPCMConfig pcm)
|
|
|
|
|
|
: base(path, pcm)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LameWriterCBRSettings _settings = new LameWriterCBRSettings();
|
|
|
|
|
|
|
2013-04-01 23:03:22 -04:00
|
|
|
|
public override AudioEncoderSettings Settings
|
2011-10-25 04:47:05 +00:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _settings;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value as LameWriterCBRSettings == null)
|
|
|
|
|
|
throw new Exception("Unsupported options " + value);
|
|
|
|
|
|
_settings = value as LameWriterCBRSettings;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override LameWriterConfig Config
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2013-04-01 23:03:22 -04:00
|
|
|
|
return LameWriterConfig.CreateCbr(LameWriterCBRSettings.bps_table[this._settings.EncoderModeIndex], this._settings.Quality);
|
2011-10-25 04:47:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|