zoukankan      html  css  js  c++  java
  • C# 数字语音wav 提示。。。。。。。。。。。

    https://files.cnblogs.com/Fooo/Net-数字语音wav.rar

     

    https://files.cnblogs.com/Fooo/wav.rar

    ///////////***************************

    using System.Media;

           SoundPlayer win;
            public Form1()
            {
                InitializeComponent();
            }

            private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
            {
                win = null;
                int keyAscii = (int)e.KeyChar;
                this.label1.Text = keyAscii.ToString();
                switch (keyAscii)
                {
                   //win = new SoundPlayer(Application.StartupPath + @"\2.wav");  //相对路径写法 
                    case 48:
                        win=new SoundPlayer(Properties.Resources._0);
                        break;
                    case 49:
                        win = new SoundPlayer(Properties.Resources._1);                  
                        break;
                    case 50:
                        win = new SoundPlayer(Properties.Resources._2);
                        break;
                    case 51:
                        win = new SoundPlayer(Properties.Resources._3);
                        break;
                    case 52:
                        win = new SoundPlayer(Properties.Resources._4);
                        break;
                    case 53:
                        win = new SoundPlayer(Properties.Resources._5);
                        break;

                    case 54:
                        win = new SoundPlayer(Properties.Resources._6);
                        break;
                    case 55:
                        win = new SoundPlayer(Properties.Resources._7);
                        break;
                    case 56:
                        win = new SoundPlayer(Properties.Resources._8);
                        break;
                    case 57:
                        win = new SoundPlayer(Properties.Resources._9);
                        break;
                    default:
                        break;

                }
                if (win != null)
                win.Play();
            }

  • 相关阅读:
    【C++】C++代码动态检查
    【加解密】使用CFSSL生成证书并使用gRPC验证证书
    分库分表下跨库join解决方案
    解决1235
    为什么v-for中的key值不推荐使用index
    弹性布局公共样式总结
    关于python的模块
    [转]Ubuntu18.04安装uwsgi错误:error: lto-wrapper failed collect2: error: ld returned 1 exit status
    python 坐标遍历 生成笛卡尔积矩阵
    Mongo BsonUndefined 转换问题(自定义Mongo类型转换器)
  • 原文地址:https://www.cnblogs.com/Fooo/p/1432672.html
Copyright © 2011-2022 走看看