Пример #1
0
        public Codec(IWMCodecInfo2 codecInfo, int index, Guid mediaType)
        {
            CodecInformation = codecInfo;
            Index            = index;
            MediaType        = mediaType;

            CodecFormats = CodecFormat.GetMediaFormats(this);
        }
Пример #2
0
        /// <summary>
        /// Gets all media formats for a codec.
        /// </summary>
        /// <param name="codec">Codec</param>
        /// <returns>All media formats for the specified codec</returns>
        public static CodecFormat[] GetMediaFormats(Codec codec)
        {
            var codecInfo = codec.CodecInformation;

            Guid mediaType = codec.MediaType;
            int formatCount;
            codecInfo.GetCodecFormatCount(mediaType, codec.Index, out formatCount);

            var formats = new CodecFormat[formatCount];
            for (int i = 0; i < formatCount; i++)
            {
                IWMStreamConfig config;
                codecInfo.GetCodecFormat(mediaType , codec.Index,  i, out config);
                WMStreamConfig stream = new WMStreamConfig(config);
                formats[i] = new CodecFormat(codec, stream, (int)i);
            }

            return formats;
        }
Пример #3
0
        /// <summary>
        /// Gets all media formats for a codec.
        /// </summary>
        /// <param name="codec">Codec</param>
        /// <returns>All media formats for the specified codec</returns>
        public static CodecFormat[] GetMediaFormats(Codec codec)
        {
            var codecInfo = codec.CodecInformation;

            Guid mediaType = codec.MediaType;
            int  formatCount;

            codecInfo.GetCodecFormatCount(mediaType, codec.Index, out formatCount);

            var formats = new CodecFormat[formatCount];

            for (int i = 0; i < formatCount; i++)
            {
                IWMStreamConfig config;
                codecInfo.GetCodecFormat(mediaType, codec.Index, i, out config);
                WMStreamConfig stream = new WMStreamConfig(config);
                formats[i] = new CodecFormat(codec, stream, (int)i);
            }

            return(formats);
        }
Пример #4
0
 public WmaWriter(Stream output, WaveFormat inputFormat, CodecFormat codecFormat)
     : this(output, inputFormat, codecFormat.GetProfile())
 {
 }
Пример #5
0
        public WmaWriter(Stream output, WaveFormat inputFormat, CodecFormat codecFormat)
            : this(output,inputFormat,codecFormat.GetProfile())
        {

        }