Now I have the 2019.3 Build 66910 and I thought it was solved but I still get this issue.
(W10 1903)
On the song/podcast/ads change, SAM freezes also for 10-20 seconds.
Well, streaming is working and no interruptions, but any other activity of SAM are frozen.
It appears "not responding" ... then it returns alive.
The only one PAL script in action is the one is calling the website, passing a GET instruction to it.
What can causes this issue please?
Here the PAL script
Code:
PAL.loop := true;
{Declaration (Variables)}
var Player : TPlayer;
var Song : TSongInfo;
var statusmessage, returnmessage, picture, SongLabel, ipCheck, ipResult: String;
var ErrorLog, DebugLog : String;
const RADIO_DOMAIN : string = 'https://www.radioXXXXXXX.com';
const RADIO_SOCIAL : string = RADIO_DOMAIN + '/rd/repeater.php';
const ADDRESS : string = RADIO_DOMAIN + '/OnDemand/pictures/';
const M3U : string = '#EXTM3U' +#13#10;
const M3U1 : string = '#EXTINF: ';
const PATH_FILES : string = 'D:\RADIO\SAM-SONG.INFO\';
const AIR_PLAY_SONG : string = PATH_FILES + 'song.txt';
const WEB_RESPONSE : string = PATH_FILES + 'webresponse.txt';
const WEB_ARTWORK : string = PATH_FILES + 'artwork.m3u';
// Check the IP of SAM
ipCheck := RADIO_SOCIAL + '?myip=ip';
PAL.UnLockExecution;
ipResult := WebToStr(ipCheck);
WriteLn(ipResult);
PAL.LockExecution;
{Declaration (Functions and Procedures)}
// Construct the GET String for the Web Script, call it and return the output
FUNCTION update(status, picture : String) : String; forward;
PAL.WaitForPlayCount(1);
Player := ActivePlayer;
Song := Player.GetSongInfo;
//IF (Song <> NIL) AND (Song['duration'] > 10000) AND (Pos(Song['songtype'],'SAV') > 0) THEN
//BEGIN
// Is anything playing right now?
IF ( Player <> NIL ) THEN
BEGIN
//Song := Player.GetSongInfo;
IF Song['label'] <> '' THEN
SongLabel := '&label=' + URLEncode(Song['label'])
ELSE
SongLabel := '';
IF (Song <> NIL) AND (Song['duration'] > 10000) AND (Pos(Song['songtype'],'SAV') > 0) THEN
BEGIN
statusmessage := Song['title'] + ' - ' + Song['artist']; // Message to display in twitter
SaveStringToFile(AIR_PLAY_SONG,statusmessage); // Write AirPlay song
picture := Song['picture'];
IF Pos('jpg', picture) = 0 THEN picture := 'na.png';
SaveStringToFile(WEB_ARTWORK,M3U + M3U1 + Song['duration'] + ' ' + statusmessage + #13#10 + ADDRESS + URLEncode(picture)); // Write Artwork song
returnmessage := update(statusmessage, picture);
END;
END;
//END;
Song.Free;
Player.Free;
FUNCTION update(status, picture : String) : String;
var getStr, returnstr : String;
httpClient : THttpClient;
BEGIN
WriteLn(picture);
// URLEncode Blanks and Special Chars
status := URLEncode(status);
picture := URLEncode(picture);
getStr := RADIO_SOCIAL
+ '?message=' + status
+ '&picture=' + picture
+ '&title=' + URLEncode(Song['title'])
+ '&artist=' + URLEncode(Song['artist'])
+ '&songtype=' + Song['songtype'];
httpClient := THttpClient.Create(getStr);
// Here goes the magic!
httpClient.Get;
while not httpClient.ResponseReady DO Pal.WaitForTime('+00:00:01');
// HTTP Status Codes: 200 = OK, 404 = NOT FOUND, 403 = Forbidden, 500 = Generic Server error
IF httpClient.ResponseCode = 200 THEN returnstr := httpClient.ResponseData;
result := returnstr +#13#10;
WriteLn(result);
// Write response from PHP script
IF FileExists(WEB_RESPONSE) THEN
AppendStringToFile(WEB_RESPONSE, result)
ELSE
SaveStringToFile(WEB_RESPONSE, result);
END;