The [soundRef] command.
The soundRef command lets you create and manipulate sound objects in
The formal syntax of the [soundRef] command is:
soundRef subcommand ?options?
The possible subcommands are described below. Depending on the subcommand,
various options can be additionally specified.
The [create] subcommand
This subcommand creates a new sound object. It has the following syntax:
soundRef create (-data bin|-file str|-name str|-url str)
The [soundRef create] command returns a token used in the other
subcommands to uniquely identify the sound. One of the options -data,
-file, -name or -url must be specified.
Here is the description of the various options:
The -name option searches for named sounds in several places,
returning the first sound it finds matching the given name. The preferred
way to locate a sound is to pass a name without the file extension. The
order of the search is as follows:
- the -data option lets you specify binary data corresponding
to the sound.
- the -file option lets you specify the name of a file
containing the sound. The value can be a full or relative path name
specifying the file with the desired sound data.
- the -name option lets you specify a sound by name.
- the -url option lets you specify a sound by its URL.
If no sound file can be located in the application bundle,
the following directories are searched in order:
- Search for an object whose name was set explicitly.
- Search the Application Kit framework for a system sound with the specified name.
- Search the application's main bundle for a file whose name matches the
The [delete] subcommand
This subcommand lets you delete a sound. The syntax is:
soundRef delete token
After deletion, the token associated with this sound is not valid anymore.
The [list] subcommand
This subcommand returns a list of the existing sound tokens. The syntax is:
The [pause] subcommand
This subcommand lets you pause audio playback. The syntax is:
soundRef pause token
The [play] subcommand
This subcommand lets you initiate audio playback. The syntax is:
soundRef play token
The [resume] subcommand
This subcommand lets you resume audio playback. The syntax is:
soundRef resume token
The [stop] subcommand
This subcommand lets you conclude audio playback. The syntax is:
soundRef stop token
The [volume] subcommand
This subcommand lets you get or set the volume of a sound. The syntax is:
soundRef volume token
soundRef volume token value
The first form of the command returns the current volume.
The second form of the command is used to set the volume for a
Last updated 2016-11-23 15:54:19