Say Time

This will read the time out every xxx minutes. That’s up to you. It also relies on having 5 tracks in the queue. IMPORTANT

It also needs the time sound files, available in this archive.
[ddownload id=”152″]

{ Comments:
  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
  have the attachement from the KB. Times.zip  Point your script to where
  you put them.
  
  
  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!
  

}



//function ActivePlayer:TPlayer; forward;
PAL.Loop := True;

const TimeHeader  : String = 'F:\My Documents\RadioDaze\Times\';
const TimeHours   : String = 'F:\My Documents\RadioDaze\Times\Hours\';
const TimeMinutes : String = 'F:\My Documents\RadioDaze\Times\Minutes\';
const MyGMTZone   : Integer = +8;

var P1, P2 : TPlayer;
var i : integer;
var Song : TSongInfo;
var Done : Boolean = False;

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;

    P2 := Aux1;
    
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));

    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);

       fname := 'Header.mp3';

Queue.AddFile(TimeHeader+fname,ipBottom);
Queue.AddFile(TimeHours+fnamehh,ipBottom);
Queue.AddFile(TimeMinutes+fnamemm,ipBottom);
//PAL.WaitForTime(T['+00:00:05']);
 PAL.WaitForTime(E);
 PAL.WaitForTime(T['+00:01:00']);
 PAL.WaitForQueue(5);
 N := N+1;
end;

function ActivePlayer:TPlayer;
begin
if DeckA.Status = psPlaying then
Result := DeckA
else
Result := DeckB;
end;

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload CAPTCHA.