Jump to content


Photo

[Rebirth Competition] Pstorytime - Console audiobook player

audiobook python rebirth pstorytime

  • Please log in to reply
7 replies to this topic

#1 OFFLINE   ankan

ankan

    Newbie

  • Members
  • Pip
  • 5 posts
  • Local time: 02:15 PM

Posted 05 March 2012 - 03:52 PM

Let me introduce to you Pstorytime.

A while before the pandora rebirth competition went live I started working on an audiobook player that behaves the way I want. This is the result. Since the competition started I thought I'd release it as an entry. The intention has always been to run this on my pandora, though I haven't received mine yet. It should all work equally well on any other GNU/Linux device (so far only tested on Debian Squeeze.)

This is a general console application and is not directly connected to any shoulder buttons or such. But pstorytime can be controlled by writing commands to a pipe, so if you can find a program that listens for those buttons and runs custom commands you are ready to go.


pstorytime
----------
pstorytime is a logging console audiobook player based on gstreamer with a
curses interface. It stores all events like play, pause and seek together with
walltime, filename and position in file. It also autosaves the position while
playing to recover from crashes without loosing the position. This allows the
user to retrace his/her steps and minimizes the risk of getting lost.
 
Furthermore, it treats all files as a continuous stream so that seeking can be
made seamlessly between different files.
 
Dependencies
------------
* python    - Only tested with python 2.
* argparse  - Included in python >=2.7 and >=3.1.
* pygst 	- Python gstreamer bindings.
* gstreamer - Including any codecs which you wish to be able to use.
 
Installation
------------
> python setup.py build
> sudo setup.py install
 
License
-------
GNU General Public License: [url="http://www.gnu.org/licenses/gpl-3.0.txt"]http://www.gnu.org/l...ses/gpl-3.0.txt[/url]

And a few screenshots.

Attached File  manualseek.png   9.72K   103 downloads
You can enter a position to seek to, or a distance to seek. (In this case 10 minutes forward.)

Attached File  select.png   9.72K   123 downloads
Or select a position you have already been at and seek there.

Attached File  fileseek.png   9.66K   90 downloads
Or seek to a certain file. In this case to 1 hour and 30 minutes into that file.

And some help output (which happens to be quite a lot to read.)

Spoiler


Edit: The forum has obviously messed up the formatting a bit. The real thing looks better.



#2 ONLINE   Wrath of Khan

Wrath of Khan

    Viking woman she make you cry!

  • Supporter
  • 2772 posts
  • Local time: 02:15 PM
  • LocationIreland

Donator

Posted 05 March 2012 - 04:22 PM

Nice
The world is your Oyster,just dont let it Clam shut.

#3 OFFLINE   pmprog

pmprog

    www.pmprog.co.uk

  • Members
  • PipPipPip
  • 1571 posts
  • Local time: 02:15 PM
  • LocationCheshire, UK

Posted 05 March 2012 - 04:31 PM

What does "logging" mean in this context?

pstorytime is a logging console audiobook player


pmprog.pngpandora.pngbutton-small.pngtournamenthub.pnggithub.png

#4 OFFLINE   ankan

ankan

    Newbie

  • Members
  • Pip
  • 5 posts
  • Local time: 02:15 PM

Posted 05 March 2012 - 08:44 PM

What does "logging" mean in this context?


That every time you start playing, pause, seek etc an entry is added to a play log (as seen in the first two screenshots.) This log contains walltime, what happened and position in the audiobook stream. This log is saved in a file and loaded the next time you open that audiobook. You can easily backtrack if you happen to fall asleep while listening. The program can tell you when you pressed play most recently.

If your machine crashed the last time you were playing a log entry is available for the last time an autosave took place. At which point you know around when that crash took place. This is different from the single position in each file (or audiobook depending on program) that is usually stored. So if you by accident happen to seek to the beginning of the file without remembering where you were, it is easy to find your way back without a tedious manual search through a file that can be over ten hours long.

It is also possible to figure out what you were listening to at a certain time if you so wish.

#5 OFFLINE   pmprog

pmprog

    www.pmprog.co.uk

  • Members
  • PipPipPip
  • 1571 posts
  • Local time: 02:15 PM
  • LocationCheshire, UK

Posted 06 March 2012 - 08:11 AM

Thanks
pmprog.pngpandora.pngbutton-small.pngtournamenthub.pnggithub.png

#6 OFFLINE   Gruso

Gruso

    Advanced Member

  • Members
  • PipPipPip
  • 1729 posts
  • Local time: 12:15 AM
  • LocationSyd, Aus

Posted 06 April 2012 - 01:32 AM

I like the look of this. I don't listen to a lot of audiobooks, but I wonder if this would also function well as a more general purpose audio player? Not that we're starved of audio players on the platform, but your logging implementation sounds cool. That in conjunction with gapless playback (assuming it does that) could be very handy for live/DJ sets, mix compilations etc.

Unfortunately I'm not able to get it running. I've successfully run the first two commands in the readme (python build & install) but I'm unsure where to go from there. Do I need to install that opkg stuff as well, or is that just in there for reference?

Perhaps someone could team up with you to create a PND. Or, hopefully, you'll get your hardware before too long.
FAQs: Pandora | PND files | USB

#7 OFFLINE   ankan

ankan

    Newbie

  • Members
  • Pip
  • 5 posts
  • Local time: 02:15 PM

Posted 07 April 2012 - 12:29 AM

I like the look of this. I don't listen to a lot of audiobooks, but I wonder if this would also function well as a more general purpose audio player? Not that we're starved of audio players on the platform, but your logging implementation sounds cool. That in conjunction with gapless playback (assuming it does that) could be very handy for live/DJ sets, mix compilations etc.

Unfortunately I'm not able to get it running. I've successfully run the first two commands in the readme (python build & install) but I'm unsure where to go from there. Do I need to install that opkg stuff as well, or is that just in there for reference?

Perhaps someone could team up with you to create a PND. Or, hopefully, you'll get your hardware before too long.


Hello Gruso, and thank you for your interest. I am happy to help out.

You are most likely missing some dependencies. So yes, you will have to run some of the opkg-commands and follow the other instructions. Since build and install worked, you already seem to have python-setuptools, which I didn't. But you will need the others. The pandora-specific instructions in the readme are what I had to do to make it run on my own fresh-from-factory pandora.

I guess I could create a PND, but from what I have seen a PND is intended to be an image containing a program and dependencies that is mounted when a program is started. The program is uninstalled by removing the PND-file, that could be stored anywhere. But how should this work together with a console application? One possibility is to mount and start a terminal with the program in the path, you need shell access to specify which audiobook to load. But this doesn't really sound like a good idea, it kinda gives me the itch. It would be better if it is accessible from any terminal.

The other option is to provide a PND installer, but this would have to automatically modify the firmware in the way described in the readme. It is also hard to provide any sane way of reverting the changes made by the installer, since the dependencies could be used by other programs. Sure, the instructions from the readme could also be used by a power-user uninstall it.

Are there any other programs using a PND as an installer in this way? That is, programs less mainstream than the community codec pack which is at least semi-official.

Is it a good idea to start releasing PNDs that does this, or is there any other way of using a PND that is more suitable to console applications? I am really new to pandora and Ångström in general, though I do have experience from other distros.

#8 OFFLINE   mcobit

mcobit

    Does this thing work?

  • Members
  • PipPipPip
  • 4528 posts
  • Local time: 03:15 PM
  • LocationFrankfurt a.M., Germany

Donator

Posted 07 April 2012 - 09:35 AM

Just lauch a console from the startupscript with your application :)

Maybe add a loader for audiobooks.

Edit: An installer isn't really needed here I think.

Edited by mcobit, 07 April 2012 - 09:36 AM.




Also tagged with one or more of these keywords: audiobook, python, rebirth, pstorytime

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users