Skip to Content
It is currently November 20th, 2019, 7:13 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Volume fading.
PostPosted: April 14th, 2018, 5:33 am 
Offline
Experienced User
Experienced User

Joined: April 10th, 2009, 3:16 am
Posts: 401
Hi i use this code to play overlay jingle
Code:
var next, Song, liner,Jingle : TSongInfo;
var Aux                      : Tplayer;
var volumedecka, volumedeckb, flag : integer;

volumedecka := DeckA.Volume;
volumedeckb := DeckB.Volume;


Song := ActivePlayer.GetSongInfo;

Song['filename'] := 'c:\Radio\Music Library\Fonoprint\Liners\BiondaeSuonato\JINGLE - Stai scoltando la replica dalla Bionda e il Suonato.mp3';
   
Liner := Song;
if Liner <> nil then Aux1.QueueSong(Liner);

Aux1.Volume  := 255 ;  // Set the Aux player volume

//liner := CAT['Jingles (All)'].ChooseSong(smRandom, NoRules);
Aux1.QueueSong(Liner);
       PAL.LockExecution;
            DeckA.FadeToVolume(20, 2000);
            DeckB.FadeToVolume(20, 2000);
            PAL.WaitForTime('+00:00:02');
            Aux1.Play;
       PAL.UnLockExecution;
            while Aux1.Status=0 do  // Wait for liner to finish
              begin
              end;
       PAL.LockExecution;
            DeckA.FadeToVolume(volumedecka, 500);
            DeckB.FadeToVolume(volumedeckb, 500);
       PAL.UnLockExecution;


When he first runs it, he lowers the volume of the song then plays it and then raises it but it takes too long to turn down the music and play the jingle..
Could you help me ??
I need a softly fading..Decrease volume song when start playing jingle and as soon as you finish playing the jingle, increase the volume.
I hope I was clear.

Regards, Stefano.


Top
 Profile  
Reply with quote  
 Post subject: Re: Volume fading.
PostPosted: April 15th, 2018, 12:08 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7882
Location: Aachen (Germany)
Code:
            DeckA.FadeToVolume(20, 2000);
            DeckB.FadeToVolume(20, 2000);
            PAL.WaitForTime('+00:00:02');

It's set to decrease the volume to 20% over 2 seconds / 2.000 milliseconds and wait 2 seconds before continueing with any other actions. (This doesn't add up, the 2 second wait and the 2 second downfade happen at the same time)

Obviously you can't go down to less than 1 second between fading and starting to play stuff, but you can fade the volume down even quicker (down to 1 ms)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Volume fading.
PostPosted: April 15th, 2018, 11:14 pm 
Offline
Experienced User
Experienced User

Joined: April 10th, 2009, 3:16 am
Posts: 401
You could tell me the right settings..??
Thanks a lot.. as usual.
Stefano.


Top
 Profile  
Reply with quote  
 Post subject: Re: Volume fading.
PostPosted: April 16th, 2018, 2:39 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7882
Location: Aachen (Germany)
In said section replace 2000 by 1000 and 2 by 1 (leave the 20 alone, though)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Volume fading.
PostPosted: April 16th, 2018, 2:51 am 
Offline
Experienced User
Experienced User

Joined: April 10th, 2009, 3:16 am
Posts: 401
Ok thanks now I try


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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