Suny
Suny

Reputation: 1175

Audio Streaming in Windows8

I want some help on streaming an audio content on Windows8.I have several URL's which i need to play.Not sure if there is any ready to use API for this or anything else.

Can anyone please help ?

Upvotes: 2

Views: 907

Answers (1)

N_A
N_A

Reputation: 19897

Try this:

Combine this with this.

Basically you create an instance of the MediaElement class with a URI like Uri targetUri = new Uri(@"http://www.bing.com"); which points to your audio.

Since you mentioned "several URLs" you'll need to create some sort of "playlist" (which may just be a collection of URLs). You can subscribe to the MediaEnded event of the MediaElement to know when to go to the next track. You'll also want to subscribe to the MediaFailed event in case the network goes down, the audio file is deleted or the audio file is using an unsupported codec.

Finally, consider adding support for audio to continue running in the background even when your application is not focused. This thread should help.

Upvotes: 2

Related Questions