Lingo Dictionary > S > startTime (sound)

 

startTime (sound)

Syntax

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

Description

Sound property; sets the point within the sound where it will begin playback.

This property is used with a queue(), play(), or setPlayList() command to set a point within the sound other than the beginning at which to start playback. When tested, it indicates the start time of the currently playing or paused sound as set when the sound was queued. It cannot be set after the sound has been queued. If no value was supplied when the sound was queued, this property returns zero (the beginning of the sound). Zero is also returned if no sound is playing when this property is tested. For sound members the startTime value is in milliseconds.

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

See also

queue(), setPlaylist(), play() (sound)