I find this partial scrip in Forum1c/Cliffs, what is need add to be able to test?
Or what set for start the "SoundPlayer"?
Code:
public void playSound(string sound, int trigger)
{
try
{
SoundPlayer singleSound = new SoundPlayer("parts\\Sounds\\" + sound + ".wav");
if ((trigger < 0) || (trigger > 2))
{
trigger = 2;
}
if (trigger == 0) // To play a sound
{
singleSound.Play();
}
if (trigger == 1) // To loop a sound
{
singleSound.PlayLooping();
}
if (trigger == 2) // to stop looping
{
singleSound.Stop();
}
}
catch (Exception e) { }
}
}
// playSound("scream01", 0);
// This will play the sound scream01.wav one time
Bookmarks