Time stretching
From gPodderWiki
Making playback slower or faster is generally called "time stretching" (http://en.wikipedia.org/wiki/Audio_timescale-pitch_modification). There are certain algorythms that maintain the original pitch so that your favorite podcast speaker doesn't sound like donald duck after doing the processing.
It is a great time saver to listen to podcasts with a faster playback speed. You easily listen to most speakers with 45% speed up and after your used to it, even 70% speed up is understandable.
Currently I'm processing the audio files downloaded by gpodder before transfering them to my ipod.
This is the script I have for speeding up a single mp3 file by 45%.
mp3faster script:
#!/bin/bash
# mp3faster - script for making mp3 playback faster with soundstretch
#
# debian/ubuntu package requirements
# apt-get install mpg321 soundstretch lame libid3-3.8.3-dev
#
# rhel/centos/fedora package requirements
# yum install mpg321 soundtouch lame id3lib
#
# sample usage for converting all mp3 files in a directory structure:
# find -name "*.mp3" -print0 | xargs -0 -i mp3faster {}
#
# decode mp3 to wav file
mpg321 --wav "$1.wav" "$1"
# the above decoding technique doesn't always work, and can sometimes
# create a wav file that plays back too fast. Seems to happen with mp3 files that
# have a low bitrate (< 80kbps). Using the lame alternative below get's around this.
# alternative #1 to decoding an mp3 to wav
# lame --decode "$1" "$1.wav"
# alternative #2 to decoding an mp3 to wav
# mpg321 -b 10000 -s -r 44100 $1 | sox -t raw -r 44100 -s -w -c2 - "$1.wav"
# process file with soundstretch
soundstretch "$1.wav" "$1.fast.wav" -tempo=+45
# encode mp3 file
lame --preset fast medium "$1.fast.wav" "$1.2.mp3"
# copy id3 tags from old file
id3cp "$1" "$1.2.mp3"
# remove temp files
rm "$1.wav" "$1.fast.wav"
# rename original mp3 file to .bak extension
mv "$1" "$1.bak"
# rename processed mp3 file to original name
mv "$1.2.mp3" "$1"
[edit] Using the post-download script hook
There's a post-download script hook in gpodder. The script file name is set in the advanced configuration editor variable "cmd_download_complete" (available at least in gpodder version 0.12.1).
Here's an example script for processing a mp3 podcast for faster playback after it has been downloaded.
gpodder_download_complete script:
#!/bin/bash
LOGFILE=$HOME/.gpodder_download.log
date >> $LOGFILE
echo "url: $GPODDER_EPISODE_URL" >> $LOGFILE
echo "title: $GPODDER_EPISODE_TITLE" >> $LOGFILE
echo "filename: $GPODDER_EPISODE_FILENAME" >> $LOGFILE
echo "pubdate: $GPODDER_EPISODE_PUBDATE" >> $LOGFILE
echo "link: $GPODDER_EPISODE_LINK" >> $LOGFILE
#echo "desc: $GPODDER_EPISODE_DESC" >> $LOGFILE
ext=${GPODDER_EPISODE_FILENAME##*.}
if [ "$ext" == "mp3" ]; then
echo "Converting file" >> $LOGFILE
$HOME/bin/mp3faster $GPODDER_EPISODE_FILENAME >> $LOGFILE 2>&1
fi
