简体   繁体   中英

C# Audio playing badly

I'm making a game to learn how to properly use C#, but the sounds that I use don't play as intended. They make no errors, but play late and the file seems cut.

I'm using WinForms, so I tried a SoundPlayer with a Stream, or tried with Visual Basic's Audio class.

I also tried to make a dictionary full of streams, or full of SoundPlayer, but it didn't change anything.

It work when I use the AudioPlayMode.WaitToComplete, but it isn't what I want.

Thanks in advance !

I've figured it out. I just put the audio in a Thread, and put Audio.WaitToComplete in it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM