MicrophoneRecorder class

This class is used to gather sound from the Microphone. It uses the XNA stack to accomplish this. It provides a way to get the sound back as a raw buffer or as a SoundEffect object that can be played. For example:


public partial class MediaPage : PhoneApplicationPage
{
  // ...

  MicrophoneRecorder _recorder = new MicrophoneRecorder();

  private void recordButton_Click(object sender, RoutedEventArgs e)
  {
    _recorder.Start();
  }

  private void stopRecordingButton_Click(object sender, RoutedEventArgs e)
  {
    _recorder.Stop();
  }

  private void playRecordingButton_Click(object sender, RoutedEventArgs e)
  {
    SoundEffect theRecording = _recorder.GetSoundEffect();

    // ...
   
   byte[] rawBuffer = _recorder.GetRawBuffer();
  }
}

Last edited Mar 5, 2011 at 7:53 AM by TheADOGuy, version 3

Comments

No comments yet.