The One Button Audiobook Player

This little Raspberry Pi based project is a gift for my wife’s grandmother for her 90th birthday. Being visually impaired, she is hard to entertain but loves to listen to audiobooks. The problem is, that she isn’t able to handle a ghetto blaster or MP3 player.

The solution to this problem was – tadaaaah – a one button audiobook player :)

It basically consists of:

  • 1 Raspberry Pi
  • 1 ModMyPi enclosure
  • 1 button
  • 2 resistors (330 Ohm, 10 Kilo-Ohm)
  • 1 blue LED
  • 1 (slow) 8GB SD-Card
  • some wire
  • a pair of speakers

The following software has been used:

The features are the following:

  • always on: When you power on the raspberry, it will boot up and start the python script with the audio book in pause
  • one button usage: The button pauses and unpauses the audio book or goes back one track when you press the button longer than 4 seconds
  • remembers position: It will always remember the last played position
  • only one audiobook: There will always be only one audio book on the Raspberry
  • easy audio book deployment: When you plug in a USB thumb drive with a special name/label, the Raspberry will stop playing, mount the thumb drive, deletes the old audio book, copies the new one, rebuilds the playlist and – after unplugging the thumb drive – starts the new audiobook in pause mode
  • multi format: Since it uses mpd, the player supports  Ogg Vorbis, FLAC, OggFLAC, MP2, MP3, MP4/AAC, MOD, Musepack and wave

Some pics and a video:

 

(The audiobook used in this video is a free version of Cory Doctorows “Little Brother” from Fabian Neidhardt)

If you like to build your own one button audio book player, here are the super simple schematics:

And last but not least – the python script. The code might be crappy, please comment if you have improvements (especially regarding loadMusic). You can find it on github:

https://github.com/exitnode/theonebuttonaudiobookplayer

Update (2013-11-26)

Here’s what Russel wrote in a comment to this post:

“I just completed building this and have some addendum notes adding more details:

Install the following packages:
sudo apt-get install mpd
sudo apt-get install mpc
sudo apt-get install python-mpd
sudo apt-get install python-pyudev

(below assumes using defaults for /etc/mpd.conf)
sudo mkdir -p /music/usb
sudo ln -s /var/lib/mpd /music/mpd
sudo ln -s /var/lib/mpd/music /music/mp3

Copy the tobabp.py script to /home/pi
nano /home/pi/tobabp.py
Change these in the script or flip the connections in wiring diagram.
BUTTON = 17
LED = 24

Testing
Rename a USB stick to “1GB”
Copy 1 MP3 onto the stick
Insert the stick into pi

sudo mount /dev/sda1 /music/usb
sudo /etc/init.d/mpd stop
sudo rm /music/mp3/*
sudo cp /music/usb/* /music/mp3/
sudo umount /music/usb
Remove the USB stick

sudo rm /music/mpd/tag_cache
sudo /etc/init.d/mpd start
mpc clear
mpc ls
mpc ls | mpc add
sudo /etc/init.d/mpd restart
mpc play

Plug in earphones
You should hear audio
Next try the python script:
sudo python /home/pi/tobabp.py
Insert USB stick
the LED should flash and the USB file copy to /music/mp3/
the LED should flash again. Remove the Stick and LED flashes again.
Press button to start playing
Press button again to stop
Press & hold button to rewind to beginning.

sudo crontab -e
Add following line run at startup
@reboot python /home/pi/tobabp.py &
sudo reboot
Then retest again to be sure all is well.”

 

 

 

 

 

 

124 thoughts on “The One Button Audiobook Player

  1. Hi Ronaldo,

    To setup your AudioBook player you need to connect a keyboard.

    The final part of the installation is the “crontab” thing. Then each time you’ll boot your Raspberry pi, the audiobook will be launched automatically. So no need a keyboard after :)

    Adrien

  2. Pingback: Raspberry Pi One Touch Audiobook *Updated* | DL-UAT

  3. Completely new to this kind of stuff and this is perfect for my nearly blind grandmother. Cant find any easy step by step tutorial tho. Can anyone help? I have the raspberry pi B+, wires, led, button and resistors. The rest is totally greek to me. Hope for some help here.

  4. Pingback: 25 unglaubliche Raspberry-Pi-Projekte | t3n

  5. Great work !
    Thank you very much.

    I have a problem with long books. If I have a lot of tracks, i cant hear them after copy them to the raspberry pi. Do you have any idea why?

  6. Hi John Carley,

    I don’t know If you are still looking for one of these. But if you do, contact me : adrihebert @ gmail . com

    Have a good one,

    Adrien

  7. Father in law is recovering from stroke. Lost control of right hand and limited left hand dexterity. Found these posts looking for a way for him to live a little but I don’t think I’m tech enough to pull this off. Anyone willing to build and sell one ? Email me. Thx

  8. Hi Dominikus !

    Yes I have an idea ! I had the same problem.
    The key is to make a single file from all your chapters files.
    It’s not complicated on Windows. It’s just a few lines script.
    Send me an email at adrihebert @ gmail.com
    I will send you my little script :)

    Adrien

    PS: I some other people have this issue, feel free to ask me by email too

  9. Hi Kyle !

    Your email doesn’t appear ! Comment it if you want some help, or just email me (you will find my address in older comments).

    Adrien

  10. Pingback: Etwas für den Sonntag : Geniale Projekte für Raspberry Pi und Pi 2 ! | DER KLUGSCHEISSER

  11. Pingback: Simple Audiobook Player For Seniors And Blind People | Scott P Daugherty

  12. Hi,

    nice tutorial! I tried it the way from russel. But when I do mpc play, I get an “Error: problems opening audio device”.

    What could that mean?

    Thanks for help!

  13. I love this idea! We forget that for older people, tech can actually make their lives more inconvenient. Great idea for “back porting” tech for the elderly.

  14. Fantastic, worked first time. I do however wish I had read all the comments about the diagram GPIO label switch. That had me confused for a while.

    One thing I had misunderstood was the restart from where you left off function. I now see that it only remembers for as long as it stays powered.

    Many thanks

  15. I have a great Aunt (96 years old!) who loves those old radio shows (Fibber McGee, etc). I am thinking this type of machine would be neat if she could push a button and have one track (show) play, and then automatically stop. Then, the next time she would press the button, another track (show) would play, and then automatically stop, and so on. Do you all think this would work? Thanks so much, in advance! — David

  16. This thing is great. I want to pull my hair out when I try to teach my grandmother how to listen to music on her smartphone.
    I got this working but would like to add an option for fast forward. Does anyone know how to add a command so pressing it twice would make it skip to the next track?

  17. Hi,
    I’ve installed this on a RPi B with rasbian jessie.
    Whenever I press the button and the python script is running longer than a minute the script stopped with an error:
    Traceback (most recent call last):
    File “/home/pi/tobabp.py”, line 130, in
    main()
    File “/home/pi/tobabp.py”, line 112, in main
    if client.status()["state"] == “stop”:
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 167, in
    return lambda *args: wrapper(command, args)
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 213, in _execute
    return retval()
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 329, in _fetch_object
    objs = list(self._read_objects())
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 274, in _read_objects
    for key, value in self._read_pairs():
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 253, in _read_pairs
    pair = self._read_pair(separator)
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 244, in _read_pair
    line = self._read_line()
    File “/usr/lib/python2.7/dist-packages/mpd.py”, line 229, in _read_line
    raise ConnectionError(“Connection lost while reading line”)
    mpd.ConnectionError: Connection lost while reading line

    Do I need to somehow update the script to work with the actual release of mrd/mrc?

    Thanks
    Gunter

  18. Pingback: Raspberry Pi One-Button Audiobook Player – Raspberry Pi News

  19. Hi if anyone needs a talking book player with guiding voice and support for the DAISY 2.02-standard and the DAISY Online Delivery protocol, have a look at our open source solution at Kolibre.org. Images for Raspberry Pi model B and B+ available for download at https://github.com/kolibre/setup-scripts/releases. We will soon release support for RP 2 and Daisy 3.

    Books available at many national libraries and organisations for visually impaired and at archive.org. Over 2 million DAISY-titles are produced worldwide.

    We also provide an open source DAISY Online web service solution where users and publications can be added and streamed to the RP.

  20. Gunter P, I had the same problem. It’s caused by mpd, it stops after 60 seconds of inactivity. Sollution is to edit mdp config (sudo nano /etc/mpd.conf) and add line (connection_timeout “60″). Change 60 seconds to to 2, 10, 24 hrs. You could also add crontab entry (0 * * * * sudo /etc/init.d/mpd restart) to restart mdp every hour. Didn’t test it a lot, but it works for about an hour now and nothing bad happens. I hope it will help.

  21. Good evening. I did not see this posted (but may have missed it)… how do you address power? Must it remain plugged in to the wall or does the user need to change the battery?

    Second, how about volume control? My users will probably have a hearing problem as well as visual issues.

    I see this as a solution to our shut-in ministry for sermons. I’ll need to make sermons into “chapters” but otherwise it will work great. Thank you for posting this. ~DC

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>