LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP validation of uploaded WAV file (https://www.linuxquestions.org/questions/programming-9/php-validation-of-uploaded-wav-file-690997/)

Spudley 12-16-2008 11:44 AM

PHP validation of uploaded WAV file
 
Hi all.

I'm adding a page to a PHP-based web site, which will allow the user to upload an audio recording in the form of a WAV file, for use in another part of the system.

We only want to allow WAV files, so the PHP script needs to be able to confirm that the uploaded file is indeed a valid WAV: If it is, it will save it; if not, then it will reject it and notify the user.

Can anyone tell me the best way to do this? I can't see much to do with audio files in PHP itself (not really surprising), so I guess I'll need to call an external utility, but any suggestions on what to use would be welcome.

Many thanks!



(ps -- we also have various other criteria for the recording, such as the bit-rate, duration, etc; if the same utility can give me those figures as well as confirming whether it's a valid WAV file, then so much the better)

graemef 12-16-2008 05:27 PM

The following web site may help, http://ccrma.stanford.edu/courses/42...ts/WaveFormat/


All times are GMT -5. The time now is 08:14 AM.