要播放声音,可以这样:
using System.Runtime.InteropServices;[DllImport("winmm.dll")] 
public static extern long PlaySound(String fileName,long a,long b);在点击按钮的事件中添加:
PlaySound("aaa.wav",0,0);//播放声音当你按特定键时候,在相应的事件中调用一下相应的声音文件就可以了。

解决方案 »

  1.   

    我用过,是东进公司的语音卡(http://www.dj.com),可以用vb,delphi,c++,powerbuild.开发我用c#也开发过,但有的函数返回值不对头。当按键时产生的语音是事先录制好的语音文件比通过语音卡截获DTMF码来获的按键值。难度不大就看你对这些函数的掌握程度.
      

  2.   

    声音都是录好的,
    通过程序调用,不难的问题
    你可以做个类似的程序,用playsound()来播放声音文件
      

  3.   

    To hjwzr :
    能不能把你用C#开发的语音卡拿出来给大家看看啊,我发分啊.
      

  4.   

    以下是用C#写的语音卡代码,不过有些地方还有BUG
    请高手多多指教。
    我们的目标是:共同进步!
    //-------------------------------------------
    using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;
    using System.Runtime.InteropServices;
    namespace yuying
    {
    /// <summary>
    /// Form1 的摘要说明。
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Timer timer1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.Button button3;
    private System.Windows.Forms.Button button4;
    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Label label2;
    private System.ComponentModel.IContainer components; public Form1()
    {
    //
    // Windows 窗体设计器支持所必需的
    //

    InitializeComponent(); //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    //
    } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if (components != null) 
    {
    components.Dispose();
    }
    }
    base.Dispose( disposing );
    } #region Windows 窗体设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.components = new System.ComponentModel.Container();
    this.button1 = new System.Windows.Forms.Button();
    this.timer1 = new System.Windows.Forms.Timer(this.components);
    this.button2 = new System.Windows.Forms.Button();
    this.button3 = new System.Windows.Forms.Button();
    this.button4 = new System.Windows.Forms.Button();
    this.groupBox1 = new System.Windows.Forms.GroupBox();
    this.label1 = new System.Windows.Forms.Label();
    this.label2 = new System.Windows.Forms.Label();
    this.groupBox1.SuspendLayout();
    this.SuspendLayout();
    // 
    // button1
    // 
    this.button1.BackColor = System.Drawing.SystemColors.Desktop;
    this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
    this.button1.ForeColor = System.Drawing.SystemColors.Info;
    this.button1.Location = new System.Drawing.Point(280, 240);
    this.button1.Name = "button1";
    this.button1.Size = new System.Drawing.Size(72, 24);
    this.button1.TabIndex = 0;
    this.button1.Text = "初始化";
    this.button1.Click += new System.EventHandler(this.button1_Click);
    // 
    // timer1
    // 
    this.timer1.Interval = 10;
    this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
    // 
    // button2
    // 
    this.button2.BackColor = System.Drawing.SystemColors.Desktop;
    this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
    this.button2.ForeColor = System.Drawing.SystemColors.Info;
    this.button2.Location = new System.Drawing.Point(8, 240);
    this.button2.Name = "button2";
    this.button2.Size = new System.Drawing.Size(72, 24);
    this.button2.TabIndex = 1;
    this.button2.Text = "退出";
    this.button2.Click += new System.EventHandler
      

  5.   

    这种功能,很早就有语音卡,(我有过一种VBvoice,Canada Mode),你只要录音就可以了
    当然,你还要做一点点代码~~~
      

  6.   

    麻烦发到我邮箱,谢谢!!!![email protected]