AxWindowsMediaPlayer problem while playing audio files in WMdevices

R

RaviMobileone

Hi Experts,


i am using AxWindowsMediaPlayer to play audio files. following is
the samle code snippet to play the file. if you play the audio file
more than 20 or 30 times then it is giving Windows media "Unspecifed
Error".

i am using .net compact framework 2.0 and window mobile 5.0 device.

To Play the File :

AxWMPLib.AxWindowsMediaPlayer mediaPlayer = new
AxWMPLib.AxWindowsMediaPlayer();
mediaPlayer.Location = new System.Drawing.Point
(0, 0);
mediaPlayer.Size = new System.Drawing.Size(0,
0);
mediaPlayer.Name = "MediaPlayer";
mediaPlayer.URL =RingtonePath;
mediaPlayer.settings.volume = 10;
mediaPlayer.PlayStateChange += new
AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler
(mediaPlayer_PlayStateChange);
mediaPlayer.ErrorEvent += new EventHandler
(mediaPlayer_ErrorEvent);


To stop the file:

if (mediaPlayer.playState != WMPLib.WMPPlayState.wmppsStopped)
{
mediaPlayer.Ctlcontrols.stop();
}
mediaPlayer.close();
mediaPlayer.Dispose();
mediaPlayer = null;


please help me ,......................................
 
R

RaviMobileone

It because you're using the MSDN code, which has a bug in it:

http://blog.opennetcf.com/ctacke/2008/08/14/BugInMSDNActiveXHostingCo...

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded communityhttp://community.OpenNETCF.com

Hi Chris Tacke,

thanks for your quick reply. i have updated Axhost.cs file using
http://blog.opennetcf.com/ctacke/2008/08/14/BugInMSDNActiveXHostingCo...
,but application still not working. please if can you send if any
sample application.
 

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