Pergunta

In my Microsoft Surface application I'd like to use voice capture. So I followed the tutorial metioned here (http://opensebj.blogspot.com/2009/04/naudio-tutorial-5-recording-audio.html) and modified the NAudio.dll to be able to execute the following code:

class AudioRecording
    {
        private WaveMixerStream32 mixer;

        public AudioRecording()
        {
            mixer = new WaveMixerStream32();
            mixer.AutoStop = false;

        }

        public void start()
        {
            Console.WriteLine("Start recording"); 
            mixer.StreamMixToDisk("Test.wav");
            mixer.StartStreamingToDisk();
        }

        public void stop()
        {
            Console.WriteLine("Stop recording");
            mixer.StopStreamingToDisk();
        }
    }

But this doesn't really capture the sound. I just create a file of 58 bytes, that is empty. What Am I doing wrong?

Foi útil?
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top