예제 #1
0
        private void MetadataCallback(object sender, StreamDecoderMetadataEventArgs e)
        {
            if (e.Metadata.Type == MetadataType.StreamInfo && e.Metadata.StreamInfo != null)
            {
                uint blockAlign     = e.Metadata.StreamInfo.Channels * (e.Metadata.StreamInfo.BitsPerSample / 8);
                uint avgBytesPerSec = e.Metadata.StreamInfo.SampleRate * blockAlign;

                double duration = (double)e.Metadata.StreamInfo.TotalSamples / e.Metadata.StreamInfo.SampleRate;

                this._streamInfo = new FlacMediaStreamInfo(
                    duration, avgBytesPerSec,
                    e.Metadata.StreamInfo.BitsPerSample,
                    e.Metadata.StreamInfo.SampleRate,
                    e.Metadata.StreamInfo.Channels);
            }
        }
예제 #2
0
        private void MetadataCallback(object sender, StreamDecoderMetadataEventArgs e)
        {
            if (e.Metadata.Type == MetadataType.StreamInfo && e.Metadata.StreamInfo != null)
            {
                uint blockAlign = e.Metadata.StreamInfo.Channels*(e.Metadata.StreamInfo.BitsPerSample/8);
                uint avgBytesPerSec = e.Metadata.StreamInfo.SampleRate*blockAlign;

                double duration = (double) e.Metadata.StreamInfo.TotalSamples/e.Metadata.StreamInfo.SampleRate;

                this._streamInfo = new FlacMediaStreamInfo(
                    duration, avgBytesPerSec,
                    e.Metadata.StreamInfo.BitsPerSample,
                    e.Metadata.StreamInfo.SampleRate,
                    e.Metadata.StreamInfo.Channels);
            }
        }