Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I play sound in C#?

I'm trying to make a small game. There is about 20 effect sounds and I combined them all into one mp3 file. My question is: Is there a way to load the mp3 file into the memory and then play multiple sections of it at the same time?

Any help is appreciated, thanks you!

like image 655
A New Chicken Avatar asked Dec 30 '25 00:12

A New Chicken


1 Answers

nAudio is your friend

You can open the same file (stream or byte array) as many times as you like and set the position you want to play from

like image 62
TFD Avatar answered Jan 01 '26 12:01

TFD