title: Play Audio Track Asynchronously
body: <p>I've tried to use Xamarin example of audio record/play using the follow code:
  <a href="https://github.com/xamarin/monodroid-samples/tree/master/Example_WorkingWithAudio" rel="nofollow">Example_WorkingWithAudio</a></p>
  
  <p>At the following <code>Task</code> i have <code>async</code> error: </p>
  
  <pre><code>protected async Task PlayAudioTrackAsync ()
  {
      audioTrack = new AudioTrack (
          // Stream type
          Android.Media.Stream.Music,
          // Frequency
          11025,
          // Mono or stereo
          ChannelConfiguration.Mono,
          // Audio encoding
          Android.Media.Encoding.Pcm16bit,
          // Length of the audio clip.
          buffer.Length,
          // Mode. Stream or static.
          AudioTrackMode.Stream);
  
      audioTrack.Play ();
  
      await audioTrack.WriteAsync (buffer, 0, buffer.Length);
  }
  </code></pre>
  
  <p>Changed for dot42:</p>
  
  <pre><code>protected async Task PlayAudioTrackAsync()
  {
      audioTrack = new AudioTrack (AudioManager.STREAM_MUSIC,11025,
                                   AudioFormat.CHANNEL_OUT_MONO,
                                   AudioFormat.ENCODING_PCM_16BIT,
                                   buffer.Length,
                                   AudioTrack.MODE_STREAM
                                   );
      audioTrack.Play ();
      await audioTrack.WriteAsync(buffer, 0, buffer.Length);
  }
  </code></pre>
  
  <p>How do i change "audioTrack.WriteAsync" ? I've compiler error on this line.</p>