2011-10-24 08:42:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using CUETools.Codecs.LAME.Interop;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs.LAME
|
|
|
|
|
|
{
|
2013-04-01 23:03:22 -04:00
|
|
|
|
//[AudioEncoderClass("lame VBR", "mp3", false, 2, typeof(LAMEEncoderVBRSettings))]
|
2011-10-24 08:42:30 +00:00
|
|
|
|
public class LAMEEncoderVBR : LAMEEncoder
|
|
|
|
|
|
{
|
2013-04-07 20:41:58 -04:00
|
|
|
|
private LAMEEncoderVBRSettings m_settings;
|
2011-10-24 08:42:30 +00:00
|
|
|
|
|
2013-04-01 23:03:22 -04:00
|
|
|
|
public override AudioEncoderSettings Settings
|
2011-10-24 08:42:30 +00:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2013-04-04 22:07:15 -04:00
|
|
|
|
return m_settings;
|
2011-10-24 08:42:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-04-07 20:41:58 -04:00
|
|
|
|
public LAMEEncoderVBR(string path, Stream IO, AudioEncoderSettings settings)
|
|
|
|
|
|
: base(path, IO, settings)
|
2011-10-24 08:42:30 +00:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-04-07 20:41:58 -04:00
|
|
|
|
public LAMEEncoderVBR(string path, AudioEncoderSettings settings)
|
|
|
|
|
|
: base(path, null, settings)
|
2011-10-24 08:42:30 +00:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override BE_CONFIG MakeConfig()
|
|
|
|
|
|
{
|
2013-04-07 20:41:58 -04:00
|
|
|
|
BE_CONFIG Mp3Config = new BE_CONFIG(Settings.PCM, 0, (uint)m_settings.Quality);
|
2011-10-24 08:42:30 +00:00
|
|
|
|
Mp3Config.format.lhv1.bWriteVBRHeader = 1;
|
|
|
|
|
|
Mp3Config.format.lhv1.nMode = MpegMode.JOINT_STEREO;
|
|
|
|
|
|
Mp3Config.format.lhv1.bEnableVBR = 1;
|
2013-04-04 22:07:15 -04:00
|
|
|
|
Mp3Config.format.lhv1.nVBRQuality = 9 - m_settings.EncoderModeIndex;
|
2011-10-24 08:42:30 +00:00
|
|
|
|
Mp3Config.format.lhv1.nVbrMethod = VBRMETHOD.VBR_METHOD_NEW; // --vbr-new
|
|
|
|
|
|
return Mp3Config;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|