当前位置:编程学习 > C#/ASP.NET >>

在c#中如何控制声音?

如何才能实现按钮控件在使用时伴有声音? --------------------编程问答-------------------- 用事件呀 --------------------编程问答-------------------- 重写 onclick  --------------------编程问答-------------------- System.Media.SoundPlayer sndPlayer = new System.Media.SoundPlayer(Application.StartupPath+@"/a.wav");
sndPlayer.PlayLooping();

SpeechLib.SpVoiceClass pp = new SpeechLib.SpVoiceClass();
DllImport("winmm.dll",   SetLastError=true,   CallingConvention=CallingConvention.Winapi)]   
  public   static   extern   int   waveOutSetVolume(int   uDeviceID,   int   dwVolume);   
int left,right,dwVolume;
            right = 3; //右声道
            left = 60; //左声道
            dwVolume = (left << 8) | right; 
            waveOutSetVolume(0, i); --------------------编程问答-------------------- 在设计界面的按钮上双击一下,会自动跳转到一个函数里面,你在里面添加你自己的代码,当程序运行的时候,只要按钮被点击,就会运行你的代码.. ....

好吧,我承认,上面全是废话...

http://edu.codepub.com/2009/1008/16223.php
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,