wp7 SoundEffect 播放绑定到滚动条
我正在思考如何播放音乐并在滚动条上显示当前的播放时间。我使用 SoundEffectInstance 类,因为我从 MemoryStream 播放它。
请帮助我。
I'm wandering how to play music and show the current playing time on scrollbar. I'm using the SoundEffectInstance class because I play it from MemoryStream.
pleas help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个计时器,当您开始播放声音/音乐时启动该计时器。
然后您可以使用此计时器来显示经过的时间。如果您知道音乐的长度,您还可以计算剩余时间。
当用户暂停和停止音乐(如果适用)时,请务必考虑暂停和停止计时器。另外,请务必在逻辑删除时适当暂停并保存当前经过的时间。
Create a timer which you start when you start playing the sound/music.
You can then use this timer to show elapsed time. If you know the length of the music you can also calculate the remaining time.
Be sure to account for pausing and stopping the timer when the user pauses and stops the music (if applicable). Also be sure to pause and save the current elapsed time appropriately when tombstoned.