Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.
UPDATED:12/07/03 19:00 Saytime. After xx tracks play.
From SpacialAudio
This script started life as the USNews script. Thanks Elbert. I needed your input, or this could not have been done.
This script relies on having the associated TIME mp3 files. You should download the attachment below. Times.zip Point your script to where you put them.
I am having a few problems with SAM having a little hiccup each time it starts a track - not only these time ones. Hopefully your mileage is better.
So, unpack the time files, and put this in your PAL list, make the suitable adjustments, and every time you set it, this will say the time!
This script: Updated Sat. 12th July 19:03 EST. Works beautifully - even if I do say so myself...
function ActivePlayer:TPlayer; forward;
PAL.Loop := True;
const TimeHeader : String = 'E:\StationPromo\Times\header.mp3';
const TimeHours : String = 'E:\StationPromo\Times\Hours\';
const TimeMinutes : String = 'E:\StationPromo\Times\Minutes\';
const MyGMTZone : Integer = +10;
var C,N : Integer;
var fname : String;
var fnamehh : String;
var fnamemm : String;
var ampm : String;
var E : DateTime = Queue.ETA; // Return the length of the queues
var hh,mm,ss,ms : Integer;
N := 0;
while N < 24 do begin
DecodeTime(Now,hh,mm,ss,ms);
if (hh = 0) then hh := 24;
WriteLn('The Time Is '+IntToStr(hh)+':'+IntToStr(mm));
//WriteLn('Wait for 10 Minutes'); // Say time every ten minutes
//PAL.WaitForTime(T['+00:10:00']);
//PAL.WaitForPlayCount(1);
//DecodeTime(Now,hh,mm,ss,ms);
E := Queue.ETA; // You could even wait for the current
DecodeTime(E,hh,mm,ss,ms); // cue length of time to finish
if (hh <= 9) then
fnamehh := '0'+IntToStr(hh)+'.mp3' //get the right file name
else
fnamehh := IntToStr(hh)+'.mp3'; //get the right file name
WriteLn(fnamehh);
if (mm <= 9) then
fnamemm := '0'+IntToStr(mm)+'.mp3' //get the right file name
else
fnamemm := IntToStr(mm)+'.mp3'; //get the right file name
WriteLn(fnamemm);
WriteLn('SayTime at '+IntToStr(hh)+':'+IntToStr(mm)); // Just checking
//PAL.WaitForTime(E);
// you need to reverse the order, mm - hh - header, so that the header
// ends up in queuetop.
//Queue.AddFile(TimeMinutes+fnamemm,ipTop);
//Queue.AddFile(TimeHours+fnamehh,ipTop);
//Queue.AddFile(TimeHeader,ipTop);
//ActivePlayer.FadeToNext; // then fade to say the time.
Queue.AddFile(TimeHeader,ipBottom);
Queue.AddFile(TimeHours+fnamehh,ipBottom);
Queue.AddFile(TimeMinutes+fnamemm,ipBottom);
PAL.WaitForTime(E);
PAL.WaitForQueue(4); // wait till the queue fills again - 4 or more
// but what does it do in the even that
N := N+1;
end;
function ActivePlayer:TPlayer;
begin
if DeckA.Status = psPlaying then
Result := DeckA
else
Result := DeckB;
end;
