Sign in to follow this  

c# BackgroundAudioPlayer Win Phone 8

Recommended Posts

James Rose    38

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();

Share this post


Link to post
Share on other sites
+Andre S.    1,891

What do the properties of the BackgroundAudioPlayer indicate, especially Error, PlayerState, Position and Volume?

Share this post


Link to post
Share on other sites
James Rose    38

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

Share this post


Link to post
Share on other sites
+Andre S.    1,891

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.