[Xastir] Bulletin received sound

David Ranch xastir at trinnet.net
Sun Aug 8 18:50:51 PDT 2021


Instead of calling "play_sound", why not make a system call to run a 
shell script?  Within the shell script, you can do anything you want be 
change the audio file it plays, wakes the display, sets of GPIO pin to 
light an LED, etc.

--David
KI6ZHD


On 08/08/2021 06:26 PM, Steve Huston wrote:
> I have a Raspberry Pi setup running Xastir, and use the "play sound
> effect" system to manually turn on the display when I receive a
> message.  When I get a message it calls a script I wrote that simply
> looks at the argument (.wav filename) and if it's "newmessage.wav" it
> turns off the screen blanking and unsets dpms to light up the display.
> This way without having the screen on all the time, it lets me know if
> I have a new message.
>
> I'd like this to work for bulletins as well, and quickly realized when
> looking at the source that adding a new config option for playing a
> certain message when a new bulletin is received is beyond my ability.
> What is within my ability, however, is copying the call for play_sound
> to the right place in db.c so that it uses the same "new message"
> sound when a bulletin comes in:
>
> diff --git a/src/db.c b/src/db.c
> index 4ccfd68a..78291e64 100644
> --- a/src/db.c
> +++ b/src/db.c
> @@ -18709,6 +18709,10 @@ int decode_message(char *call,char *path,char
> *message,char from,int port,int th
>     {
>       // fprintf(stderr,"found BLN: |%s| |%s|\n",addr,message);
>       bulletin_data_add(addr,call,message,"",MESSAGE_BULLETIN,from);
> +    if (sound_play_new_message)
> +    {
> +      play_sound(sound_command,sound_new_message);
> +    }
>       done = 1;
>     }
>     if (debug_level & 1)
>
> I'd submit this as a pull request, but it seems silly to fork the
> project to add four lines to it.  If you'd like me to, I will however.
> Or if you think there's a better way to do this, that's fine too.  Or
> if you think you don't want it at all, I'll keep hacking my local copy
> :D
>



More information about the Xastir mailing list