The problem is that the AudioSteamAgent
is targeted at WP Silverlight, and your actual app is WP8.1 (WinRT).
To create background audio in WP8.1, you will want to use the Background Media Player.
You can find a great guide for how to get started here.
But basically (without all the boilerplate code to wire everything up), it comes down to telling the BMP what to play (code is from the link above):
BackgroundMediaPlayer.Current.SetUriSource(new Uri("ms-appx:///Assets/Media/Ring02.wma"));
BackgroundMediaPlayer.Current.Play();
And telling the OS player controls what to show, and what to do when the user interacts with them:
systemmediatransportcontrol = SystemMediaTransportControls.GetForCurrentView();
systemmediatransportcontrol.ButtonPressed += systemmediatransportcontrol_ButtonPressed;
systemmediatransportcontrol.PropertyChanged += systemmediatransportcontrol_PropertyChanged;
systemmediatransportcontrol.IsEnabled = true;
systemmediatransportcontrol.IsPauseEnabled = true;
systemmediatransportcontrol.IsPlayEnabled = true;
systemmediatransportcontrol.IsNextEnabled = true;
systemmediatransportcontrol.IsPreviousEnabled = true;
This is all assuming that you want the user to be able to leave the app and have media continue to play. If you just want to stream audio/video while the user is in the app you can use the MediaElement control.