문제

I'm trying to encode a WMA10 file, but need to set the VBR Quality.

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();
    }
}

I don't understand how to actually apply a AudioProfile to a Job.

도움이 되었습니까?

해결책

I was looking in the wrong place. The profile gets applied to the MediaItem instead.

mediaItem.OutputFormat.AudioProfile = wmaProfile;

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top