Previous Next

IDirectMusicSynth::GetLatencyClock

The GetLatencyClock method retrieves a reference to the IReferenceClock interface (described in the Platform SDK documentation) of the reference-clock object that tracks the current mix time.

HRESULT
  GetLatencyClock(
    IReferenceClock  **ppClock
    );

Parameters

ppClock
Output pointer for the latency clock. This parameter points to a caller-allocated pointer variable into which the method writes a pointer to the latency-clock object's IReferenceClock interface. Through this interface, the synthesizer is able to get the current mix time. Specify a valid, non-NULL pointer value for this parameter.

Return Values

GetLatencyClock returns S_OK if the call was successful. Otherwise, the method returns an appropriate error code. The following table shows some of the possible return status codes.

Error Code Description
E_FAIL Indicates that the method was unable to access the latency clock.
E_POINTER Indicates that the ppClock pointer is not valid.
DMUS_E_NOSYNTHSINK Indicates that the IDirectMusicSynthSink object was not connected.
DMUS_E_SYNTHNOTCONFIGURED Indicates that the synth is not open or is not properly configured.

Headers

Declared in dmusics.h. Include dmusics.h.

Comments

This method returns the latency clock created by the wave sink (IDirectMusicSynthSink) object, which handles the output audio stream. The latency clock returns the current render time whenever its IReferenceClock::GetTime method is called. This time is always relative to the time established by the master clock (installed in the synthesizer and wave sink through a call to IDirectMusicSynth::SetMasterClock and IDirectMusicSynthSink::SetMasterClock). The latency time is used by the performance to identify the next available time to start playing a note. The latency should not exceed 450 milliseconds.

For more information on latency clocks, see Synthesizer Latency. Also see the description of the IDirectMusic and IReferenceClock interfaces in the Platform SDK documentation.

The ppClock parameter follows the reference-counting conventions for COM objects.

See Also

IDirectMusicSynthSink, IDirectMusicSynth::SetMasterClock, IDirectMusicSynthSink::SetMasterClock