/// <summary> /// Factory method for instantiating the right audio decoder based on stream info. /// </summary> public static AudioDecoder CreateFor(AudioStreamInfo streamInfo) { if (streamInfo == null) { throw new System.ArgumentException ("Can't choose AudioDecoder without streamInfo (with at least codecFourCC)"); } switch (streamInfo.codecFourCC) { case AudioDecoderPCM.FOURCC_MS: case AudioDecoderPCM.FOURCC_0: return new AudioDecoderPCM (streamInfo); } throw new MpException ("No decoder for audio fourCC 0x" + streamInfo.codecFourCC.ToString ("X") + " (" + RiffParser.FromFourCC (streamInfo.codecFourCC) + ")"); }
/// <summary> /// Factory method for instantiating the right audio decoder based on stream info. /// </summary> public static AudioDecoder CreateFor(AudioStreamInfo streamInfo) { if (streamInfo == null) { throw new System.ArgumentException("Can't choose AudioDecoder without streamInfo (with at least codecFourCC)"); } switch (streamInfo.codecFourCC) { case AudioDecoderPCM.FOURCC_MS: return(new AudioDecoderPCM(streamInfo)); } throw new MpException("No decoder for audio fourCC 0x" + streamInfo.codecFourCC.ToString("X") + " (" + RiffParser.FromFourCC(streamInfo.codecFourCC) + ")"); }
/// <summary> /// Initializes the remux. For convenience, call base.Init(...) in your subclass. /// /// Depending on the output format, videoStreamInfo and audioStreamInfo can be NULL /// to indicate, for example, that the AVI won't have audio. /// </summary> public virtual void Init(Stream dstStream, VideoStreamInfo videoStreamInfo, AudioStreamInfo audioStreamInfo) { this.dstStream = dstStream; this._videoStreamInfo = videoStreamInfo; this._audioStreamInfo = audioStreamInfo; }