• 大小: 1.98MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-25
  • 语言: 其他
  • 标签: 语音  websocket  net  c#  

资源简介

基于websocket技术实现的语音叫号功能!!!!!!!!!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using SuperSocket.Common;
using SuperSocket.Socketbase;
using SuperSocket.Socketbase.Config;
using SuperSocket.SocketEngine;
using SuperSocket.Socketbase.Logging;
using SuperWebSocket;
using log4net;
using System.Speech.Synthesis;
using System.Threading;
using System.IO;
using System.Collections.Specialized;
using Server.Common;
using System.Collections;
using SuperWebSocket.Protocol;
namespace Server
{
    public partial class FrmMain : Form
    {
        #region 属性
        private SpeechSynthesizer speech;
        private ContextMenu notifyiconMnu;
        //音量
        private int volume = Server.Properties.Settings.Default.volume;

        //语速
        private int rate = Server.Properties.Settings.Default.rate;

        //语音
        private string voice = Server.Properties.Settings.Default.voice;

        //频次
        private int frequency = Server.Properties.Settings.Default.frequency;

        //频次间隔
        private int frequencyInterval = Server.Properties.Settings.Default.frequencyInterval;

        //自动播放标识(0 不自动 1 自动)
        private int autoPlayFlag = Server.Properties.Settings.Default.autoPlayFlag;

        //是否使用默认播放(0 不使用 1 使用)
        private int openDefaultAudio = Server.Properties.Settings.Default.openDefaultAudio;

        //提示音
        private string promptPath = “Notify.wav“;//.wav音频文件路径
        private System.Media.SoundPlayer player;
        private Thread t;
        WebSocketServer appServer = new WebSocketServer();
        ServerConfig serverConfig = new ServerConfig
        {
            Port = Server.Properties.Settings.Default.port//set the listening port
            MaxConnectionNumber = 10000
        };
        #endregion

        #region 初始化
        public FrmMain()
        {
            try
            {
                InitializeComponent();
                Control.CheckForIllegalCrossThreadCalls = false;
                setFrequencyCombo();
                setRateCombo();
                setVolumeCombo();
                setVoiceCombo();

                if (this.autoPlayFlag == 1)
                {
                    checkBox1.Checked = true;
                }
                else {
                    checkBox1.Checked = false;
                }
                checkBox1_CheckedChanged(nullnull);
                


                foreach (myComItem t in this.comboBox1.Items)
                {
                    if (t.text.ToString() == this.rate.ToString())
                    {
                        this.comboBox1.SelectedItem = t;
                        break;
                    }
                }
                
                foreach (myComItem t in this.comboBox3.Items)
                {
     

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-31 17:13  Server\
     目录           0  2018-07-31 17:13  Server\Common\
     文件        5679  2018-07-31 17:13  Server\Common\funTools.cs
     文件        4219  2018-07-31 17:13  Server\Common\logTools.cs
     文件         402  2018-07-31 17:13  Server\Common\myComItem.cs
     目录           0  2018-07-31 17:13  Server\Config\
     文件        3002  2018-07-31 17:13  Server\Config\log4net.config
     文件        3007  2018-07-31 17:13  Server\Config\log4net.unix.config
     文件       15660  2018-07-31 17:13  Server\FrmMain.Designer.cs
     文件       31428  2018-07-31 17:13  Server\FrmMain.cs
     文件       19553  2018-07-31 17:13  Server\FrmMain.resx
     文件        1090  2018-07-31 17:13  Server\Program.cs
     目录           0  2018-07-31 17:13  Server\Properties\
     文件        1354  2018-07-31 17:13  Server\Properties\AssemblyInfo.cs
     文件        2864  2018-07-31 17:13  Server\Properties\Resources.Designer.cs
     文件        5612  2018-07-31 17:13  Server\Properties\Resources.resx
     文件        4009  2018-07-31 17:13  Server\Properties\Settings.Designer.cs
     文件        1376  2018-07-31 17:13  Server\Properties\Settings.settings
     文件        6032  2018-07-31 17:13  Server\Server.csproj
     目录           0  2018-07-31 17:13  Server\UsingDll\
     文件      397312  2018-07-31 17:13  Server\UsingDll\Newtonsoft.Json.dll
     文件       37888  2018-07-31 17:13  Server\UsingDll\SuperSocket.Common.dll
     文件      111104  2018-07-31 17:13  Server\UsingDll\SuperSocket.Socketbase.dll
     文件      103424  2018-07-31 17:13  Server\UsingDll\SuperSocket.SocketEngine.dll
     文件       71168  2018-07-31 17:13  Server\UsingDll\SuperWebSocket.dll
     文件      393216  2018-07-31 17:13  Server\UsingDll\System.Threading.dll
     文件      290816  2018-07-31 17:13  Server\UsingDll\log4net.dll
     文件        1653  2018-07-31 17:13  Server\app.config
     目录           0  2018-07-31 17:31  Server\bin\
     目录           0  2018-07-31 17:31  Server\bin\Debug\
     文件      397312  2018-07-31 17:13  Server\bin\Debug\Newtonsoft.Json.dll
............此处省略41个文件信息

评论

共有 条评论