You are right. Using python for everything is a tic. I accomplished this task with a simple shell script and a little of awk. Here is how: Copy the following code to a file named, for example abplayer (from "audiobook player), or wathever you like: Code: #!/bin/sh if test -f "$1".resume then resumepoint=`cat "$1".resume` else resumepoint=0 fi mplayer -ss $resumepoint "$1"|awk 'BEGIN{RS="\r"}{if ($1=="A:") t=$2}END{print t}' > "$1".resume Put this file in a place where your shell can find it (I have a "bin" folder in my $HOME, and a line in the .profile for adding this folder to the PATH variable). Make executable this file (chmod +x abplayer). Then, use it from the command line (xterm) like this: Code: $ abplayer /route/to/audiobook.mp3 The audio begins to play. When you press 'q', the player is exited, and a new file is created, with name /route/to/audiobook.mp3.resume which contains the time in which the playback was quitted. Next time you use abeplay, it will search for this file. If it founds it, the playback is resumed from that point. If not, it is restarted again from the beginning. If the player exits unexpectedly and the .resume file is corrupt, you have to delete it (or you can write a correct one with any editor, it only contains the time where the playback has to be resumed, in the format hh:mm:ss.ff, being ff any fraction of second, for example: 3:21.52) I used mplayer because I have it already installed, and supports a wide range of formats. As for mpg123, I did not find it with apt-cache...
#!/bin/sh if test -f "$1".resume then resumepoint=`cat "$1".resume` else resumepoint=0 fi mplayer -ss $resumepoint "$1"|awk 'BEGIN{RS="\r"}{if ($1=="A:") t=$2}END{print t}' > "$1".resume
$ abplayer /route/to/audiobook.mp3
#!/bin/sh if [ -e $HOME/.mplayer/abook.plist ] && [ -z "$1" ] then LASTFILE=`cat $HOME/.mplayer/abook.resume | tail -n2 | awk -Fmp3 '{print $1}'` RESPOINT=`cat $HOME/.mplayer/abook.resume | tail -n1` FILESUM=`wc -l $HOME/.mplayer/abook.plist | awk '/[0-1]/ {print $1}'` CPLIST=`cat $HOME/.mplayer/abook.plist | grep -A$FILESUM "$LASTFILE"` elif [ -e $HOME/.mplayer/abook.plist ] && [ ! -z "$1" ] then echo " " > $HOME/.mplayer/abook.plist cd "$1" ABFILES=`ls -1` for I in $ABFILES do echo "`pwd`/$I" >> $HOME/.mplayer/abook.plist done CPLIST=`cat $HOME/.mplayer/abook.plist` RESPOINT=0 else echo "Usage: abplayer.sh /path/to/audiobook/dir/" exit fi mplayer -ss $RESPOINT $CPLIST > $HOME/.mplayer/abook.temp awk '/Playing/ {print $2}' $HOME/.mplayer/abook.temp > $HOME/.mplayer/abook.resume awk 'BEGIN{RS="\r"}{if ($1=="A:") t=$2}END{print t}' $HOME/.mplayer/abook.temp >> $HOME/.mplayer/abook.resume