add dataoggi
one directory per day, play all files in it
This commit is contained in:
parent
c023462ef3
commit
a09f28b34f
2 changed files with 36 additions and 0 deletions
|
@ -25,3 +25,11 @@ audiobanner
|
||||||
Insert an audio content (the "banner") in another audio file every X seconds.
|
Insert an audio content (the "banner") in another audio file every X seconds.
|
||||||
|
|
||||||
This is useful, for example, to put "announcements" in a podcast.
|
This is useful, for example, to put "announcements" in a podcast.
|
||||||
|
|
||||||
|
dataoggi
|
||||||
|
---------
|
||||||
|
|
||||||
|
This script will list *all* audiofiles inside `$basedir/$today`
|
||||||
|
|
||||||
|
Suggestion: if you want to have more than 1 file, please list them prefixed with numbers.
|
||||||
|
|
||||||
|
|
28
dataoggi
Executable file
28
dataoggi
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# This script will list *all* audiofiles inside $basedir/$today
|
||||||
|
# Suggestion: if you want to have more than 1 file, please list them prefixed with numbers.
|
||||||
|
|
||||||
|
export LC_ALL=C # so that sorting order is table
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
baseDir=$1
|
||||||
|
|
||||||
|
is_audio() {
|
||||||
|
mimeType=$(file --mime-type --brief "$1")
|
||||||
|
if [[ "$mimeType" = audio/* ]]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cd "$baseDir"
|
||||||
|
cd "$(date +%Y-%m-%d)" # YYYY-MM-DD, like 1945-04-25
|
||||||
|
for file in * # this should be alphabetically sorted
|
||||||
|
do
|
||||||
|
if ! is_audio "$file"; then # non-audio is ignored
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo "file://$(realpath "$file")"
|
||||||
|
done
|
Loading…
Reference in a new issue