语音提示(帮忙!!!剧给分)

wangke1220 2003-10-13 04:59:13
大家用过手机1861自动台或200卡之类就知道,当你按特定键时候,就会有语音提示,这是怎么实现的???

一个好奇的菜鸟
...全文
144 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangke1220 2003-10-19
  • 打赏
  • 举报
回复
麻烦发到我邮箱,谢谢!!!!wangke1220@163.com
monter 2003-10-15
  • 打赏
  • 举报
回复
这种功能,很早就有语音卡,(我有过一种VBvoice,Canada Mode),你只要录音就可以了
当然,你还要做一点点代码~~~
aukawa 2003-10-15
  • 打赏
  • 举报
回复
关注,学习,up
nean 2003-10-15
  • 打赏
  • 举报
回复
nean@vip.sina.com
thx!
wangke1220 2003-10-14
  • 打赏
  • 举报
回复
wangke1220@163.com
hjwzr 2003-10-14
  • 打赏
  • 举报
回复
这是简单的内线的振铃的代码,要完整的VB原代码和函数说明。把邮箱留下
hjwzr 2003-10-14
  • 打赏
  • 举报
回复
(this.button2_Click);
//
// button3
//
this.button3.BackColor = System.Drawing.SystemColors.Desktop;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button3.ForeColor = System.Drawing.SystemColors.Info;
this.button3.Location = new System.Drawing.Point(200, 240);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(72, 24);
this.button3.TabIndex = 2;
this.button3.Text = "振 铃";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.BackColor = System.Drawing.SystemColors.Desktop;
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button4.ForeColor = System.Drawing.SystemColors.Info;
this.button4.Location = new System.Drawing.Point(120, 240);
this.button4.Name = "button4";
this.button4.TabIndex = 3;
this.button4.Text = "停止振铃";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(0, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(352, 88);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "信息";
//
// label1
//
this.label1.BackColor = System.Drawing.SystemColors.ControlDark;
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.label1.ForeColor = System.Drawing.SystemColors.HighlightText;
this.label1.Location = new System.Drawing.Point(8, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(336, 16);
this.label1.TabIndex = 0;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.BackColor = System.Drawing.SystemColors.Desktop;
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label2.ForeColor = System.Drawing.SystemColors.Info;
this.label2.Location = new System.Drawing.Point(8, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(336, 16);
this.label2.TabIndex = 1;
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(354, 273);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "四方科技语音内线呼叫程序";
this.Load += new System.EventHandler(this.Form1_Load);
this.Closed += new System.EventHandler(this.FormClose);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
//
Application.Run(new Form1());
}

class DJdll
{

public long DriverOpenFlag;


[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern long LoadDRV();
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern void FeedRealRing(WORD wChnlNo);
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern long EnableCard(int wUsedCh, int wFileBufLen);
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern long CheckValidCh();
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern void FreeDRV();
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern void FeedPower(long wChnlNo);
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern void DisableCard();
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern void FeedSigFunc();
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern bool OffHookDetect(long wChnlNo);
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern long SetLink ( long wOne, long wAnother);
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern void StartHangUpDetect (long wChnlNo);
[DllImport("C:\\WINNT\\system32\\Tc08a32.dll")]public static extern long HangUpDetect (long wChnlNo);

}
private void button1_Click(object sender, System.EventArgs e)
{
DJdll b1=new DJdll();
b1.DriverOpenFlag = DJdll.LoadDRV(); //---初始化设备驱动程序。
if(b1.DriverOpenFlag==1)
{
MessageBox.Show("Load driver FAIL");
return;
}
this.button3.Enabled=true;
this.button1.Enabled=false;
this.label1.Text="***初始化成功!***";
// TotalLine = hjw.CheckValidCh();
// n=hjw.EnableCard(TotalLine, 1024 * 8);
// if(n!= 0){
// hjw.FreeDRV();
// MessageBox.Show("Enable Card FAIL");
// }
}

private void button2_Click(object sender, System.EventArgs e)
{
Application.Exit();
}

private void FormClose(object sender, System.EventArgs e){
DJdll b2=new DJdll();
if(b2.DriverOpenFlag == 0){
DJdll.FeedPower(7); //---对某一路内线通道馈电,同时停止馈铃流。
DJdll.DisableCard(); //---关闭电话卡的硬件,释放缓冲区。程序结束(包括正常和不正常退出)时需调用此函数。
DJdll.FreeDRV(); //---关闭驱动程序
}
}

private void button3_Click(object sender, System.EventArgs e)
{
DJdll.FeedRealRing(7); //---对某一路内线通道馈断续的铃流。断续的时间长度为响铃0.75秒,停止3秒。
this.timer1.Enabled=true;
}

private void timer1_Tick(object sender, System.EventArgs e)
{
//----该过程是在Timer里不断调用FeedSigFunc()函数来实现振铃
long DetectBZ;
DJdll.FeedSigFunc();
if(DJdll.OffHookDetect(7)==true)
MessageBox.Show("摘机!");
DJdll.StartHangUpDetect(7);
DetectBZ=DJdll.HangUpDetect(7);
switch (DetectBZ)
{
case 0:
this.label2.Text="没有挂机";
break;
case 1:
this.label2.Text="已经挂机";
break;
case 2:
this.label2.Text="开始挂机";
break;
case 3:
this.label2.Text="拍了一下叉簧";
break;
}
}

private void button4_Click(object sender, System.EventArgs e)
{
//----停止振铃的过程
DJdll.FeedPower(7);
}

private void Form1_Load(object sender, System.EventArgs e)
{
this.button3.Enabled=false;
this.label1.Text="未初始化!";
}
}
}
hjwzr 2003-10-14
  • 打赏
  • 举报
回复
以下是用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
大户翁 2003-10-13
  • 打赏
  • 举报
回复

我想是通过 语音的频率组合 产生
wangke1220 2003-10-13
  • 打赏
  • 举报
回复
To hjwzr :
能不能把你用C#开发的语音卡拿出来给大家看看啊,我发分啊.
kuangren 2003-10-13
  • 打赏
  • 举报
回复
声音都是录好的,
通过程序调用,不难的问题
你可以做个类似的程序,用playsound()来播放声音文件
hjwzr 2003-10-13
  • 打赏
  • 举报
回复
网址错了是http://www.dj.com.cn
hjwzr 2003-10-13
  • 打赏
  • 举报
回复
我用过,是东进公司的语音卡(http://www.dj.com),可以用vb,delphi,c++,powerbuild.开发我用c#也开发过,但有的函数返回值不对头。当按键时产生的语音是事先录制好的语音文件比通过语音卡截获DTMF码来获的按键值。难度不大就看你对这些函数的掌握程度.
LineCorner 2003-10-13
  • 打赏
  • 举报
回复
用语英卡!现在很多公司有买!
在它基础上开发!
qiuji 2003-10-13
  • 打赏
  • 举报
回复
要播放声音,可以这样:
using System.Runtime.InteropServices;

[DllImport("winmm.dll")]
public static extern long PlaySound(String fileName,long a,long b);

在点击按钮的事件中添加:
PlaySound("aaa.wav",0,0);//播放声音

当你按特定键时候,在相应的事件中调用一下相应的声音文件就可以了。
wangke1220 2003-10-13
  • 打赏
  • 举报
回复
有谁做过这方面的吗?现在大家都只是猜想啊.
softye 2003-10-13
  • 打赏
  • 举报
回复
我的象是:
0-9每个字录一次音 每接一次建服务器就记录这次接建的数字 当你按#字建时 表示你的卡号已输完 服务器最后集中处理 通过按键0-9调语音组合 最后传送给客户端!!不知道是不是这样
chainet 2003-10-13
  • 打赏
  • 举报
回复
想象中应该很简单。
按键--服务器处理--调用存储好的声音文件--播放--客户收听。
niaoren 2003-10-13
  • 打赏
  • 举报
回复
应该是录制好了的
调用一下而已,不会是电脑发音

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧