Using the MonoTouch libraries, what I would like to do is being able to play a sound for a specific duration and then stop playback. It must be done on a different thread than the UI. I've tinkered with a few different options, and I'm not entirely sure what the best course of action is at this point.
The classes look something like this:
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
}
}
}
I've been tinkering with SystemSound and AvAudioPlayer but I'm yet to get the required result.