![]() |
Re: aUDIOBOOK?
Quote:
Code:
sh /home/abplayer /home/test.mp3Btw, /home is not a good place to leave things. Better at /home/user, which is you user folder. |
Re: aUDIOBOOK?
I don't have mplayer, alas.
Try going to where abplayer currently lives, and Code:
pwd |
Re: aUDIOBOOK?
I use Media Player. What i'd like to do is stuff the book into a directory and have Media Player play the directory. It can't. But it can play from a play list. But it can't create play lists.
So i wrote this shell script, and run it from xterm. #!/bin/sh for i in $1/*.mp3 ; do echo `pwd`/$i >> $1.mp3 done I call it 'mkplaylist'. I have it on my root filesystem. Use chmod +x mkplaylist to make it executable. For example: cd /media/mmc2/Audio ls Eldest mkplaylist Eldest ls Eldest Eldest.m3u Then, use Open in Media Player, select Eldest.m3u from the list. On close, Media Player remembers the last track you played. Unfortunately, if you want to listen to something else, like a pod cast, you need to remember where you were in your book. I used to have mkplaylist on the SD card. And, the SD card was VFAT. So, i'd say: sh mkplaylist Eldest to get it to run (can't run stuff from VFAT). But now i use ext3 on my SD card, so this is moot for me. I have xmms installed. However, it sometimes drops the last few seconds of a track. No idea why or what circumstances. But i'll often use xmms to listen to other stuff. Media Player then remembers where i was in my book. I use mplayer to watch movies. But i use an iPod in the car, etc., because the buttons work one handed. |
Re: aUDIOBOOK?
Mediaplayer can make playlists, but I don't think it can auto-generate one from a directory.
Here's a simpler version, though: Code:
#!/bin/shNot quite equivalent to yours, as this wipes the playlist if it already exists; I think this is more useful, but if you wanted it to append, you can change > to >>, of course. Edit: Oh, by the way, ditch media player, use mpd and powerlaunch, and the N800's one-handed, too. Or write your own non-powerlaunch app (could even live in a terminal), just to intercept keypresses and call mpc, thus avoiding the complex generality of powerlaunch. |
Re: aUDIOBOOK?
Quote:
My scripting skills are not so good... but this script works %) Code:
#!/bin/shthanks. |
Re: aUDIOBOOK?
ok, so i got the original abplayer script to work. any ideas how i can get mplayer to show stats such as current position in audiobook mp3 while the script is running?
|
Re: aUDIOBOOK?
Quote:
Code:
mplayer -ss $resumepoint "$1"|awk 'BEGIN{RS="\r"}{if ($1=="A:") {t=$2;printf $0"\r" > "/dev/stderr"}} END{print t}' > "$1".resumeI use printf instead of print, because print always add a "\n" at the end, and this will result in a lot of lines printed. Using "\r", each line is overimposed on the previous one, and thus appears as a single line which updates itself. I print $0, which means "the whole line as it was read", but if you prefer, you can parse it a bit. You have the current position in seconds in variable $2, and the current position in format "HH:MM:SS.dd" in variable $3. The total time in seconds is in $5, and the total time in format "HH:MM:SS.dd" in $7. Finally, $8 holds the CPU usage (not very useful, I would prefer a current position as a percentage of total). You can use this information and build your own status line, such as: Code:
mplayer -ss $resumepoint "$1"|awk 'BEGIN{RS="\r"}{if ($1=="A:") {t=$2;printf "Position: %s of (%s %5.1f%% played\r", $3, $7, $2*100/$5 > "/dev/stderr"}} END{print t}' > "$1".resume |
Re: aUDIOBOOK?
Quote:
Anyway... Quote:
Code:
mplayer -ss $RESPOINT $CPLIST | awk 'BEGIN{RS="\r"}/Playing/{print $2}/^A:/{t=$2}END{print t}' > $HOME/.mplayer/abook.resume |
Re: aUDIOBOOK?
Quote:
i dont know, why, but in busybox this script dont work... so, here is for busybox: Code:
#!/bin/shLASTFILE=`cat $HOME/.mplayer/abook.resume | tail -n2 | awk -Fmp3 '{print $1}'` s/mp3/ogg/ and it will work... Quote:
|
| All times are GMT. The time now is 03:14. |
vBulletin® Version 3.8.8