Пример #1
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;
        }
Пример #2
0
 public AVProperty getProperty(Int32 id)
 {
     AVProperty prop = new AVProperty();
     prop.id = PropertyId.Dummy;
     return prop;
 }
Пример #3
0
        public ErrorCode init(AVProperty prop, IMediaInfo input)
        {
            if (input == null)
            {
                return ErrorCode.NullReference;
            }

            StreamType st = input.stremType();
            if (st != StreamType.Audio)
            {
                return ErrorCode.InvalidStream;
            }

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

            AudioInfo ai = input.getAudioInfo();

            wfx_.cbSize = 0;
            wfx_.nChannels = ai.channels;
            wfx_.wBitsPerSample = ai.bitsPerSample;
            wfx_.nBlockAlign = (UInt16)(ai.channels * ai.bitsPerSample / 8);
            wfx_.wFormatTag = 1;
            wfx_.nSamplesPerSec = ai.sampleRate;
            wfx_.nAvgBytesPerSec = wfx_.nBlockAlign * wfx_.nSamplesPerSec;

            return ErrorCode.Success;
        }
Пример #4
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;
        }