Accord.Audio.Formats.WaveDecoder.Open C# (CSharp) Method

Open() public method

Opens the specified stream.
public Open ( SharpDX.Multimedia.SoundStream stream ) : int
stream SharpDX.Multimedia.SoundStream Stream to open.
return int
        public int Open(SoundStream stream)
        {
            this.waveStream = stream;
            this.channels = stream.Format.Channels;
            this.blockAlign = stream.Format.BlockAlign;
            this.numberOfFrames = (int)stream.Length / blockAlign;
            this.sampleRate = stream.Format.SampleRate;
            this.numberOfSamples = numberOfFrames * Channels;
            this.duration = (int)(numberOfFrames / (double)sampleRate * 1000.0);
            this.bitsPerSample = stream.Format.BitsPerSample;
            this.averageBitsPerSecond = stream.Format.AverageBytesPerSecond * 8;

            return numberOfFrames;
        }

Same methods

WaveDecoder::Open ( Stream stream ) : int
WaveDecoder::Open ( string path ) : int