3
我只是想在彼此之後播放4個聲音(sounds1-> sound2-> sound3),但是在每次播放期間沒有停止我代碼中的流程,或者無需等待每個聲音完成。如何異步播放聲音,但他們自己在隊列中?
我已經在任何地方搜索了這個,但是我讀到的每個方向都陷入了一些其他問題。
到目前爲止,我最好的選擇是:使用System.Media中已有的SoundPlayer並創建自己的隊列函數,但Soundplayer沒有「完成播放」事件,因此我不知道何時開始下一個聲音。 (真的,微軟?)
其他解決方案和問題: DirectSound似乎很難在.NET(c#)中工作。 Win Playsound並沒有真正的幫助,因爲它無法排隊。
你可以在後臺線程中調用'PlaySync()'。 – SLaks
NAudio有一個'PlaybackStopped'事件...它也可能有一個內置隊列;我不太熟悉它。 –