Web Analytics Made Easy -
StatCounter PHP script to trim MP3 files - CodingForum


No announcement yet.

PHP script to trim MP3 files

  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP script to trim MP3 files

    I cannot find a php script to truncate MP3 file on a server. When a user uploads MP3 file to the server, I have to create its trimmed version for preview (10-15 sec). Since MP3 is an audio compresssed file, I cannot just cut its part and have to make mp3 decoding-encoding. Is that correct?

    Please, advise the simplest way of doing this.

    Thank you
    God helps those who help others.

  • #2
    I have an interesting solution for you ...

    I use the Wimpy MP3 embedded flash player. It works great and only $30?

    But here's the interesting part...

    If you download the free Wimpy player or single-button player to "test drive",
    it only plays any MP3 for 10 seconds. It's their free version to let someone
    try out their flash player.

    That free test download would be perfect for your 10 second sample.
    ... and it wouldn't cost you anything.

    Of course, you can buy the actual flash player ... very nice products!



    • #3
      I put together a script that outputs a 30 second clip of an MP3 file on the fly. If you're looking to save the file, one of the other options using a class/library will probably be best. But, if you just want to play/download the preview, on the fly might be better. It will definitely save you hard drive space.

      Check it out at http://www.stephenwalcher.com/blog/2...an-mp3-in-php/.