0

我正在尝试对 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

4

1 回答 1

0

我找错地方了。配置文件改为应用于 MediaItem。

mediaItem.OutputFormat.AudioProfile = wmaProfile;

于 2012-11-11T21:40:15.960 回答