示例#1
0
        private void WaveFileFiller()
        {
            var waveInBuffer = new Complex[WaveBufferSize];

            fixed(Complex *waveInPtr = waveInBuffer)
            {
                while (IsPlaying)
                {
                    if (_iqStream.Length < _inputBufferSize * 4)
                    {
                        _waveFile.Read(waveInPtr, waveInBuffer.Length);
                        _iqStream.Write(waveInPtr, waveInBuffer.Length);
                    }
                    else
                    {
                        Thread.Sleep(1);
                    }
                }
            }
        }
示例#2
0
        private void fileOpen_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog fileDlg = new OpenFileDialog();

            fileDlg.Filter = "Wave files (*.wav)|*.wav|MP3 files (*.mp3)|*.mp3";

            if (fileDlg.ShowDialog() == DialogResult.OK)
            {
                filename = fileDlg.FileName;
                wave     = new WaveFile(fileDlg.FileName);

                sbpMainPanel.Text = "Reading .WAV file...";

                wave.Read( );

                sbpMainPanel.Text = "Finished Reading .WAV file...";

                this.Text = "ShowTune--" + filename;

                Refresh( );
            }
        }