2010/09/16

Podcast Time stretching (making playback slower or faster)

Speeding up the playback speed of podcasts by 40%. I can now listen to more podcasts in the same amount of time. I am running Ubuntu linux 10.04. I listen to podcasts on a Sansa clip +. All commands are run from the command line.

You need to install the following programs to for this to work: sox, lame, libid3-3.8.3-dev

Copy the following line into the terminal to install the software.
sudo apt-get install sox lame libid3-3.8.3


I used this link as information.

# decoding an mp3 to wav
# lame --decode "filein.mp3" "fileout.wav"
# process file with soundstretch playing file back 40% faster
# soundstretch "$1.wav" "$1.fast.wav" -tempo=+40
# encode mp3 file using lame
# lame --preset fast medium "$1.fast.wav" "$1.2.mp3"
# copy id3 tags from old file
# id3cp "$1" "$1.2.mp3"  #is not copying id3v2 tags correctly

Note: id3cp would not copy id3v2 tags correctly to the mp3 file. id3cp does copy id3v1 tags correctly for use on the sansa clip +. The command to copy only the id3v1 tag is >> id3cp -1 [source file] [destination file]

 lame --decode DAB\ September\ 14\ -\ 2010.mp3 - | soundstretch stdin stdout -tempo=+40 | lame - dab.20100914.mp3

Lame command line help here.
  • To  read  from stdin, use "-" for <infile>.  To write to stdout, use a "-" for <outfile>.
  • lame --decode DAB\ September\ 14\ -\ 2010.mp3 dab.20100914.wav

Soundstretch command line help here.

  • soundstretch dab.20100912.wav stdout -tempo=+40 | lame - dab.20100912.mp3 
  • Give "stdin" as filename to use standard input pipe.
  • Give "stdout" as filename to use standard output pipe.
Convert file using soundstretch and make the playback 40% faster
f="twit0266.mp3";lame --decode $f $f.wav; soundstretch $f.wav $f.fast.wav -tempo=+40; lame $f.fast.wav $f.fast.mp3; id3cp -1 $f $f.fast.mp3; cp $f ~/podcasts/slow/a/; mv $f.fast.mp3 $f; rm $f.wav $f.fast.wav
  * id3v2 tags are not copied
  * run this from linux command line
  * original mp3 file is moved to home/podcasts/slow/ directory


Convert file using sox and make the playback 40% faster
f="twit0266.mp3";lame --decode $f $f.wav; sox --show-progress $f.wav $f.fast.wav tempo 1.4; lame $f.fast.wav $f.fast.mp3; id3cp -1 $f $f.fast.mp3; cp $f ~/podcasts/slow/a/; mv $f.fast.mp3 $f; rm $f.wav $f.fast.wav
  * id3v2 tags are not copied, id3v1 tags are copied
  * run this from linux command line
  * original mp3 file is moved to home/podcasts/slow/ directory

Running sox by itself on a wave file
 sox --show-progress z.wav zz.wav tempo 1.4 #speed up by 40%

    No comments:

    Post a Comment