Skip to content Skip to sidebar Skip to footer

How To Recognize The Audio Stream Format?

Here I have the code which records a audio stream to file. The problem is I'd like to save this file with correct file extension (mainly .mp3 and .aac). How can I achieve this? URL

Solution 1:

One way would be to take a look at the binary data while you already have it in your hands. According to this File signatures table both MP3 and AAC have unique magic headers:

  • 49 44 33 for MPEG-1 Audio Layer 3 (MP3) audio file
  • FF F1 for MPEG-4 Advanced Audio Coding (AAC) Low Complexity (LC) audio
  • FF F9 for MPEG-2 Advanced Audio Coding (AAC) Low Complexity (LC) audio

Post a Comment for "How To Recognize The Audio Stream Format?"