Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Play mp3 file in WM Player Mobile

4 views
Skip to first unread message

sebapi

unread,
Mar 21, 2006, 7:54:13 AM3/21/06
to
I would like to write application which play mp3 files on Smartphone.
In what way can I create this application ?

I've tried to solve this problem like:
Process audioPlayer = new Process();
audioPlayer.StartInfo = new ProcessStartInfo("wmplayer",
"Baby.mp3");
audioPlayer.Start();

but when I start application on emulator, I can not hear any sound and
it appears message like:
"Cannot play the file. The file is either corrupted or the Player does
not support the format you are trying to play"

I don't know in what way solve this problem.
Thanks.

Tom Moon

unread,
Apr 7, 2006, 4:54:53 PM4/7/06
to
mp3 playback support on Mobile 5.0 is broken in some ways.

--------------------------------------------------------------------------------------
The DirectShow mp3 filter is broken.
http://groups.google.com/group/microsoft.public.windowsce.embedded.vc/browse_frm/thread/5b64e84e065db7c3/?hl=en#
I can tell you that I confirmed this with a reliable MS source.

--------------------------------------------------------------------------------------
Windows Media Player for Mobile 5.0 (WMP) does work through the COM
interface but WMP has some serious bugs in it.
Start here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/embeddingtheplayercontrolinacprogram.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/interfaces.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/samples.asp

You can implement WMP calls using the COM interfaces.
I was not able to implement the Event Handler. You can give it a try
but it will be tricky if you do succeed.

Without the event handler you have very limited control of WMP.
Basically, you can put information in to WMP and you get little or no
information out of WMP.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/_wmpocxeventsinterface.asp
Something that you may want to explore is if the Event Handler
(_WMPOCXEvents Interface) writes events to the registry. If that is
the case you may be able to watch the registry for WMP events.


The WMP COM event handler appears to be single-threaded, too. If
certain commands are sent through your COM interfaces, WMP will not
take new commands until it is able to post messages back to the calling
process (your process).
Also, the Play command can get "stuck" in that it will interrupt any
calls to "Pause" until the "Play" command gets unstuck. You unstick it
by calling a IWMPControls->Next or IWMPControls->Previous.
And you should avoid calling IWMPControls->Play if the WMP is already
playing. But then the problem is calls to IWMPCore->get_playState
often fail. So you don't know the current state of the WMP (and thus
don't know if you should or should not call IWMPControls->Play).
I could go on and on with the WMP on Mobile 5.0 bugs.
--------------------------------------------------------------------------------------

Hopefully MS will sort out mp3 playback before Mobile 6.0

-J Tom Moon

Oh, and IWMPPlaylist->clear is not thread safe. Don't call it when WMP
is transitioning between media in the playlist. (and to find out when
we transition media would be an ugly workaround/hack).

0 new messages