Audio Player from USB

language: Other
license: Other

Code for Snippet:

                
#!/bin/sh
 
# get rid of the cursor so we don't see it when videos are running
setterm -cursor off
sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/
amixer set PCM -- 100%
 
# set here the path to the directory containing your videos
VIDEOPATH="/mnt/" 
 
# you can normally leave this alone
SERVICE="omxplayer"
 
# now for our infinite loop!
while true; do
        if ps ax | grep -v grep | grep $SERVICE > /dev/null
        then
        sleep 1;
else
        for entry in $VIDEOPATH/*
        do
                clear
                aplay $entry
        done
fi
done
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 99
Date Added: 2017-07-05 17:36:31
Last Modified: 2017-07-05 13:15:41

Web Analytics