NAudio - Play an audiofile, wait for 2 seconds, play the audio file again

℡╲_俬逩灬. 提交于 2019-12-06 16:15:16

For an accurate 2 second wait, I'd create my own IWaveProvider that in the Read method, read from your source file, then when it finished, returned 2 seconds of silence, and then started reading from the start of the source file again.

For a rough solution, you can just use a timer after the PlaybackStopped event fires to kick off a new playback.

recursiveContradiction

Make a timer into your loop's end. Make it sleep for a while.

Execute specified function every X seconds

It has been explained here before.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!