Lingo Dictionary > D-F > endTime |  |

endTime

Syntax

    sound(channelNum).queue([#member: member(whichmember), {#startTime: milliseconds, #endTime: milliseconds, #loopStartTime: milliseconds, #loopEndTime: milliseconds, #loopCount: numberOfLoops, #preloadTime: milliseconds, #rateShift: shiftAmount}])
    sound(channelNum).endTime

Description

This property specifies the end time of a sound in the queue. This is the time within the sound member when it will stop playing. It's a floating-point value, allowing for measurement and control of sound playback to fractions of milliseconds. The default value is the normal end of the sound.

This property may be set to a value other than the normal end of the sound only when passed as a parameter with the `queue()`, `play()`, or `setPlayList()` commands. When tested, it returns the end time of the sound that is currently playing in the specified sound channel.

When this property is tested, the value is for the currently playing, paused, or queued sound. If no sound is playing or paused when this property is tested, zero is returned.

Example

This handler queues and plays two sounds. The first sound, cast member Chimes, is played in its entirety. The second sound, cast member introMusic, is played starting at its 3-second point, with a loop repeated 5 times from the 8-second point to the 8.9 second point, and stopping at the 10-second point. 4 seconds of the sound will be preloaded and it will be played back with a rateShift of 1, or at one half-step higher pitch than normal.

    on playMusic
    	sound(2).queue([#member: member("Chimes")])
    	sound(2).queue([#member: member("introMusic"), #startTime: 3000,\
    	#endTime: 10000, #loopStartTime: 8000, #loopEndTime: 8900, #loopCount: 5, \
    	#preloadTime: 4000, #rateShift: 1])
    	sound(2).play()
    end

Example

This Lingo checks whether the currently playing sound, member Jingle, is set to play all the way through in sound channel 1:

    if sound(1).startTime > 0 and sound(1).endTime < member("Jingle").duration then
    	alert "Not playing the whole sound"
    end if

See also

`setPlaylist(), queue(), play() (sound), stop() (sound), startTime (sound)`