示例#1
0
        private void startStopButton_Click(object sender, RoutedEventArgs e)
        {
            if (startStopButton.Content.Equals("Start"))
            {
                // Start the audio source running
                sio.start();

                // Output debugging info
                textOutput.Text  = "Sound Parameters:\n";
                textOutput.Text += "Input: " + sio.getInputNumChannels() +
                                   " channels at " + sio.getInputSampleRate() / 1000.0 +
                                   " KHz, " + sio.getInputBitdepth() + " bits per sample\n";
                textOutput.Text += "Output: " + sio.getOutputNumChannels() +
                                   " channels at " + sio.getOutputSampleRate() / 1000.0 +
                                   " KHz, " + sio.getOutputBitdepth() + " bits per sample\n";

                startStopButton.Content = "Stop";
            }
            else
            {
                sio.stop();
                textOutput.Text         = "Sound Stopped";
                startStopButton.Content = "Start";
            }
        }