Platform SDK: DirectX

DirectMusicPerformance.PlaySegment

The DirectMusicPerformance.PlaySegment method begins playback of a segment.

object.PlaySegment(segment As DirectMusicSegment, _
    lFlags As Long, _
    startTime As Long) As DirectMusicSegmentState

Parameters

object
Object expression that resolves to a DirectMusicPerformance object.
segment
DirectMusicSegment to play.
lFlags
Flags that modify the method's behavior. See CONST_DMUS_SEGF_FLAGS.
startTime
Time at which to begin playing the segment, adjusted to any resolution boundary specified in lFlags. The time is in music time unless the DMUS_SEGF_REFTIME flag is set. A value of 0 causes the segment to start playing as soon as possible.

Return Values

If the method succeeds, it returns a DirectMusicSegmentState object representing the playing segment.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DMUS_E_OUTOFMEMORY
DMUS_E_NO_MASTER_CLOCK
DMUS_E_SEGMENT_INIT_FAILED
DMUS_E_TIME_PAST

Remarks

Segments should be greater than 250 milliseconds in length.

The boundary resolutions in lFlags are relative to the currently playing primary segment.

If a primary segment is scheduled to play while another primary segment is playing, the first one stops unless you set the DMUS_SEGF_QUEUE flag for the second segment. In this case, it plays as soon as the first one reaches its end.

See Also

DirectMusicPerformance.IsPlaying