I want to play an audio in background.
So I did this iniside my main project
BackgroundAudioPlayer.Instance.Track = audioTrack;
BackgroundAudioPlayer.Instance.Play();
and inside audio background agent:
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param)
{
switch (action)
{
case UserAction.Play:
player.Play();
break;
case UserAction.Stop:
player.Stop();
break;
case UserAction.Pause:
player.Pause();
break;
case UserAction.FastForward:
player.FastForward();
break;
case UserAction.Rewind:
player.Rewind();
break;
default:
break;
}
NotifyComplete();
}
but I get an error:
System.SystemException: HRESULT = 0xC00D001A
I have another question too: will this continue playing after I close the app?
The error code should say it all:
0xC00D001A
NS_E_FILE_NOT_FOUND
User contributions licensed under CC BY-SA 3.0