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

Direct Music

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