title: why some mp3s on mime_content_type return application/octet-stream
body: <p>Why is it that on some mp3s files, when I call mime_content_type($mp3_file_path) it returns application/octet-stream?</p>
  <p>This is my code:</p>
  <pre><code>if (!empty($_FILES)) {
      $tempFile = $_FILES['Filedata']['tmp_name'];
      $image = getimagesize($tempFile);
      $mp3_mimes = array('audio/mpeg', 'audio/x-mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/mpeg3', 'audio/x-mpeg3', 'audio/mpg', 'audio/x-mpg', 'audio/x-mpegaudio'); 
     
      if (in_array(mime_content_type($tempFile), $mp3_mimes)) { 
          echo json_encode(&quot;mp3&quot;);
      } elseif ($image['mime']=='image/jpeg') {
          echo json_encode(&quot;jpg&quot;);
      } else{
          echo json_encode(&quot;error&quot;);
      }
  }
  </code></pre>
  <p><strong>EDIT:</strong>
  I've found a nice class here:</p>
  <p><a href="http://www.zedwood.com/article/127/php-calculate-duration-of-mp3" rel="nofollow noreferrer">http://www.zedwood.com/article/127/php-calculate-duration-of-mp3</a></p>