Lingo Dictionary > L-N > loopEndTime

 

loopEndTime

Syntax

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

Description

Sound property; the end time, in milliseconds, of the loop set in the specified sound. Its value is a floating-point number, allowing you to measure and control sound playback to fractions of a millisecond.

This property can only be set when passed as a property in a queue(), play(), or setPlaylist() command. When tested, the value is for the currently playing, paused, or queued sound.

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 handler plays sound cast member introMusic in sound channel 2. Playback loops five times between the 8 seconds point and the 8.9 second point in the sound.

on playMusic
	sound(2).play([#member:member("introMusic"), #startTime:3000,\
	#loopCount:5,#loopStartTime:8000, #loopEndTime:8900])
end

Example

This handler causes the text field TimWords to read "Help me, I'm stuck!" when the currentTime of sound channel 2 is between its loopStartTime and loopEndTime.

on idle
	if sound(2).currentTime > sound(2).loopStartTime and \
	sound(2).currentTime < sound(2).loopEndTime then
		member("TimWords").text = "Help me, I'm stuck!"
	else
		member("TimWords").text = "What's this sticky stuff?"
	end if
end

See also

breakLoop(), getPlaylist(), loopCount, loopsRemaining, loopStartTime, queue(), play() (sound), stop() (sound), setPlaylist()