|
-
Mar 8th, 2007, 10:27 PM
#1
[RESOLVED] Verify MP3
How can I do server-side verification to make sure the uploaded file is an MP3?
Using the MIME type/content type works fine for Internet Explorer, but doesn't seem to work with FireFox.
I don't want to rely on reading ID3 tags since not all MP3s have them. I appreciate any help.
-
Mar 9th, 2007, 12:54 AM
#2
Re: Verify MP3
you could probably use PEAR's mp3_id class. from a glance, it looks like the read method in that class will give an error if reading a non-mp3 file.
http://pear.php.net/package/MP3_Id/d...tml#methodread
-
Mar 9th, 2007, 02:47 PM
#3
Re: Verify MP3
Thanks, I'm going to look into that & test it out.
-
Mar 9th, 2007, 04:02 PM
#4
Re: Verify MP3
Doesn't seem to be working. It only seems to be able to read ID3 tags (artist, genre, etc.). As I said, I don't want to verify an MP3 by it's ID tags, because not all MP3s contain them.
And it also doesn't seem to raise an error if the file is not an MP3.
I want something that can read the length, channels (mono/stereo), bitrate, and sample rate (44100, 48000, etc.).
Any ideas?
-
Mar 9th, 2007, 04:41 PM
#5
-
Mar 9th, 2007, 04:57 PM
#6
Re: Verify MP3
Thanks I'm looking at that now.
-
Mar 9th, 2007, 05:08 PM
#7
Re: Verify MP3
Works perfectly, thanks a lot!
-
Mar 10th, 2007, 05:55 AM
#8
Re: [RESOLVED] Verify MP3
You can also check the file directly. An MP3 file that has no ID3v2 header starts with the bit pattern 111111111110, followed by 111 or 011.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|