Sign in to follow this  

Strange DirectMusic Problem

This topic is 4809 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

Hey all, I'm trying to get a simple .wav file to play with DirectMusic. But the strange thing is that it doesn't play (PlaySegmentEx() returns S_OK, but its silent) unless I put a breakpoint in the code before I call PlaySegmentEx, and then just continue when I hit that breakpoint. Putting a call to Sleep() in doesn't help either. I've made sure I'm passing a valid window handle to InitAudio(), and I check the return values of all of the functions. All return success. Another question: If I don't need to do anything special when a segment ends, is there some kind of default action I should perform? Its just that my current Tick() function is a bit redundant at the moment, and I'm wondering if I can just don't ask DirectMusic for notification events. Here's what I have:
void CSoundManager::Tick()
{
   // Any events? //
   if(WaitForSingleObject(m_hEventNotification,0) != WAIT_OBJECT_0)
      return;

   // Get messages from performance //
   DMUS_NOTIFICATION_PMSG* pMsg;
   while(m_pPerformance->GetNotificationPMsg(&pMsg) == S_OK)
   {
      switch(pMsg->dwNotificationOption)
      {
      case DMUS_NOTIFICATION_SEGEND:
         break;
      }

      m_pPerformance->FreePMsg((DMUS_PMSG*)pMsg);
   }
}



Edit: Here's what my PlaySegmentEx call looks like (If it matters): hResult = m_pPerformance->PlaySegmentEx(m_pSegment,0,NULL,0,0,0,NULL,NULL) Cheers, Steve

Share this post


Link to post
Share on other sites
Are you downloading the segment to your performance before attempting to play it (or have automatic downloading enabled)? Downloading is separate from file loading. Try calling the "Download" method for your segment, passing in the appropriate performance, prior to playing.

Share this post


Link to post
Share on other sites

This topic is 4809 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this