title: The name 'Microphone' does not exist in the current context unity
body: <p>The name 'Microphone' does not exist in the current context. getting this error when opening an unity(version 5.6.0f3) project is visual studio 2017 in window 8.</p>
  
  <p>[RequireComponent (typeof (AudioSource))]
  public class SingleMicrophoneCapture : MonoBehaviour 
  {</p>
  
  <pre><code>    //A boolean that flags whether there's a connected microphone
      private bool micConnected = false;
  
      //The maximum and minimum available recording frequencies
      private int minFreq;
      private int maxFreq;
  
      //A handle to the attached AudioSource
      public AudioSource goAudioSource;
      public AudioClip recordedAudioClip;
      [HideInInspector]
      public AudioClip myAudioClip;
      //public Text fileExist;
      bool startRecording = false;
  
      public Sprite[] recordingSprites;
      public int count =0;
      //int recordedFileCount =0;
      public bool isDefaultAudioPlaying = false;
      [SerializeField]
      public Sprite[] playSprites;
      public GameObject forwardButton;
      public GameObject backwardButton;
      public GameObject playButton;
      public GameObject replayButton;
      //Use this for initialization
      public AudioClip[] allAudioClips;
      public string storyName;
      float[] samples;
      public Dictionary&lt;int,float&gt; recordedClipDict;
      void Start() 
      {
              //ReplayButtonClicked ();
          //Check if there is at least one microphone connected
  
          recordedAudioClip= null;
          if(Microphone.devices.Length &lt;= 0)
  
              {
              //Throw a warning message at the console if there isn't
              Debug.LogWarning("Microphone not connected!");
          }
          else //At least one microphone is present
          {
              //Set 'micConnected' to true
              micConnected = true;
  
              //Get the default microphone recording capabilities
              Microphone.GetDeviceCaps(null, out minFreq, out maxFreq);
  
              //According to the documentation, if minFreq and maxFreq are zero, the microphone supports any frequency...
              if(minFreq == 0 &amp;&amp; maxFreq == 0)
              {
                  //...meaning 44100 Hz can be used as the recording sampling rate
                  maxFreq = 44100;
              }
  
              //Get the attached AudioSource component
              goAudioSource = this.GetComponent&lt;AudioSource&gt;();
            // mainAudioSource = Camera.main.GetComponent&lt;AudioSource&gt; ();
          }
  
      }
  </code></pre>
  
  <p>how to solve this.</p>