AutoDj Sweetest Seen Fake or Real? for a good deal Free! Free! No Unexpected AutoPlay
  • We all recommend that you try and comment out the noise like this

                  #default = amplify(id="silence_src", 0.00001, noise())

                  well stop doing that as of now. Yes stop!

    You just need to include your autodj in the ls_script like this
    ( I am using /srv/backup/fallback/) to store my autodj script

        %include "fallback/autodj.liq" #this is the only line you need


    Benefits
    • You can now dictate when you want the playlist to start after say xsecs of silence (no more playlist just starting unexpectedly)
    • You can automate your script to be include when there is an update or whenever you chose (require a bash or python script)
    • You have minimal interaction of the script or changes
    • You can test any liquidsoap script you can find on google without any messy changes
    • It so sweet,make Airtime feeling like the greatest thing after slice bread and chicken

    So Here is what I want to achieve

    1. I am playing classic instrumentals genre so
    2. After 45secs of silence at 45db threshold
    3. or When nothing  is schedule
    4. My Auto playlist will play
    5. Make these values whatever you want like for most popular music 15sec @23db is sufficient.talk 60sec@45db and so on.(no hard and fast rule)
         even if a dj is disconnected in not just start a playlist) [use a transistion for smooth fade over],I mention that in many post

    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





    Post edited by Voisses Tech at 2014-09-08 18:07:36
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • 17 Comments sorted by
  • Hi, thanks for the script.

    I'm testing, but for the moment it ignores totally the max_blank value. It just does a second liquidsoap instance, which starts immediatly, at the middle of the song, when Airtime goes offline. The if it re-switch to Airtime, the first track is cut about 2 sec at begin.

    If I understand what you say, the 2nd liquidsoap should starts and stop "on demand" (when airtime goes off/on air)?

    This is my ls_script.liq :

    default = amplify(id="silence_src", 0.00001, noise())

    # AUTO DJ
    %include "autodj.liq"

    ref_off_air_meta = ref off_air_meta
    if !ref_off_air_meta == "" then
        ref_off_air_meta := "Airtime - offline"
    end
    #default = rewrite_metadata([("title", !ref_off_air_meta)], default)
    ignore(output.dummy(default, fallible=true))


    and my autodj.liq :
    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])

    Post edited by Quentin Divay at 2014-09-15 11:34:06
  • I'm trying to install this script, but it does not work for me.

    I think that liquidsoap did not recognize my music folder, could be this possible?
  • It now works! :D
    But first he had 777 permissions, and did not work, it's strange :/

    Thanks Voisses ;)
  • 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:


    • nights: {0h-6h]
    • morning: {6h-12h}
    • midday: {12h-18h}
    • afternoon: {18h-24h}


    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..

    Post edited by Bashatee Radio at 2015-03-02 18:18:50
  • However, i have a question.. using the fallback hack, airtime is constantly playing the default playlist (instead of silence), is there a way to start the liquidsoap script when silence is detected? this way i could add a jingle or station id at the beginning, instead of switching to the already running liquidsoap instance.

    Thanks in advance
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Tom, the link posted above should not have & on the end. This link works in the plain text emails sent by the forum, but not in the HTML view. For the latest version of the manual (Airtime 2.5) try:

    http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/media-folders/

    Cheers!

    Daniel
    Post edited by Daniel James at 2015-03-31 13:08:40
  • @Bashatee_Radio
    I tested this script and found out that
    • it can only apply to the storage folder
    • that folder has to be imported into Airtime
    • it also is not applicable to sub-directory especially if that directory lies outside the main storage folder rendering watched folder null

    Enlighten me on how to get this to iterate subdirectories

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Folks, while this script looks really good (thank you) it does not cover the m3u/pls creation. How can I create a m3u with all the files in my watch folder? Is there a simple step-by-step?

    Thanks!
  • I just go and Grab this script http://savonet.sourceforge.net/doc-svn/quick_start.html up to where its ready to play and now my empty script look like this


    ######################################Start##################################

    # Music
    myplaylist = playlist("~/radio/music.m3u")
    # Some jingles
    jingles = playlist("~/radio/jingles.m3u")
    # If something goes wrong, we'll play this
    security = single("~/radio/sounds/default.ogg")

    # Start building the feed with music
    radio = myplaylist
    # Now add some jingles
    radio = random(weights = [1, 4],[jingles, radio])
    # And finally the security

    # this is added
    #please watch for the period behind the numbers below they are float


    default = fallback(track_sensitive=false,[strip_blank(max_blank=45.,threshold=-45.,default),radio])

    #########################################END#####################################



    Post edited by Voisses Tech at 2015-02-15 12:27:36
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Just restart your script  and  you are good to go.(100% unlikely unless its different from the documents)
    If it do not work just remove the autodj content and you are back to a vanilla (clean) script.

    Just want something simple

    Conquer the noise to suit your self like this (line 153 -155)

              default = amplify(id="silence_src", 0.00001, noise()) #this is already there
             autodj=mksafe(playlist(mode="random","myplaylist"))
           default = fallback(track_sensitive=false,[strip_blank(max_blank=30.,threshold=-45.,default),autodj])

    Thats all Folks
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Final Thoughts

    • For those of you who doubt the power of these script,YOU ARE KIDDDDDDING YOURSELVES (Cry Babies)
    • For those who compare Airtime to Other Automated Software, You definitely should not be in radio,go do internet broadcast,Radio require constant upgrade.You do not know earlier days of like SAMS etc
    • For those of You who say Just another of the same,You are either Blind or need glasses
    • and for those of you critics not mentioned,With you the world would be still in the Dark Ages.
    • For those of you who want to change and share ideas with the world,lets shake hands,we are ready to go.I have an automated script,it readlines 153 and append it with the text as above.Every six months it does that and then restart the airtime liquidsoap.
    • I do not project that I will make any change before 6 months unless Airtime changes and its security related
    • I am willing later to share this script with you all should the new changes not incorporate something similar.

    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

    :))
    Post edited by Voisses Tech at 2014-09-08 18:10:35
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Q1. but for the moment it ignores totally the max_blank value.
    A. Yes it does.You cannot have anything schedule.I have tested it with blank files (created in audacity).You have to delete the last item in the Now playing and it will work.

    Q2.It just does a second liquidsoap instance, which starts immediatly, at the middle of the song, when Airtime goes offline.
    Q3.If I understand what you say, the 2nd liquidsoap should starts and stop "on demand" (when airtime goes off/on air)?

    A.Since these are the same question I will answer them both.There is no 2nd instance of liquidsoap,if you run the command ps -aux ,you will see that there is only one instance ( airtime ).Basically what it does is feed songs to play at all time through the liquidsoap,once the schedule goes off it checks for the silence then start playing whatever songs is prepared by Ls. and is currently in the queue.If you want to kick that song you need to employ a fallback skip and you could add a transistion with your station ident that any drop in signal will play your station id,or spot etc.(I only gave you the basic).

    Q4.if it re-switch to Airtime, the first track is cut about 2 sec at begin.

    A. This is subjective,
    • If your songs are mastered from originals,it will have a few seconds fade in and fade out so 2 seconds should not be of any noticeable
    • if you prepared your songs for ingestion you should have a fade in and fade out (see audacity)
    •  In the Ls_lib (airtime library script)  line 45 to 60 ,contains the fade and transistion for songs,line 61 -89 for Off-Air and for web-streams(including djs) are found in Line 396 to 413 but remember the default standard for fade in and fade out is 3sec.you could  create your own function or modify the existing function to please you.

    So you see those 2 sec issues might just be default conditions of the script.

    Now just three final thing

    1. media players buffers before they start play and direct outputs (alsa,pulse etc) are also affected by latency so its inevitable you will hear delays,the only true way to listen is at source.and what constantly is fed to the listener at the output
    2. I do not support major changes to Airtime application,it only confuse troubleshooting when you seek assistance.This is why I try to make the separation between both script.You can just comment out the one line and troubleshoot the airtime
    3. The Key to any smooth playing  is proper ingestion  Garbage in Garbage Out is still relevant

    VOISSES


    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Normally if your folder is not recognised its some form of permission rights.
    14.04 is very peculiar on how rights are assign and enforce

    You could
    • sudo chmod 775 /path/to/folder                    if its just a folder with files
    • sudo chmod 775 -R /path/to/main_folder      if you have many subfolder with files

    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

    • sudo chmod www-data:www-data

    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



    Post edited by Voisses Tech at 2015-01-28 19:48:17
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • @Bashatee Radio

    This

    http://sourcefabric.booktype.pro/airtime-23-for-broadcasters/media-folders/

      and the topic watch folders does just that and to create playlist  to uses in your script uses this https://gist.github.com/scarlson/944860
    one bash script for each genre.
    then you can use randomise (shuffle), random(pick one),or normal.

    watch folders pull the mp3 in the database

    Voisses
    Post edited by Voisses Tech at 2015-04-14 13:27:58
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • @Tim Ruth

    Fixed it also @Daniel_James did

    Like the script as it push me to something I want but still feel Airtime import script does a good job,still want to see the difference
    Post edited by Voisses Tech at 2015-04-14 13:31:57
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.