Microsoft Expression SDK

时间:2012-05-11 08:06:21

标签: c#

我正在使用表达式编码器sdk 4将mp3转换为wma,代码如下

生成了wma文件,但它缺少mp3文件中的缩略图/图像/封面。

using (var job = new Job())
{
    var mediaItem = new MediaItem(input.FullName)
            {
                 OutputFileName = outputFileName,
                 OutputFormat =
                         {
                             AudioProfile =
                             {
                                 Codec = AudioCodec.Wma,
                                 Bitrate = BitRate ?? BitRate,
                                 Channels = 1
                             }
                         }
            };


    job.MediaItems.Add(mediaItem);

    job.OutputDirectory = OutputDirectory;
    job.CreateSubfolder = false;
    job.Encode();
}

我尝试了以下内容:

1)

mediaItem.MarkerThumbnailCodec = ImageFormat.Jpeg;
mediaItem.MarkerThumbnailJpegCompression = 0;
mediaItem.MarkerThumbnailSize = new Size(50, 50);

2)

mediaItem.ThumbnailCodec = ImageFormat.Jpeg;
mediaItem.ThumbnailEmbed = true;
mediaItem.ThumbnailJpegCompression = 50;
mediaItem.ThumbnailMode = ThumbnailMode.BestFrame;
mediaItem.ThumbnailSize = new Size(50, 50);
mediaItem.ThumbnailTime = TimeSpan.FromSeconds(0);

3)

mediaItem.OverlayFileName = @"c:\Chrysanthemum.jpg";
mediaItem.OverlayStartTime = TimeSpan.FromSeconds(0);

..但它没有帮助。

请帮帮我:)。

0 个答案:

没有答案