playing .mp3 files from the internet

J

jdcharbonneau

Hi,

I'm trying to write a windows mobile application which will play .mp3 files
stored on a server. Pocket PC WindowsMediaPlayer plays the file just fine if
it's stored locally, but not from the server. The desktop WindowsMediaPlayer
plays the file just fine.

What am I doing wrong? Thanks.

Here's the code:
WMPLib.WindowsMediaPlayer player = new
WMPLib.WindowsMediaPlayer();
player.URL = "http://s3.amazonaws.com/TheLab/a.mp3";
player.settings.volume = 100;
player.controls.play();
 
P

Paul G. Tobey [eMVP]

Forget about writing code for now. If Media Player won't play it, I'd
suggest that the OS components necessary to handle streaming media are not
present on your device, so any code that you write isn't going to do any
better.

Paul T.
 
J

jdcharbonneau

Thanks for your response, but I'm a little confused because if i start
MediaPlayer on my device and hit the 2nd button from the left (with the
picture of a globe), it starts IE open to www.windowsmedia.com. Here there
are a list of songs and videos that stream to my device just fine.

Why can my device stream this media, but not my own .mp3 files?

Thanks
 
P

Paul G. Tobey [eMVP]

The codecs for streaming various types of media are all different, just like
the format of files saved by Word and Excel are different. If you don't
have a suitable reader to read the file, you can't read it. If you don't
have an appropriate codec to receive the streamed media in the format that
the server wants to send, you don't get anything.

Paul T.
 
J

jdcharbonneau

Like I said in my original post, I can play these files if i copy them to the
device, just not when i try to play them from a remote server. Since I can
play the file (when it's local), doesn't this indicate the correct codec is
installed?

And even if my media is in a format which can't be handled by the available
codecs for Windows Mobile 6, i'm willing to convert to another format. Then
the question becomes what format?

Thanks again
 
P

Paul G. Tobey [eMVP]

Yes, streaming and local playback codecs are different. Didn't you already
say that www.windowsmedia.com stuff could be streamed? Perhaps you can
figure out from that site what format they're using. I don't see any
built-in way to determine which codecs are installed, but you could probably
write some code using the media APIs to enumerate them.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top