Automatic air alert

You have a question or need an advice about how to do something? Ask it here!
Ihor Mudrak
Posts: 24
Joined: 02 Feb 2022 22:52
Automatic air alert

Post by Ihor Mudrak »

Hello, is there any way to automatically turn on sound notification about air alert (start/end of the alert) on the radio?
We have open API which sends information about start end end of air alert. Is there any way to integrate some script in ProppFrexx on air with it?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Automatic air alert

Post by radio42 »

It sounds, like you would like to play a certain 'sound' when an event occurs what you call an 'air alert'?!
I.e. you want to trigger to play a sound when your external event happens?!

Note, that ProppFrexx has a quite simple TCP/IP interface which you can use to send external control-commands to ProppFrexx.
This interface is explained here: viewtopic.php?p=21#p21

With these control-commands you can remote control most of ProppFrexx functions, like stop a playlist, mute or unmute mixer as well as play files (sounds).
E.g. you can use the following commands to play any audio file directly to the output mixer OUT1 - this is a fire and forget play back mode:

Code: Select all

EXEC_PLAY_FILE C:\Temp\test.mp3|OUT1
Here is another use case using the EXEC_DIRECTPLAYER_... commands: EXEC_DIRECTPLAYER_CREATE

I hope, that this matches your needs. I.e. you simply need to implement the simple TCP/IP/text interface in your notification/system.
If you do not know how to do this, you can even use the ready made command-line tool called "pfremcmd". This is command-line tool which you can execute directly. A use-case is explained here: viewtopic.php?p=1455#p1455
Ihor Mudrak
Posts: 24
Joined: 02 Feb 2022 22:52
Re: Automatic air alert

Post by Ihor Mudrak »

We continue to research the ability to launch air alert in the air of our online radio.

After Proppfrexx on air is launched, according to the task in the scheduler, the playback of the playlist with jingles starts.

How, using remote control commands (API), to urgently play a separate audio file located on the server, but not part of the playlist (media library), and after the announcement of the alert is completed, to continue playing the current playlist?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Automatic air alert

Post by radio42 »

It works as explained above! What exactly is NOT working?
See the TCP/IP interface as explained in the link above.
The command to execute (as an example) independent of the playlist is also shown above (EXEC_PLAY_FILE) - the location given is the path on the server.

What is missing?
Ihor Mudrak
Posts: 24
Joined: 02 Feb 2022 22:52
Re: Automatic air alert

Post by Ihor Mudrak »

We send TCP commands in packets, in this writing mode it does not play any sound or notification does not show:

Code: Select all

AUTHORIZATION r24

EXEC_PLAY_FILE C:\MediaLibrary\Alarm\Test.mp3|OUT1

SHOW_ALERT_WINDOW Online|Test!
in this case:

Code: Select all

AUTHORIZATION r24

SHOW_ALERT_WINDOW Online|Test!

EXEC_PLAY_FILE C:\MediaLibrary\Alarm\Test.mp3|OUT1

It shows a notification but does not play the sound anyway.

Instead of OUT1, we already wrote all the names of the output devices that are in the settings.

Music plays on a virtual server in streaming mode to a web server. May be this type of playback we should specify another "output device"?
Attachments
we have RFL activated
we have RFL activated
on the mixer, the sound jumps on all "devices"
on the mixer, the sound jumps on all "devices"
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Automatic air alert

Post by radio42 »

On the screenshot your output mixer is called OUT and not OUT1. But in the command example you use OUT1.
Else make sure, the path and filename exists on the server!
Ie. you do not reference a client file, but in the server, ie. where the command is executed.
Ihor Mudrak
Posts: 24
Joined: 02 Feb 2022 22:52
Re: Automatic air alert

Post by Ihor Mudrak »

The file with alert is played, but it is played in the same time with the playing music on the air.

We need to pause the music, play the file with alert and then resume playing the playlist.

There are a lot of commands in the documentation, and due to the specifics of their description, it is not clear which ones we need to complete this task.

Could you please help us which commands should we use in our case?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Automatic air alert

Post by radio42 »

Now I understand your requirement. This can be achieved with the EXEC_DIRECTPLAYER_... commands (see docs).
E.g. the following command sequence would pause the playlist, play the file and at the end resume the playlist (you could also mute the PLAY mixer channel) while playing the file... In this example, the Direct-Player is created using the name 'Alert'. This is needed to identify it in sub-sequent commands:

Code: Select all

ASYNC
PLS_CURRENT_PAUSE_CURRENT 1000
EXEC_DIRECTPLAYER_CREATE Alert|C:\MediaLibrary\Alarm\Test.mp3|OUT
EXEC_DIRECTPLAYER_ONTRACKEND Alert|PLS_CURRENT_PLAY_CURRENT
SLEEP 500
EXEC_DIRECTPLAYER_PLAY Alert|false|0.0|0
What the code does:
1. ASYNC:
All susequent comamnds execute in its own thread to not block any other commands (only needed because of the SLEEP command).

2. PLS_CURRENT_PAUSE_CURRENT 1000
We fade out (for 1 sec.) and pause the current player in the current playlist.

3. EXEC_DIRECTPLAYER_CREATE Alert|C:\MediaLibrary\Alarm\Test.mp3|OUT
We create a DirectPlayer named Altert using the given file and use the output mixer channel OUT.

4. EXEC_DIRECTPLAYER_ONTRACKEND Alert|PLS_CURRENT_PLAY_CURRENT
We inject the command PLS_CURRENT_PLAY_CURRENT to the DirectPlayer to be executed when the playback ends. This command will actually resume the playlist, when the altert file ends.

5. SLEEP 500
We wait a little for the above fade-out, so that the DirectPlayer doesn't start immediate, but have a nicer segue.

6. EXEC_DIRECTPLAYER_PLAY Alert|false|0.0|0
Now we really start playing the DirectPlayer, i.e. the alert file. Not looping, no attenuation and no fade-in.
Ihor Mudrak
Posts: 24
Joined: 02 Feb 2022 22:52
Re: Automatic air alert

Post by Ihor Mudrak »

We put
1Знімок екрана 2023-04-11 160429.jpg
1Знімок екрана 2023-04-11 160429.jpg (11.24 KiB) Viewed 1939 times
and it just switches between A to B track
1Знімок екрана 2023-04-11 160429.jpg
1Знімок екрана 2023-04-11 160429.jpg (11.24 KiB) Viewed 1939 times
may be we have some problem with playlist?

then we run command on play/pause
3Знімок екрана 2023-04-11 160736.jpg
3Знімок екрана 2023-04-11 160736.jpg (9.1 KiB) Viewed 1939 times
with command ASYNC at the beginning and nothing is happening.

then we are running the script as you told without ASYNC

Image

it just changes the track but if we run

Image

everything plays OK

The problem is that nothing happens at all with ASYNC, and if without it, then just the tracks changes, the file with alert does not play at all :(
Attachments
2Знімок екрана 2023-04-11 160555.jpg
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Automatic air alert

Post by radio42 »

No quotes (“) at all.
No empty lines.
When using internally commands with events, the AUTHORIZATION line is not needed and not supported.
The ASYNC command must be the first line.

Post Reply