soundduration(
IDENTIFIER
)

The soundduration( function returns the duration (in seconds) of the specified playing sound.


Parameters

This function has one parameter:

identifier – identifier for the sound (sound must already be playing).


Description

This function returns the duration (in seconds) of the specified playing sound. This example code starts playing a sound and then displays a notification with the duration of the sound.

playsound "~/Sounds/Big Ben Chime.aiff","IDENTIFIER","Chimes"
nsnotify pattern(int(soundduration("Chimes")),"# second~")

Note: The duration is a floating point number, so it can be a fractional value. (The example code above rounds the duration down to a whole number.)


See Also


History

VersionStatusNotes
10.2NewNew in this version.