码迷,mamicode.com
首页 > Windows程序 > 详细

wince mobile环境下播放WAV声音

时间:2015-06-16 13:00:55      阅读:280      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!