• 0

c# BackgroundAudioPlayer Win Phone 8


Question

Hello gang,

 

I'm making a phone app for a friend's broadcast and I need to use the BackgroundAudioPlayer.  I have a sample from MS and this code works, but in my own phone app nothing happens.  Any clues?

                AudioTrack GABAudio = new AudioTrack(new Uri("http://www.alexbennett.com/podcast/gab81413.mp3", UriKind.Absolute), "Great American Podcast", null, null, null, "1", EnabledPlayerControls.All);
                BackgroundAudioPlayer.Instance.Track = GABAudio; 
                BackgroundAudioPlayer.Instance.Play();
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

No errors, just no sound.  I did add a line of code about Volume code (oops) and checked the playstate when I click another button and it comes back "unknown"

 

Thanks kindly for the response

Link to comment
Share on other sites

  • 0

Unknown: The current PlayState is indeterminate. For example, a new AudioTrack has been set, but playback has not been initiated. 

http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.backgroundaudio.playstate(v=vs.105).aspx

Looks like Play() isn't successfully initiating playback for some reason. Any exception thrown? Can you try with a local mp3 instead of something on the web? Just throwing random suggestions out there, I have no experience whatsoever with Windows Phone development. :p

Link to comment
Share on other sites

This topic is now closed to further replies.