public NoiseWindow()
        {
            InitializeComponent();

            waveTone = new WaveTone(this.sldFreq.Value, this.sldAmpl.Value);
            stream   = new BlockAlignReductionStream(waveTone);

            output = new DirectSoundOut();
            output.Init(stream);
        }
示例#2
0
        private void StartToneButton_Click(object sender, RoutedEventArgs e)
        {
            WaveTone tone = new WaveTone(1000, 0.1);

            stream = new BlockAlignReductionStream(tone);

            output = new DirectSoundOut();
            output.Init(stream);
            output.Play();
        }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (output != null)
            {
                output.Dispose();
                output = null;
            }

            if (waveTone != null)
            {
                waveTone.Dispose();
                waveTone = null;
            }

            if (stream != null)
            {
                stream.Dispose();
                stream = null;
            }
        }