The [soundRef] command.

Introduction

The soundRef command lets you create and manipulate sound objects in Alpha.

Synopsis

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:
  1. Search for an object whose name was set explicitly.
  2. Search the Application Kit framework for a system sound with the specified name.
  3. Search the application's main bundle for a file whose name matches the specified string.
If no sound file can be located in the application bundle, the following directories are searched in order:

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:
	soundRef list

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 sound.

Examples



Last updated 2016-11-23 15:54:19