Cutting Short, splitting or truncating mp3 files…



from the command line in linux… or generating them from Wavs…. So, I’ve got this CD that I’ve made and is up for sale at lulu.com traditional hymns done as “chimes”. I’ve spent quite a bit of time recording to hard drive, editing and getting the wav files as good as possible and I’ve uploaded them, but I also want to make the individual songs available as mp3 downloads too. AND I want to give a preview, either a low quality mp3 of the whole, or a high quality 30 second clip…. Hmmm… how to do it.


First of lame is the tool for the wav -> mp3 conversion…. My “scripts” look like this….

mp3_high
#!/bin/bash
lame $1.wav $1_256.mp3 -b 256 -h

mp3_low
#!/bin/bash
lame $1.wav $1_32.mp3 -b 32

Ok…. but cutting them short, needs another tool mp3splt (no I didn’t mis-spell that…) a simple urpmi mp3splt solves the install….

Now, my next script looks like this….

mp3_truncate
#!/bin/bash
mp3splt $1 0.00 0.30

That essentially will make an mp3 using the first 30 seconds of the filename passed to it. But… I wanted something to glue them all together….

mp3_generate
#!/bin/bash
/home/user/scripts/mp3_high $1
/home/user/scripts/mp3_low $1
/home/user/scripts/mp3_truncate $1_256.mp3

OK…. but now, I’ve got a whole directory of wav files…. hmmm

ls *wav gives the full filename, I’ll have to get rid of the wav, or my mp3′s will be named something.wav.mp3..

mp3_batch
#!/bin/bash
for i in `ls *wav | sed ‘s/.wav//’`
do
`/home/user/scripts/mp3_generate $i`
done

and just call it from the directory that you have your wav files in.

Now, I know, I could probably spend the next three days looking for a GUI based program that can do batch operations, the gui for mp3splt might, but…. now I don’t have to look. That’s been the easiest part of the whole process.

Related Posts

Blog Traffic Exchange Related Posts
  • Quickbooks "An error has occurred in the script on this page" I ran into an install of Quickboos Pro 2005 that was having a peculiar problem. When any company file was opened I was seeing an Internet Explorer Script Error message (quickbooks uses Internet Explorer to parse the company page ( Usually C:\Program Files\Intuit\Quickbooks\Components\Pages\Comppage.qpg ) The error basically said "An error......
  • Remote Tech Support using VNC (Ultravnc SC and x11vnc+wrapper script) Ok, some time back I'd done a writeup on UltraVNC SC, which is a nice customizable (windows version) VNC server that essentially let's someone doing remote support build their own downloadable .exe that runs and automatically tries to make a direct connection to a "listening" vnc viewer. It's good for......
  • Exporting an active linux desktop with vnc, or vnc remote desktop under linux There are lots of ways to get a remote desktop under linux, remote X, nxserver, vnc. One of the problems though is the most common configuration doesn't let you connect to a running desktop session. There is a vnc component that let's you do this and I'm using it right......
Blog Traffic Exchange Related Websites
  • Creating a Recycling Bin Center at Home We all know that recycling is important.  And over 80% of Americans have curbside recycling pickup (at least for paper products, if not for all recyclable materials).  But it remains a fact that many people simply toss all of their trash into the same trash can, sending it all to......
  • 4 Tips to Prevent Ankle Injuries During Exercise Our ankles are actually pretty fragile little joints and you may not realize just how fragile until you sprain one. Nobody likes walking around on crutches, but there are a few ways that you can make sure that your ankles stay strong and that you avoid this common injury. Let's......
  • Buy Digital Photo Frame Online [/caption] Digital Photo Frames are almost a necessary gadget for your home. It makes your home a sweet home, by presenting cute photos of your own choices. Those olden days of fixing hard photo frames are all ruled out. Even in my home, i have 2 photo frames plugged on......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site