So Here is what I want to achieve
so line
153 default = amplify(id="silence_src", 0.00001, noise())
154 %include "fallback/autodj.liq" #this is the only line you need
########################### END #######################
I am storing my fallback folder in /srv/backup/fallback/ not in the Airtime main folder should there be an upgrade
so now just link the folder to your Airtime scripts folder
sudo ln -s /path-to-my-folder/ /path-to-airtime-script-folder/
thats it done ,done done.
Oh you must realized its an empty autodj.liq file
so lets go grab a script and let it play
music = playlist(mode='randomize',reload=3600,reload_mode="watch","/media/musique/1-Musiques Electroniques")
jingles = playlist(mode='randomize',reload=1,reload_mode="watch","/media/musique/4-Radio/Jingles")
jingles = delay(1.,jingles)
rotation = rotate(weights=[1,20],[jingles,music])
default = fallback(track_sensitive=false,[strip_blank(max_blank=15.,threshold=-45.,default),rotation])
Regarding the permissions, i was also having this error:
[request:3] Read permission denied for "/srv/airtime/stor/imported/1/route_to_audio_fle"
It was a permission problem so I solved it by: chown -R pypo:www-data /srv/airtime/store/imported/
But now, another improvement for a better AutoDJ. I use the field mood for tagging the music uploaded to airtime based on the time of the day, so for example:
so, for example, if a song is very "noisy", we would like to play it only during the day, then i would tag the mood field like "morning,midday,afternoon", in case it is very quiet then i may only tag it like "night".
Then, i was creating offine linked shows and feeding them with a smart list, but this was not really good, because if a new song was added (and tagged properly), i had to feed again the offline shows for the song to be added by the smart block (as you know, once you fill a show with a smart block in a linked show, it generates the content on the following shows at that moment). So I decided to create a php script that would create m3u playlists that I could use in my autdj script. Then, create a cron job so that every night, the playlists gets recreated with the new items in it. It can probably be improved, but it's just a start.
This is the code:
>?php
define('PLAYLIST_PATH', '/srv/airtime/stor/playlists/');
define('AIRTIME_STOR_FOLDER', '/srv/airtime/stor/');
// Connecting with postgresql database
$dbconn = pg_connect("host=localhost dbname=airtime user=airtime password=airtime")
or die('Could not connect: ' . pg_last_error());
// Creating lists:
create_list('night');
create_list('morning');
create_list('midday');
create_list('afternoon');
create_list('jingles');
// Cerrando la conexión
pg_close($dbconn);
function create_list($name) {
if ($name == 'jingles') {
$query = "SELECT length, artist_name, track_title, filepath FROM cc_files WHERE (genre LIKE '%kuñak%' OR genre LIKE '%cuñas%' OR genre LIKE '%kuinak%') AND (mood!='ezgaituta')";
} else {
$query = "SELECT length, artist_name, track_title, filepath FROM cc_files WHERE mood LIKE '%".$name."%'";
}
$result = pg_query($query) or die('La consulta fallo: ' . pg_last_error());
$m3u_cnt = "#EXTM3U\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo "Trying to add file '".AIRTIME_STOR_FOLDER.$line['filepath']."'\n";
$filepath = realpath(AIRTIME_STOR_FOLDER.$line['filepath']);
if (file_exists($filepath)) {
sscanf($line['length'], "%d:%d:%d", $hours, $minutes, $seconds);
$length_seconds = isset($seconds) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes;
$m3u_cnt .= "#EXTINF:".$length_seconds.",".$line['artist_name']." - ".$line['track_title']."\n";
$m3u_cnt .= $filepath."\n";
} else {
echo "Problem file: ".AIRTIME_STOR_FOLDER.$line['filepath']."\n";
}
}
file_put_contents(PLAYLIST_PATH.$name.'.m3u', $m3u_cnt);
pg_free_result($result);
}
?>
The script is using the meta mood, but of course it could be adapted to get files based on the genre, etc..
Enlighten me on how to get this to iterate subdirectories
Love Airtime
"Knowledge is not Gain by having someone do everything for you and a child will not walk if you walk for them"
VOISSES
So you see those 2 sec issues might just be default conditions of the script.
Now just three final thing
VOISSES
You might have use 777 but test
If your folder is located in /srv/ or /var/www/path/to/folder/ then you need to change the group ownership to
www-data (pypo is a member of this group
In any other case you need give an synopsis(outline or summary) of your script because your question is vague by not saying what do not work
if you have Airtime Version <=2.5.1.6 you could post your airtime-check-system (remove private information) and its best you do it before its all gone
VOISSES
It looks like you're new here. If you want to get involved, click one of these buttons!