soundinfo(
soundinfo(
IDENTIFIER
)

The soundinfo( function returns a dictionary that contains all of the properties of a sound.

Parameters

This function has one parameter:

identifier – identifier of the sound (must have been set up with the PlaySound statement).

Description

This function returns a dictionary that contains all of the properties of the specified sound. You can then use these functions to extract the property values:

- getdictionaryvalue( – use a key to retrieve an individual value from a dictionary
- listdictionarykeys( – list all of the keys within a dictionary
- dumpdictionary( – list all of the keys within a dictionary and their associated values

These are the properties returned by this function:

Identifier – the identifier of the sound. (This is a bit redundant since you already had to specify the identifier to get these results.)

Code – the code that will be run when the sound is finished (if any).

Paused – true/false (boolean) flag indicating whether playback is currently paused.

Looping – true/false (boolean) flag indicating whether the sound will loop over and over again.

Duration – normal duration of the sound, in seconds (floating point value).

Position – current playback position, in seconds (floating point value).

Volume – volume of the sound, from 0 (muted) to 1 (maximum volume according to current computer volume settings). This is a floating point value.

This example will calculate how much of the sound has played so far, from 0 to 1.

    let soundDictionary = soundinfo(Identifier)
    let soundDuration = val(getdictionaryvalue(soundDictionary,"Duration","0"))
    let soundPosition = val(getdictionaryvalue(soundDictionary,"Position","0"))
    let soundProgress = divzero(soundPosition,soundDuration)

Error Messages

soundinfo( function error: timer does not exist – There is no sound being played with the specified name

See Also

- @dictionary --
- controlsound -- controls playback of a sound file.
- info("sounds") -- returns a carriage return delimited list of all currently playing sounds.
- playsound -- starts playing a sound file.
- soundduration( -- returns the duration (in seconds) of the specified playing sound.
- sounddurationhhmmss( -- returns the duration (in hours:minutes:seconds) of the specified playing sound.
- soundplaying( -- returns true if the specified sound is currently playing, false if it is paused or not playing at all.
- soundposition( -- returns the current playback position (in seconds) of the specified playing sound.
- soundpositionhhmmss( -- returns the current playback position (in hours:minutes:seconds) of the specified playing sound.
- soundprogress( -- returns the progress of the played sound from 0 to 1.
- soundstatus( -- returns the status of the specified sound: stopped, playing or paused.
- soundvolume( -- returns the current volume of the specified playing sound.

History

Version | Status | Notes
10.2 | New | New in this version.