playing a sound for alerts

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

playing a sound for alerts

Postby t-rob » Thu Mar 03, 2016 5:09 pm

I'm need to play a short sound file as an alert for various situations as user feedback in my solution. What is the best approach for this? I see that I can add a sound file to the media section, but not sure how to actually trigger/play the sound.

I'm using Servoy 7.4.1 on Windows 7+ machines and Mac OS 10.8+
t-rob
 
Posts: 9
Joined: Tue Oct 27, 2009 5:51 pm

Re: playing a sound for alerts

Postby Bernd.N » Thu Mar 03, 2016 7:54 pm

application.playSound("media:///sounds/happyBirthdayFrankSinatra.wav");

So we created a subfolder 'sounds' in the media folder and stored the wav-file there.
On login, we check if the current user has birthday today (or last week) and play the song (in case he wants...), then we set a date on the user record so that this happens again only next year.
What we still need to implement is to play Marilyn's "Happy Birthday, dear President" for male users.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: playing a sound for alerts

Postby Harjo » Fri Mar 04, 2016 2:03 pm

:lol: :lol: :lol: :lol:
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: playing a sound for alerts

Postby Bernd.N » Fri Mar 04, 2016 3:01 pm

Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 7 guests

cron