Stian Remvik Datagrafikk

Loop audio

Looping playlist script

You can use the same script as when looping video. Create a script named for example “audioplayer.sh”:

#!/bin/sh

Next line is the path to the audio files:

AUDIOPATH="/audiofiles/" 

The program we are using:

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 $AUDIOPATH/*
	do
		clear
		omxplayer $entry > /dev/null
	done
fi
done

Save the script, make it executable:

$ sudo chmod +x filename

and then run it as follows:

$ ./audioplayer.sh

More options can be added to the omxplayer. E.g. force audo out of minijack:

The line:

omxplayer $entry > /dev/null

can be replaced with

omxplayer -o local $entry > /dev/null
«Harmonic Connection», 2017 interactive installation
«Words Images Thought Objects», by Vilde Salhus Røed.
Mobile art app
«BITWaves2» mobile app
«Neightbours», 2014 installation
«Late into that night, and all the following nights»,
2013 installation by Asbjørn Hollerud
«Bergen Reads», 2013 interactive installation
«Cubes», 2013 animation
«Hush!», 2011 interactive installation
«The Sound of Pictures», 2010 installation
«The Mask», 2008 animation
secret