Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DirectMusic help

This topic is 5654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m currently developing an audio class and in it I have a set of functions to easily create a soundtrack but in order to create the sound track I have to constantly check weather the file is playing and if it has stopped, to play the next song. I''m having trouble determening if the wav/midi/ is playing or not. Due to latency, IsPlaying is completely unreliable... I tried checking if it''s playing at intervals with length equal to the latency time but that doesn''t work very well... MUSIC_TIME LatencyTime, PerformanceTime; REFERENCE_TIME LatencyRef; HRESULT hr; char lpBuffer[32]; m_pPerformance->GetLatencyTime(&LatencyRef); m_pPerformance->ReferenceToMusicTime(LatencyRef, &LatencyTime); m_pPerformance->GetTime(NULL, &PerformanceTime); LatencyTime -= PerformanceTime; hr = m_pPerformance->IsPlaying(m_pTracks[m_TrackNo],m_pTrackStates[m_TrackNo]); if(PerformanceTime % (LatencyTime*100) == 1 && hr == S_OK) NextTrack(); I have that in a member function called "TrackManage" which is inside the program loop. Any help is very much appreciated. Thanks in advance.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!