title: exoplayer, output the audio on both sides of the speakers evenly by picking either left/right audio channel
body: <p>I need to use explayer2 to stream video content to my app. There is only one audio track, and left channel is different from right. Supposedly, only one side is played while the other is muted(volume set to 0). I tried this approach using:</p>
  
  <pre><code>AudioTrack.setVolume(float left, float right)
  </code></pre>
  
  <p>The problem is that only one side will have audio. Is it possible to manipulate the audio renderer in such a way so that both sides use left side's data (or both use right side data), so that it will sound like it is still play in stereo (even though it is only using one channel's data)?</p>
  
  <p><strong>Progress:</strong></p>
  
  <p>I have made some progress with this.</p>
  
  <p>Using java reflection, I was able to access the field com.google.android.exoplayer2.audio.AudioTrack inside MediaCodecAudioRenderer.</p>
  
  <p>With the AudioTrack object I was then able to call configure and set a new channel map.</p>
  
  <p>The problem now is that I get some random NullPointerException saying:</p>
  
  <p>Attempt to invoke virtual method 'int android.media.AudioTrack.getPlayState()' on a null object reference</p>
  
  <p>Attempt to invoke virtual method 'int android.media.AudioTrack.getPlaybackHeadPosition()' on a null object</p>