PHP Class or Function for WAV files - anyone know of one?

by 3 replies
6
Hi

I'm working on an online application for a client that involves working with media files, such as MP3, WAV and MP4 files.

I would like to be able to extract Meta information from the WAV and MP4 files - particularly track run time, licencing and encoding information.

I already have a PHP class that does a fine job with MP3 files (ID3 meta information) so I'm good with that.

Apparently WAV files use header information encoded in "Broadcast Wave Format" or BWF. I have Googled but can't find any code samples for using PHP to read BWF meta information from a WAV file.

Is anyone familiar with any code, a PHP Class or Function, that can do this - read BWF information when given a WAV file?

I'd also be interested in reading meta information from MP4 files as well - run time, frames per second, things like that.

Thanks

Bill
#programming #class #files #function #php #wav
  • I'd never heard of Broadcast WAV format before - so your post is quite enlightening to say the least.

    It looks like this might do the trick for MP4 files, though I don't have any experience with it myself:
    php-mp4info - Project Hosting on Google Code
    • [ 1 ] Thanks
  • I've used code similar to:
    Read wav header and calculate duration - PHP - Snipplr Social Snippet Repository
    .wav file header info - PHP answers

    - but this simply extracts data about the WAV file, such as duration, channels, bitrate etc.

    I wasn't aware that other details could be stored in the WAV file header, but hopefully that's a start.

    It's also worth checking out Welcome to the PHP Classes Repository - PHP Classes - they provide a lot of user-submitted classes for PHP, and I've frequently ended up finding good solutions for quite technical projects there.
    • [ 1 ] Thanks
  • This is an interesting, question, I have played around with a couple of things, like this in the past, but ran into some very complex stuff, but I believe that if you check into the FFMPEG-PHP Library to extract the meta data from different formats, and display them, and from what I know about MP3, it is actually uncompressed to a temp or uses a block of memory to (expand) the mp3 before it is played, so actually you would have the same data, available you would just need to extract that data, at runtime, (sounds easier than it is),

    But I believe that would be a good place to start on doing a comparison on creating your own class to do this,

    hope this helps some,
    Tim
    • [ 1 ] Thanks

Next Topics on Trending Feed