Jump to content
  • Advertisement
Sign in to follow this  
Mosh

Reverb with DirectMusic

This topic is 5469 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 all, I have recently impemented a DirectMusic wrapper class for playing WAV files, which works almost perfectly. The problem is that when the songs are playing, there is an echo effect by default which makes them sound very distorted and wrong. Is there a way to specifically turn this off? Or have I accidently coded it wrong? I based my class on the tutorials in the DX SDK, using IDirectMusicLoader8, IDirectMusicPerformance8, and IDirectMusicSegment8. Here is a snippet of code on how i initialise and play the songs:

// Initialise
HRESULT hr;
if(FAILED(hr = g_Music.GetLoader()->LoadObjectFromFile(CLSID_DirectMusicSegment, IID_IDirectMusicSegment8,
											szPath,	(LPVOID*)&m_pSegment)))
	{
		switch(hr)
		{
                    // Lots of error checking in here.
                }
		::OutputDebugString("Failed to find the media file: ");
		::OutputDebugString((char*)szPath);
		::OutputDebugString("\n");
		return(E_FAIL);
	}

// And heres the playing part:
	HRESULT hr;
	if(FAILED(hr = m_pSegment->Download(g_Music.GetPerformance())))
	{
		::OutputDebugString("Failed to download the track\n");
		return(hr);
	}

	if(FAILED(hr = g_Music.GetPerformance()->PlaySegmentEx(m_pSegment, NULL, NULL, 0, 0, NULL, NULL, NULL)))
	{
		::OutputDebugString("Failed to play the track\n");
		return(hr);
	}


Any ideas? Help is greatly appreciated!!

Share this post


Link to post
Share on other sites
Advertisement
i dont think the echo effect is used by default in DirectMusic, but try to turn the effects off:
		  path->Activate(FALSE);
if (FAILED(sb->SetFX(0,0,0)))
{
path->Activate(TRUE);
return (E_FAIL);
};
path->Activate(TRUE);

where path is IDirectMusicAudioPath8*
and sb is IDirectSoundBuffer8*
use the path->Activate(FALSE) and path->Activate(TRUE) only if the buffer is part of the audiopath.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!