Esempio n. 1
0
bool SoundClass::Initialize(HWND hwnd)
{
	bool result;

	// Initialize direct sound and the primary sound buffer.
	result = InitializeDirectSound(hwnd);
	if (!result)
	{
		return false;
	}

	// Load a wave audio file onto a secondary buffer.
	result = LoadWaveFile("../Engine/data/sound02.wav", &m_secondaryBuffer1, &m_secondary3DBuffer1);
	if (!result)
	{
		return false;
	}

	// Play the wave file now that it has been loaded.
	result = PlayWaveFile();
	if (!result)
	{
		return false;
	}


	return true;
}
Esempio n. 2
0
bool SoundClass::Initialize(HWND hwnd, char * _filename, int volume, bool loop)
{
	bool result;


	// Initialize direct sound and the primary sound buffer.
	result = InitializeDirectSound(hwnd);
	if (!result)
	{
		return false;
	}

	// Load a wave audio file onto a secondary buffer.
	result = LoadWaveFile(_filename, &m_secondaryBuffer1);
	if (!result)
	{
		return false;
	}

	// Play the wave file now that it has been loaded.
	result = PlayWaveFile( volume,  loop);
	if (!result)
	{
		return false;
	}

	return true;
}
Esempio n. 3
0
bool SoundClass::Initialize(HWND hwnd, char * _filename, int volume, bool loop)
{
	bool result;


	result = InitializeDirectSound(hwnd);
	if (!result)
	{
		return false;
	}
	
	result = LoadWaveFile(_filename, &m_secondaryBuffer1);
	if (!result)
	{
		return false;
	}

	result = PlayWaveFile( volume,  loop);
	if (!result)
	{
		return false;
	}

	return true;
}
Esempio n. 4
0
bool SoundClass::Initialize(HWND hwnd)
{
	bool result;
	// Initialize direct sound and the primary sound buffer.
	result = InitializeDirectSound(hwnd);
	if(!result)
	{
		return false;
	}

	// Load a wave audio file onto a secondary buffer.
	result = LoadWaveFile(FileSystemHelper::GetResourcePath(L"/Sound/sound01.wav"), &m_secondaryBuffer1);
	if(!result)
	{
		return false;
	}

	// Play the wave file now that it has been loaded.
	result = PlayWaveFile();
	if(!result)
	{
		return false;
	}

	return true;
}
Esempio n. 5
0
bool Sound::Initialize(const char* filename, HWND hwnd, int volume)
{
	bool result;

	m_volume = volume;

	result = InitializeDirectSound(hwnd);
	if(!result)
	{
		return false;
	}

	result = LoadWaveFile(filename, &m_secondaryBuffer1);
	if(!result)
	{
		return false;
	}

	return true;
}
Esempio n. 6
0
bool SoundClass::Initialize(HWND hwnd)
{
	bool result;

	result = InitializeDirectSound(hwnd);
	if (!result)
	{
		return false;
	}

	result = LoadWaveFile("./Sound/f1.wav", &_secondaryBuffer1);
	if (!result)
	{
		return false;
	}

	std::string file1 = "catapult_w.wav";

	std::string path = "./Sound/";

	_waveBuffers[file1] = NULL;

	result = LoadWaveFile((path + file1).c_str(), &_waveBuffers[file1]);
	if (!result)
	{
		return false;
	}
	//result = LoadWaveFile()

	result = PlayWaveFile();
	if (!result)
	{
		return false;
	}

	return true;
}