Web Hosting Talk







View Full Version : PHP and Mp3, able to make a sample?


jon31
06-25-2005, 02:16 PM
This may be a very silly question, but I'm looking for a way to only get say, the first 30 seconds of an mp3, and using it to create a new file, that would be a sample of the full-length Mp3. Does anyone know anything about this? Is it even possible, or will I have to use some sort of 3rd party application?

What I want to do is be able to upload a full-sized mp3 file, or .wav, and the webapp would make a shortened version of it. Am I way out of my league here?

Thanks,
Jon

Criminal#58369
06-25-2005, 05:44 PM
You could always cut a part of the mp3 out say 30 secs, and upload it, im not sure you could do that uploading a full mp3 and use php to take a cut out of it for a sample.

jon31
06-25-2005, 05:47 PM
Ya, I've thought of that approach, but I'm trying to find the simplest way to do it. It's for a client, not me.

orbitz
06-26-2005, 01:34 AM
have you tried with fread() ?

instead of readingthe whole file's size, read it to a certain length of the file's size.