❔ Play Overlapping Sound

i have a sound function that plays a sound from file, but if i call it while its playing it cuts off the last sound to play the new one?
void PlaySound(string sound)
{
var player = new System.Media.SoundPlayer(sound);
player.Play();
}
void PlaySound(string sound)
{
var player = new System.Media.SoundPlayer(sound);
player.Play();
}
.NET Framework 4.8
2 Replies
D.Mentia
D.Mentia2y ago
1. Don't use Framework, it's old af 2. Try a different audio library if that one's not doing what you want 3. Check docs for that SoundPlayer to see if there's any way to do what you want, but probably not, since it needs the 'sound' to initialize
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server