Lingo Dictionary > L-N > loopStartTime |  |

loopStartTime

Syntax

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

Description

Cast member property; the start time, in milliseconds, of the loop for the current sound being played by `soundObject`. Its value is a floating-point number, allowing you to measure and control sound playback to fractions of a millisecond. The default is the `startTime` of the sound if no loop has been defined.

This property can only be set when passed as a property in a `queue()`, `play()`, or `setPlaylist()` command.

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 two points 8 seconds and 8.9 seconds into 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()`, `setPlaylist()`, `loopCount`, `loopEndTime`, `loopsRemaining`, `queue(), play() (sound), stop() (sound), getPlaylist()`