Skip to Content
It is currently May 27th, 2020, 6:51 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: May 22nd, 2020, 7:25 am 
Offline
New User
New User

Joined: April 15th, 2016, 1:19 pm
Posts: 7
i need help for simple pal script
i need to send command to start stream grabbing on aux, (1 using this stream to cast via ICAST my voice)
i send command via 1221 port to start this commande
i dont need to stop music, only drop volume when i sto finish talking i resend command to stop my stream
the music never stop and i can talk over my music from my cellphone
i have this, but i dont want music to stop, only drop volume

Code:
PAL.Loop := True;        //Repeat it to ensure remote show @ any time
PAL.WaitForTime('+00:00:15');
Queue.Clear;
PAL.WaitForEvent('livestart');         //waiting for the event "livefeed"
WriteLn('Now Going Live');        //just for you to know it triggerd
REPEAT
  Aux1.Volume := 285; // MUTE VOLUME
  Queue.AddURL('http://equinox.shoutca.st:9554/stream',ipTop);
  Aux1.Next;
  PAL.WaitForTime('+00:00:01');
  Aux1.Play;
  PAL.WaitForTime('+00:00:05');
// Check if the stream is still playing, otherwise restart
UNTIL Aux1.status = 0;

// Stream is playing, so we can set the volume back to normal
Aux2.Volume := 20;
Aux2.Volume := 40;
Aux2.Volume := 60;
Aux2.Volume := 80;
ActivePlayer.FadeToStop;
PAL.WaitForTime('+00:00:00:15');
Aux2.Volume := 100;
Aux2.Volume := 150;
Aux2.Volume := 200;
Aux2.Volume := 285;
// and stop the normal music
DeckA.Eject;
DeckB.Eject;


while (Aux1.Status = psPlaying) do
begin
  PAL.WaitForTime('+00:00:00:15');
end;
              PAL.WaitForEvent('stop');
if ActivePlayer = nil then
begin
      Begin
        DeckB.QueueSong(Queue.NextInQueue);
        DeckB.FadeToPlay;

      End
 End


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 7:41 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7968
Location: Aachen (Germany)
What exactly do you need help with? You already got all the parts in that script.
You're already adjusting the volumes of the Aux decks, apply that same logic to the playback decks and remove the Stop and Eject commands and you're done.

BTW: Your SAM version looks to be new enough to know about the Fade commands. You don't need to simulate a volume fade by hand, but can instead use FadeToVolume for a more refined effect (as it's not performing a hard little drop every second, but will instead perform a linear fade)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 7:48 am 
Offline
New User
New User

Joined: April 15th, 2016, 1:19 pm
Posts: 7
not sure what i have to remove, because i need the actual song continue to play


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 8:04 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7968
Location: Aachen (Germany)
This stops the player:
Code:
ActivePlayer.FadeToStop;


And this removes the loaded tracks causing the player to stop as a side-effect:
Code:
// and stop the normal music
DeckA.Eject;
DeckB.Eject;


Replace FadeToStop by FadeToVolume to lower the volume and remove the eject stuff. Or if you'd like a hard cut, just drop the volume immediately by assigning to the volume property.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 8:13 am 
Offline
New User
New User

Joined: April 15th, 2016, 1:19 pm
Posts: 7
is this correct ?

Code:
PAL.Loop := True;        //Repeat it to ensure remote show @ any time
//PAL.WaitForTime('+00:00:15');
//Queue.Clear;
PAL.WaitForEvent('livestart');         //waiting for the event "livefeed"
WriteLn('Now Going Live');        //just for you to know it triggerd
REPEAT
 // Aux1.Volume := 285; // MUTE VOLUME
  Queue.AddURL('http://equinox.shoutca.st:9554/stream',ipTop);
  Aux1.Next;
  PAL.WaitForTime('+00:00:01');
  Aux1.Play;
  PAL.WaitForTime('+00:00:03');
// Check if the stream is still playing, otherwise restart
UNTIL Aux1.status = 0;


while (Aux1.Status = psPlaying) do
begin
 // PAL.WaitForTime('+00:00:00:05');
end;
  //            PAL.WaitForEvent('stop');
if ActivePlayer = nil then
begin
      Begin
        DeckB.QueueSong(Queue.NextInQueue);
        DeckB.FadeToPlay;

      End
 End


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 8:17 am 
Offline
New User
New User

Joined: April 15th, 2016, 1:19 pm
Posts: 7
and drop at 50% the actual playing song, that what is missing ;-)


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 8:24 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7968
Location: Aachen (Germany)
Code:
while (Aux1.Status = psPlaying) do
begin
 // PAL.WaitForTime('+00:00:00:05');
end;

This isn't doing anything.

You probably need to add DeckA.FadeToVolume(50, 3000); and DeckB.FadeToVolume(50, 3000); (these drop the volume from whatever it was before to 50% over a time of 3000ms = 3 seconds => It takes 3 seconds to go from initial volume to 50%, but will stay at 50% after it's done)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 8:40 am 
Offline
New User
New User

Joined: April 15th, 2016, 1:19 pm
Posts: 7
This is the final script
i hope it's ok


Code:
PAL.Loop := True;        //Repeat it to ensure remote show @ any time
PAL.WaitForEvent('livestart');         //waiting for the event "livefeed"
WriteLn('Now Going Live');        //just for you to know it triggerd
REPEAT
  Queue.AddURL('http://equinox.shoutca.st:9554/stream',ipTop);
  Aux1.Next;
  PAL.WaitForTime('+00:00:01');
  Aux1.Play;
  PAL.WaitForTime('+00:00:03');

UNTIL Aux1.status = 0;
DeckA.FadeToVolume(50, 3000);
DeckB.FadeToVolume(50, 3000);

if ActivePlayer = nil then
begin
      Begin
        DeckB.QueueSong(Queue.NextInQueue);
        DeckB.FadeToPlay;

      End
 End


Top
 Profile  
Reply with quote  
PostPosted: May 22nd, 2020, 8:33 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7968
Location: Aachen (Germany)
Quote:
i hope it's ok

It's ok if it works :D

But honestly, looks good to me. No unneccessary code anymore and using the modern commands of SAM201x =D

Nice work.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group