Jump to content
  • Advertisement

Archived

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

pebben

Direct Music

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

Hi There! Why doesn´t this code work in my code when it´s works perfectly in the directx wizards code? I can´t see any difference between my code and the wizards code. (I also have included the file #include "DMUtil.h") The problem is that the CreateSegmentFromResource function doens´t seem to find the sound file? I have looked at the address in the file szPath, and it´s right. Please, help me? If you have any clue... //----------------------------------------------------------------------------- // Name: InitAudio() // Desc: Initialize DirectX audio objects //----------------------------------------------------------------------------- HRESULT CMyD3DApplication::InitAudio( HWND hWnd ) { HRESULT hr; // Create the music manager class, used to create the sounds m_pMusicManager = new CMusicManager(); if( FAILED( hr = m_pMusicManager->Initialize( hWnd ) ) ) return DXTRACE_ERR( "m_pMusicManager->Initialize", hr ); // Instruct the music manager where to find the files // TODO: Set this to the media directory, or use resources TCHAR szPath[MAX_PATH]; GetCurrentDirectory( MAX_PATH, szPath ); m_pMusicManager->SetSearchDirectory( szPath ); // TODO: load the sounds from resources (or files) m_pMusicManager->CreateSegmentFromResource( &m_pBounceSound, _T("BOUNCE"), _T("WAVE") ); return S_OK; } /Have A Nice Day -Patrick

Share this post


Link to post
Share on other sites
Advertisement
Hi there, thanx for the tip but I found the problem. I had to rename a file in resource.rc



/Have A Nice Day -Patrick

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!