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
);
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. |
Declared in dmusics.h. Include dmusics.h.
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.
IDirectMusicSynthSink, IDirectMusicSynth::SetMasterClock, IDirectMusicSynthSink::SetMasterClock