This PAL script is designed to play short liners over the intros of music tracks. You should ensure the constant declaration "LINERS_CATEGORY" is set to a category below your Station ID section within your playlists. You can also adjust the number of tracks between liners played as well as the volume. This script lowers the volume of the music track whilst raising the volume of the liner for better impact. The volumes are restored when the liner has played.
This is designed for 8 second liners but this can be adjusted.
// Create a new category under the Station ID section which matches the const LINERS_CATEGORY // Add at least 7 voice only files that are 8 seconds or less into that new category // Change WaitCount Const to the number of tracks that must play to trigger the liner}
const LINERS_CATEGORY = 'ChangeMe'; // Change this to the name of the required category const WaitCount = 2; // Set the number of tracks to wait before playing Intro const LoudVol : integer = 350; // Set the Loud volume level here const LowVol : integer = 100; // Set the low volume level here var Player3 : TPlayer = aux1; // Declare an instance of TPlayer for the Aux1 Player var CurrentActiveVol, CurrentAuxVol : Integer; // Record the normal volume levels var Liner, Song3 : TSongInfo; var CurCount : Integer = 0;
PAL.Loop := True;
Liner:= CAT[LINERS_CATEGORY].ChooseSong(smLemmingLogic,EnforceRules);
if (Liner=nil) then WriteLn('Please add voiceovers to the category') else if not (Player3.QueueSong(Liner)) then WriteLn('Failed to load voiceover: '+Liner['filename']);
while CurCount < WaitCount do begin if (ActivePlayer<> nil) then begin Song3 := ActivePlayer.GetSongInfo(); if Song3['songtype'] = 'S' then begin CurCount := CurCount + 1; WriteStr('Normal song detected. Waiting... '); WriteLn('('+IntToStr(CurCount)+'/'+IntToStr(WaitCount)+')'); end else WriteLn('SongType skipped: '+Song3['songtype']); end else WriteLn('Warning: Active player not detected!?'); PAL.WaitForPlayCount(1); end; Song3.Free;
// Playing the Liner PAL.LockExecution; CurrentActiveVol := ActivePlayer.GetVolume; // Record the active player volume CurrentAuxVol := Player3.GetVolume; // Record the aux player volume ActivePlayer.Volume := LowVol; Player3.Volume := LoudVol; // Raise the volume of the AUX1 player Player3.Play; // Play the liner WriteLn('Playing liner: '+Liner['filename']); PAL.WaitForTime('+00:00:08'); // Alter this if your liners are longer or shorter than 8 seconds ActivePlayer.Volume := CurrentActiveVol; {Restore the active player volume} Player3.Volume := CurrentAuxVol; PAL.UnlockExecution;
|
The PAL script is available to download.
Comments