Giter Club home page Giter Club logo

toddler-music-player's Introduction

Toddler Music Player

A music player for toddlers

The simplest user interface. Just press a button to listen a song.

tmplayer wiring

Hardware

  1. Raspberry PI 1 B+ (v1.2)
  2. Speakers USB powered
  3. Powerbank with 2 outputs
  4. Buttons with Leds (11)
  5. Resistors 330 (11)
  6. Box

Software

  1. DietPi for armv6l
  2. MPD
  3. Toddler Music Player

1. DietPi

OS Config

systemctl disable dietpi-postboot # fast boot

Packages

apt install build-essential python-dev python3.9-dev python-pip python3-pip

apt install vim git mpd mpc       # nothing works without vim
apt install openssh-sftp-server   # for trasnfering songs

export CFLAGS=-fcommon;
pip3 install RPi.GPIO             # python access gpio pins

Test

alsamixer
speaker-test
aplay aplay /var/lib/mpd/music/Dj_Goja_-_Cause_Im_Crazy.mp3

2. MPD

Install

apt install mpd

Configure

๐Ÿ’พ /etc/mpd.conf

music_directory      "/var/lib/mpd/music"
playlist_directory   "/var/lib/mpd/playlists"
db_file              "/var/lib/mpd/tag_cache"
log_file             "/var/log/mpd/mpd.log"
pid_file             "/run/mpd/pid"
state_file           "/var/lib/mpd/state"
sticker_file         "/var/lib/mpd/sticker.sql"
user                 "mpd"
bind_to_address      "localhost"
input {
        plugin       "curl"
}
decoder {
        plugin       "hybrid_dsd"
        enabled      "no"
}
decoder {
        plugin       "wildmidi"
        enabled      "no"
        #config_file "/etc/timidity/timidity.cfg"
}
audio_output {
	type             "alsa"
	name             "My ALSA Device"
	device           "hw:0,0"
	mixer_control    "Headphone"
}
filesystem_charset "UTF-8"
ixer_control       "Headphone"
}

Enable

systemctl status mpd
systemctl start mpd
systemctl enable mpd

Test MPD

# create playlist
ls -1 /var/lib/mpd/music/*.mp3 > /var/lib/mpd/playlists/main.m3u

# test playlist
mpc load main
mpc play

3. Toddler Music Player

Install

git clone https://github.com/vaidis/Toddler-Music-Player.git
mkdir /opt/tmplayer
cp Toddler-Music-Player/tmplayer.py /opt/tmplayer.py
chmod +x /opt/tmplayer.py

Startup

๐Ÿ’พ /etc/systemd/system/tmplayer.service

[Unit]
Description=TMPlayer
ConditionPathExists=/opt/tmplayer.py

[Service]
Type=forking
ExecStart=/opt/tmplayer.py
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
EOF

Enable

systemctl daemon-reload
systemctl status tmplayer
systemctl start tmplayer
systemctl enable tmplayer

tmplayer

toddler-music-player's People

Contributors

vaidis avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.