且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在不挂我的应用程序的情况下播放声音

更新时间:2022-11-03 15:13:25

我假设这是C#......



跳过非托管代码,只需使用 System.Media.SoundPlayer [ ^ ]它将在单独的线程中播放声音,而不会锁定您的应用程序。
I'm assuming that this is C#...

Skip the unmanaged code, just use System.Media.SoundPlayer[^] which will play the sound in a separate thread without "locking up" your application.