我正在尝试编码WMA10文件,但需要设置VBR质量。
private void Encode()
{
MediaItem mediaItem;
mediaItem = new MediaItem(this.fileNameToEncode);
using (Job job = new Job())
{
WmaAudioProfile wmaProfile = new WmaAudioProfile();
wmaProfile.BitsPerSample = 24;
wmaProfile.Channels = 2;
wmaProfile.Codec = AudioCodec.WmaProfessional;
wmaProfile.SamplesPerSecond = 44100;
VariableQualityBitrate vbrQuality = new VariableQualityBitrate(98);
wmaProfile.Bitrate = vbrQuality;
//Now that I have my profile setup
//how can I use it?
job.MediaItems.Add(mediaItem);
job.OutputDirectory = @"D:\temp\";
job.Encode();
}
}
我不明白如何将AudioProfile实际应用于Job。
答案 0 :(得分:0)
我在找错了地方。该配置文件将应用于MediaItem。
mediaItem.OutputFormat.AudioProfile = wmaProfile;