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: 2425
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: 2579
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

Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP

Posted on
Fri Apr 15, 2016 3:25 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
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 1 guest