views:

23

answers:

1

hello, stackoverflowers. my client has an opencart e-commerce site. i am tasked with responsibility of creating an audio preview.

it allows users to listen to a small portion of a mp3 file, like 2-3 minutes, before paying and downloading the whole file. kinda like itune thingy.

i am thinking when a file is uploaded, i extract the first 2-3 minutes of it and save it somewhere somehow.

is there a better way? any library that can help me do this? thank you.

A: 

The only other thing I could think do do would be to wrap your command line unix audio editing utilities in a php script to basically create a "grab 2 minute head of MP3" function, then run that on files when they are uploaded. then yes, save them in a "previews" area of the file system and store the filename in a DB table for later reference.

Zak
what unix audio editing utilities are we talking about here? cuz i am not too familiar with that.
Funky Dude