Simple way to play a sound

Posted on
Wed Jan 13, 2016 3:56 pm
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Simple way to play a sound

I have speakers connected to the Mac running the Indigo Server. I would like to play a sound when triggered. How can I accomplish this?

Thanks in advance for any help.

Posted on
Wed Jan 13, 2016 4:23 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Simple way to play a sound

Lot's of ways but one simple solution is an AppleScript.

Code: Select all
Open this Scriplet in your Editor:
do shell script "afplay '/System/Library/Sounds/Hero.aiff'"


Just replace the path and sound file info to what you'd like.

Carl

Posted on
Wed Jan 13, 2016 8:07 pm
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Re: Simple way to play a sound

Thanks Carl. That worked. Much appreciated.

Posted on
Fri Apr 15, 2016 2:35 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Simple way to play a sound

I can shorten that script for you.

In AppleScript:

Code: Select all
beep
:D

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Fri Apr 15, 2016 3:25 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Simple way to play a sound

Of course, that would only play whatever you have selected as the system beep/alert sound. The approach further up allows you to play any sound that's installed on your Mac... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests