Hi All,
I have a case that is driving me crazy. It sounded like an easy pie but
when I tried to implement it I got a lot of difficulties.
The requirement is as follows:
1) There are certain programs that have to get aired at certaint times. The
details are not really important, but let's say:
1.1) There is a program P0 that lasts 45 minutes more or less.P0 must be
emmited at 8:00, 12:00, 16:00 and 20:00
1.2) There are 4 other programs, P1, P2, P30 and P31 that are between 4 and
10 minutes long.
P1 must go on air every hour, except when P0 is in air, starting at minute 0
P2
P2 must go on air every hour at minute 20, except when P0 is on air
P30 and P31 must go on air at minute 40 every hour. P30 from 08 to 14; and
P31 from 15 to 24
2) When no program is emmiting, the normal stream must play:
2.1) Every 10 minutes, the Radio jingle must air
2.2) The rest of the time, music must be played
2.3) From 8 to 22, we need Newage music on air. From 22 to 08 we need
Classical music on air
2.4) Doesn't matter if the radio jingle breaks the music.
2.5) The Music must NEVER interrupt the programs
2.6) The programs MUST go on air at the scheduled times even though some
music is playing.
So, starting from the bottom, I created schedules for the music (newage and
classical) and a schedule for them.
I created a delay for the jingle and then, I built a fallback to play the
jingle, and, if it silent, the music.
So far, if I output the music, it works great.
Then, I created a schedule for each of the programs and set a switch for
them which is track sensitive.
Finally, I set a fallback to play enything comming from the programs if
they are available and the normal stream (jingle and music) if not.
Here is the dilema: if I set the fallback to track_sensitive, sometimes the
start time for the progams happen during a song and, of course, it
continues playing. Normally the song ends one minute or two later and the
program is never played.
But, if I set the fallback to not track sensitive, the programs start at
the correct time BUT play for exactly one minute and the music comes back.
Can you advice how to solve my case?
This is the script:
set("log.file.path","/home/mee/radio/radio.log")
def crossfade(a,b)
add(normalize=false,
[ sequence([blank(duration=1.),
fade.initial(duration=1.5,b) ]),
fade.final(duration=1.5,a) ])
end
jingle = single("/home/mee/radio/Jingles/jingle.mp3")
P0 = single("/home/mee/radio/Programas/P0/P0_20160129.mp3")
P1 = single("/home/mee/radio/Programas/P1/P1_20170202.mp3")
P2 = single("/home/mee/radio/Programas/P2/P2_20170201.mp3")
P30 = single("/home/mee/radio/Programas/P3/P3_20170201.mp3")
P31 = single("/home/mee/radio/Programas/P3/P3_20170202.mp3")
newage = playlist.safe("/home/mee/radio/Música/NewAge", reload=300)
classical = playlist.safe("/home/mee/radio/Música/Clásica",
reload=300)
sch_P0 =({( 8h or 12h or 16h
or 20h ) and (00m) }, P0)
sch_P1 =({(0h-7h or 9h-11h or 13h-15h or 17h-19h
or 21h-24h) and (00m) }, P1)
sch_P2 =({(0h-7h or 9h-11h or 13h-15h or 17h-19h
or 21h-24h) and (20m) }, P2)
sch_P30 =({(0h-7h or 9h-11h or 13h-14h)
and (40m) }, P30)
sch_P31 =({( 15h or 17h-19h
or 21h-24h) and (40m) }, P31)
s_jingle = delay(id="jingle", 600.,jingle)
s_music = switch(id="music", track_sensitive=true,
[({8h-22h},newage),({22h-8h},classical)])
s_programas = switch(id="programas", track_sensitive=true, [sch_P0,
sch_P30, sch_P31, sch_P2, sch_P1])
playtime = fallback(track_sensitive=true, [s_jingle, s_music],
transitions=[crossfade,crossfade])
radio = fallback(track_sensitive=false, [s_programas, playtime],
transitions=[crossfade,crossfade])
output.icecast(%mp3,
radio,
host="localhost",
port=8000,
password="hackme",
mount="radio.mp3",
fallible=true)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users