【发布时间】:2013-09-03 20:13:37
【问题描述】:
使用 MonoTouch 库,我想做的是能够播放一段特定持续时间的声音,然后停止播放。它必须在与 UI 不同的线程上完成。我已经修改了几个不同的选项,但我不完全确定目前最好的行动方案是什么。
这些类看起来像这样:
public class Foo
{
public string FileName { get; set; }
public string FilePath { get; set; }
public double Duration { get; set; }
public double PauseAfter { get; set; }
}
public class FooPlayer
{
public List<Foo> Foos { get; set; }
public void PlayFoos()
{
foreach (Foo f in Foos)
{
//Play the sound
//Stop the sound after the duration has passed
//Wait for the duration specified in PauseAfter
//Continue loop
}
}
}
我一直在修改 SystemSound 和 AvAudioPlayer,但还没有得到所需的结果。
【问题讨论】:
标签: c# xamarin.ios