Exemple #1
0
        /// <summary>Constructor.</summary>
        /// <param name="format">Format header information.</param>
        /// <param name="samples">Wave samples.</param>
        public WaveSound(WaveFormat format, short[] samples)
        {
            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();
            this.format  = format;
            this.samples = samples;
        }
Exemple #2
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)
        {
            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];
        }