beetlebug▾
/

ztcl::audio stop

Stops a sound or a pattern.

ztcl::audio stop HANDLE
ztcl::audio stop VOICE ?-in MS|-at FRAME?
ztcl::audio stop PATTERN ?-in MS|-at FRAME?

Description

Stops the sound of HANDLE. Its -command runs with {status stopped} from the event loop, and a later end from the host runs no script. A handle that ended is no error. A VOICE of the engine stops at once, or -in MS from now, or -at FRAME, with a fade of 64 frames; a voice that ended is no error, as for after cancel. A PATTERN plays no step at or after the frame of the stop; the voices of its hits play to their end. A pattern that ended is no error.

Returns

An empty string.

Examples

% ztcl::audio stop audio7

% ztcl::audio stop voice7

% ztcl::audio stop pattern7

Errors

% ztcl::audio stop x1
bad handle "x1"
-errorcode ZTCL AUDIO HANDLE

Facts

Capability
audio. A new interpreter does not have it until the host turns it on.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.6

See also