示例#1
0
        /// <summary>Constructor.</summary>
        /// <param name="fileName">The path of WAV file.</param>
        /// <param name="graphicControl">The graphic panel where the WAV data will be rendered.</param>
        /// <param name="progressBar">The progress bar to show progress report during loading and reading the WAV file.</param>
        public WaveSound(string fileName, WaveControl graphicControl, ProgressBar progressBar)
        {
            // Initialize UI settings (user control for graphic control and progress bar)
            GraphicControl      = graphicControl;
            ProgressBar         = progressBar;
            ProgressBar.Maximum = MAX_PROGRESS;
            ProgressBar.Value   = 0;
            ProgressBar.Step    = 1;

            for (short i = -128; i < 0; i++)
            {
                a[128 + i] = i;
            }
            for (short i = 0; i < 128; i++)
            {
                a[128 + i] = i;
            }

            firFilter = new FIRFilters();
            filename  = fileName;
            samples   = new short[4096];
        }
示例#2
0
 public void Read(WaveControl wc, string filename, ProgressBar progress)
 {
     m_Wavefile = new WaveSound(filename, wc, progress);
     m_Wavefile.ReadWavFile();
     m_DrawWave = true;
 }