Can I trim an MP3?

Locked
artdudejoe
User
Posts: 2
Joined: Fri Dec 19, 2008 4:32 pm

Can I trim an MP3?

Post by artdudejoe » Fri Dec 19, 2008 4:38 pm

Is there a way to trim an MP3 file's audio to create a sample snippet using getID3?

I want to take an existing full length song (~3:00 minutes), trim off the first :10 seconds, go ahead :30 (or :40 seconds into the original song) and save this file as a sample song. I figured if you can splice 2 songs together into one I could split one song into two?

Thanks in advance.

James Heinrich
getID3() v1 developer
Posts: 1477
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Can I trim an MP3?

Post by James Heinrich » Sat Dec 20, 2008 12:37 am

Not easily. You'd have to calculate where the cut point is by bytes (reasonable simple for CBR, more complex for VBR) and seek to the nearest frame boundary. It's certainly doable in PHP, and the information returned by getID3 (and some helper functions) would be very useful, but there is nothing built-in that would do this.

artdudejoe
User
Posts: 2
Joined: Fri Dec 19, 2008 4:32 pm

Re: Can I trim an MP3?

Post by artdudejoe » Tue Dec 23, 2008 8:40 pm

I figured, as I saw no plugin for it. Looks like I am going to set the sample song player to handle trimming the real song. Gonna use Actionscript to do so. We'll see how that goes.

Thanks for your reply.

Locked