//--------------------------- Advanced features
 PyObject* LMF_SoundLoop      (PyObject *self, PyObject *args){
	int iSoundID;
	if (!PyArg_ParseTuple(args, "i", &iSoundID)) {
		ParsePyTupleError( __func__, __LINE__ );
		return nullptr;
	}
	SoundLoop(iSoundID);
	Py_RETURN_NONE;
}
Exemple #2
0
////////////////////////////////////////////////////////////
/// Play sound from file into buffer
////////////////////////////////////////////////////////////
void SoundBufferPlay(char * File, bool Looping, float x, float y, float z)
{
	struct Sound SoundStruct = { 0 };

	SoundBufferLoad(&SoundStruct, File);

	if (SoundStruct.Buffer != 0)
	{
		if (SoundStatus(&SoundStruct) == Stopped)
		{
			// Set volume
			SoundVolume(&SoundStruct, SoundGeneralVolume);

			// Set position
			SoundPosition(&SoundStruct, x, y, z);

			// Set looping
			SoundLoop(&SoundStruct, Looping);

			// Play sound
			SoundPlay(&SoundStruct);
		}
	}
}