User Tools

Site Tools


Table of Contents

Play Sound

Added in version 8.1 build 884 3/12/15


  • play sound “name of sound file in sound folder”
    • volume optional, a number between 0 and 1. .5 is half volume. .01 is very quiet.
    • pan optional, a number between -1.0 and 1.0
    • output name optional, the name of an audio output device down which to send the sound
    • output id optional, the ID instead of the name of the output.


 play sound “STTNG beep.mp3” volume 0.5 pan 1.0 output name “display audio”


Place any audio files of any mac supported format into the “Sounds” folder which is created along side the XTension application on first startup, or if your XTension is running from the Applications folder it will be found inside the XTension Support folder created in your Documents folder. (XTension versions prior to 9.1 might have placed the XTension support folder in your Application Support folder.)

Sounds are not loaded on launch but are loaded the first time they are requested and are then kept around for future uses. Because they are cached in memory it’s best to keep them in compressed formats and of reasonable length.

Sounds may be played simultaneously down more than one output device but this will result in more than one copy cached in memory at a time.

Multiple sounds may be playing down the same interface at the same time.

To find the proper ID’s or names of available output devices use the “list available sound outputs” verb or look in the output section of your system preferences. The only complication here is if you have multiple devices of the same type and name. In this case you would want to use the ID as displayed in the list available sound outputs log output. However, there is no guarantee that these devices will not enumerate in a different order the next time you reboot. To get it as reliable as possible, reboot your Mac after adding all the devices and check the numbers again if you change their layout on the USB bus.

Given multiple outputs and control of the pan it’s possible to have several outputs with different alert tones being managed.

Airplay and bluetooth devices are also supported though there are bugs in Apple’s airplay implementation that may make it impossible to select an air play output. Still as of OSX 10.13.4 this has not been addressed and so you may not be able to use Air Play outputs reliably.

dictionary/human/playsound.txt · Last modified: 2023/02/13 14:52 by