示例#1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Initialize sio
            sio = new SoundIO();

            // Initialize AudioTool with sio's output parameters:
            at = new AudioTool(sio.getOutputNumChannels(), sio.getOutputSampleRate());

            // Setup event logic with a lambda to run every time we get an input buffer of audio
            sio.audioInEvent += (float[] data) =>
            {
                // When we get a buffer of data, make Audio Tool convert it from mono to stereo:
                float[] output = at.convertChannels(data, 1);

                // Output that data to the speakers
                sio.writeAudio(output);
            };
        }