how to play mp3/wma in my program?

With the API, PlaySound and sndPlaySound, it only play waveform file. I try to use DirectShow with WM 5.0 but still can't play mp3 or wma file. My code is maybe wrong, anyone has good sample with DirectShow to play mp3/wma?

I think the another way to play mp3/wma is using Media Player control. But I can't find the way to make this work. Could anyone guide me to the right way?

Thanks...

[394 byte] By [shian] at [2008-2-4]
# 1
There's no API to directly play a mp3 or wma file. However, you shold be able to use the Windows Media Player 10 OCX, which is in Windows Mobile 5.0, and I think first shipped in one of the 2003SE AKUs
NishanJebanasam at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 2
YES, I play mp3/wma now by Media Player 10 OCX. It's trick. You can't use Media Player 10 SDK for PPC. You should use Media Player 10 SDK. Big Smile
shian at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 3
Dear All,
I installed visual studio 2005 beta 2 team suit on my XP machine.I am looking for samples to run a media file(.wmv).I am using wmp.dll and wmp.ocx.

I opened the smartphone magneto and i am trying to drag & drop wmp.ocx but it is always disabled.

I am also trying to use provided API for wmp.dll,

WindowsMediaPlayerClass Player=new WindowsMediaPlayerClass();
Player.URL="C:/MyDocuments/Media.wmv";
Player.Play();
When i execute the above code, It is not giving any error but i could not see my media file Playing.


experts , please help me out of this situation.

Thank You.

# 4
I have a problem like this. I am trying to embed windows media player to my C# windowsCE project but it is impossible now. I think I can do this with the functions of wmp.dll but I can't see them with dumpbin.exe. Is there any solution to embed it to my project without extra program like cfcom.
isorac at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 5
I have the same problem too. I am trying to embed WMP to my VC++ PPC project(inster WMP ActiverX cotrol to my dialog box), but it has runtime error when I run my program on my packet PC.

I got "windows media mobile code sample", it has compiler error in VC2005 and the sample code can compiler in eMedded VC++ 4 and work well on my packet PC.

kingku at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 6
Hello,

Can you help me with this? If you could please show me how to play a mp3/wma file in Media Player 10 OCX on Windows Mobile 5.0 - I would really appreciate it!

CarlosDeMatos at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 7

shian,

How did you do it? I'm a fairly new programmer. I can play files in a windows application using axWindowsMediaPlayer1, but when I try to do it on my Windows Mobile 5 platform, the axWindowsMediaPlayer tool disappears.

bill

wdmtaj at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 8
How do you install/use the Media Player 10 OCX?
wdmtaj at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 9

Shian, Could you please explain how you did it. I would appreciate your help.

Where do you get Media Player 10 OCX? How do you install and use it?

When I create a "Smart Device" MFC Dialog based application in VS2005, right click on the form and insert WMP ActiveX control, it gives "Debug Assertion Failed! at occcont.cpp line 916" at runtime in the Windows Mobile 5.0 Pocket PC emulator. Any activeX control added in this way gives the same debug assertion. Looks like I am using the wrong activeX control. Do I need to install seperate Windows media player activeX control for WMP 10 Mobile? If so, how do I do it and use it in my application?

Anybody else who has tried using WMP activeX in Windows Mobile PPC application, please provide inputs.

Thanks in advance.

Inquisitve2 at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 10

I am also facing the same problem. Anybody is there to help me out?

Thanks,

Raj

raja_t at 2007-9-8 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...