Search code examples
phpvalidationaudiowave

How to get audio info out of wav and flac files using php?


I need to be able to

  • Tell if the file is a proper wav or flac file
  • Get the bitrate from it
  • Get the sample rate / kHz
  • Get the bit rate

using php and external tools like ffmpeg for example (if possible to use it) that i can execute and get their output back via php.

Any suggestions for the best and most reliable solution? I'm not asking for an implementation but the best tool or library to get these information via php.


Solution

  • After some research I found sox, i think this will do it http://sox.sourceforge.net/ as I asked for.