title: Exoplayer - How to check if MP4 video has audio?
body: <p>I'm using URLs from an API. Some of the URLs are mp4's without sound(video is playing just no sound). How do I check if that video has sound or not? I've been searching through SimpleExoPlayer docs and testing the methods on my URLS</p>
  
  <p><a href="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/SimpleExoPlayer.html" rel="nofollow noreferrer">https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/SimpleExoPlayer.html</a> for the past couple hours</p>
  
  <p>But I can't figure out how to detect check if the video playing has sound or not.</p>
  
  <p>Tried all the methods in getAudioAttributes(), getAudioComponents() and now just tried getAudioFormat() but they all return null.</p>
  
  <pre><code>try{
       Log.d(TAG, "onCreateView: " + player.getAudioFormat().channelCount);
  }catch (Exception e){
       Log.d(TAG, "onCreateView: " + e);
  }
  </code></pre>
  
  <p>And yes I've made sure the link's actually have Audio.</p>