首页 > Windows开发 > 详细

wince mobile环境下播放WAV声音

时间:2015-06-16 12:57:54      阅读:497      评论:0      收藏:0      [点我收藏+]
 [DllImport("coredll", EntryPoint = "PlaySound")]
        public static extern int PlaySnd(string pszSound, int hmod, uint fdwSound);
        private void PlaySound_Click(object sender, EventArgs e)
        {
          //  int i = PlaySnd(@"\Temp\test.wav", 0, 0x00000000/*SND_SYNC*/);
             int i = PlaySnd(Globals.GetAppPath() + "\\batchover.wav", 0, 0x00000000/*SND_SYNC*/);
        }
 
 

 

//得到PDA路径

public static string GetAppPath()
{
string directoryName = Path.GetDirectoryName(Assembly.Load(Assembly.GetExecutingAssembly().GetName()).GetName().CodeBase);
if (directoryName.Length > 0)
{
try
{
if (directoryName[directoryName.Length - 1] != ‘\\‘)
{
directoryName = directoryName + @"\";
}
}
catch (Exception)
{
directoryName = "";
}
}
return directoryName;
}

wince mobile环境下播放WAV声音

原文:http://www.cnblogs.com/buy0769/p/4580389.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!