Exemple #1
0
        public void start_click(object sender, EventArgs e)
        {
            string filePath = @"test.wav";

            // int amplitude = 32760;  // Max amplitude for 16-bit audio
            // double freq = 440.0f;   // Concert A: 440Hz
            string[]      Input = textBox1.Text.Split(' ');
            WaveGenerator wave  = new WaveGenerator(Convert.ToInt32(Input[0]), Convert.ToDouble(Input[1]));

            wave.Save(filePath);
            Info.Text = "制作完成";
            play      = new SoundPlayer(filePath);
            play.Play();
            Info.Text = "正在播放";
        }
Exemple #2
0
 static void Main(string[] args)
 {
     string filePath = @"C:\Users\Pavel\Desktop\stereo.wav";
     WaveGenerator wave = new WaveGenerator(WaveExampleType.ExampleSineWave);
     wave.Save(filePath);
 }