I've been trying to loop a soundtrack using this:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Music();
MediaClock Repeater = new MediaClock(Timeline);
AudioOutput.Clock = Repeater;
}
internal static MediaTimeline Timeline;
public static void Music()
{
double numbers = 999999999999999999;
RepeatBehavior repeatAlmostInfinitely = new RepeatBehavior(numbers);
TimeSpan Duration = new TimeSpan(0, 0, 58);
Duration duration = new Duration(Duration);
TimeSpan? beginTime = new TimeSpan?();
MediaTimeline mediatimeline = new MediaTimeline(beginTime, duration, repeatAlmostInfinitely);
Timeline = mediatimeline;
}
}
But it says that " 'MediaClock.MediaClock(MediaTimeline)' is inaccessible due to its protection level. Is there a way to fix this?