Need suggestions for trimming a .mp3

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BinaryBird
Forum Newbie
Posts: 9
Joined: Tue Dec 22, 2009 1:26 pm

Need suggestions for trimming a .mp3

Post by BinaryBird »

Hello, me a few friends of mine are developing a php-based music store for a client. The client specifically wanted a preview option where by users could listen to the first 30 seconds of a song. All the songs are .mp3's

Could any one tell me, if it is possible to trim down a mp3's duration to the first 30 seconds using php? or suggest any player that will limit the clip duration to 30 seconds? We are currently using a xml based flash player to play the songs on the site.

And please forgive me if i have posted the question in the wrong section.

Kindly help me out. Thanks in advance.
xplosion
Forum Newbie
Posts: 4
Joined: Sat May 22, 2010 6:34 pm

Re: Need suggestions for trimming a .mp3

Post by xplosion »

Surely it's easier to just edit the song with any music player mixer studio software? Choose the 30 secs, than save as a new mp3? Then just upload it..
When I have more time I will look into it if you really need PHP.
xplosion
Forum Newbie
Posts: 4
Joined: Sat May 22, 2010 6:34 pm

Re: Need suggestions for trimming a .mp3

Post by xplosion »

BinaryBird
Forum Newbie
Posts: 9
Joined: Tue Dec 22, 2009 1:26 pm

Re: Need suggestions for trimming a .mp3

Post by BinaryBird »

xplosion wrote:http://www.sourcerally.net/Scripts/20-PHP-MP3-Class

Is this what your looking for?
Something like that, but it says right at the beginning that the script is very slow and takes up lot of memory. So i was wondering if there were any other options or some one could guide me as to how to achieve this?

I could create 30 second clips, but the problem is that there are more than 100,000 songs, so creating preview clips will take up more storage space on the server.

So trying to avoid that option. But thanks for link to the script.
xplosion
Forum Newbie
Posts: 4
Joined: Sat May 22, 2010 6:34 pm

Re: Need suggestions for trimming a .mp3

Post by xplosion »

The reason the script is slow is the fact that it doesn't do just that one thing..
Find the script you need from it and it shouldn't be slow..

- xplosion
BinaryBird
Forum Newbie
Posts: 9
Joined: Tue Dec 22, 2009 1:26 pm

Re: Need suggestions for trimming a .mp3

Post by BinaryBird »

xplosion wrote:The reason the script is slow is the fact that it doesn't do just that one thing..
Find the script you need from it and it shouldn't be slow..

- xplosion
I will try it out. Thanks.
Post Reply