示例#1
0
        public ErrorCode first(out IMediaInfo info)
        {
            AudioInfo ai = new AudioInfo();
            ai.bitsPerSample = bps_;
            ai.channels = channels_;
            ai.sampleRate = (UInt16)frequency_;

            UInt64 duration = 800000 * length_ / ((UInt64)channels_ * (UInt64)bps_ * (UInt64)frequency_);
            info = new WaveInfo(ai, duration);
            return ErrorCode.Success;
        }
示例#2
0
        public ErrorCode init(AVProperty prop, IMediaInfo input, out IMediaInfo output)
        {
            output = null;
            if (input == null)
            {
                return ErrorCode.NullReference;
            }
            if (input.stremType() != StreamType.Audio)
            {
                return ErrorCode.InvalidStream;
            }

            if (input.mediaType() == MediaType.WAVE_LPCM)
            {
                lpcm_ = true;
            }
            else if (input.mediaType() == MediaType.WAVE_PCM)
            {
                lpcm_ = false;
            }
            else
            {
                return ErrorCode.InvalidStream;
            }

            output = new WaveInfo(input.getAudioInfo(), input.getDuration());
            return ErrorCode.Success;
        }
示例#3
0
        public ErrorCode init(AVProperty prop, IMediaInfo input, out IMediaInfo output)
        {
            output = null;
            if (input == null)
            {
                return ErrorCode.NullReference;
            }
            if (input.stremType() != StreamType.Audio)
            {
                return ErrorCode.InvalidStream;
            }

            if (input.mediaType() != MediaType.MPEG10)
            {
                return ErrorCode.InvalidStream;
            }

            output = new WaveInfo(input.getAudioInfo(), input.getDuration());
            return ErrorCode.Success;
        }