999国内精品永久免费视频,色偷偷9999www,亚洲国产成人爱av在线播放,6080亚洲人久久精品,欧美超高清xxxhd

首頁 新聞 工控搜 論壇 廠商論壇 產(chǎn)品 方案 廠商 人才 文摘 下載 展覽
中華工控網(wǎng)首頁
  P L C | 變頻器與傳動 | 傳感器 | 現(xiàn)場檢測儀表 | 工控軟件 | 人機(jī)界面 | 運(yùn)動控制
  D C S | 工業(yè)以太網(wǎng) | 現(xiàn)場總線 | 顯示調(diào)節(jié)儀表 | 數(shù)據(jù)采集 | 數(shù)傳測控 | 工業(yè)安全
  電 源 | 嵌入式系統(tǒng) | PC based | 機(jī)柜箱體殼體 | 低壓電器 | 機(jī)器視覺
語音卡應(yīng)用編程實(shí)例
中華工控網(wǎng)
收藏本文     查看收藏
語音卡應(yīng)用編程實(shí)例</P><P> 通訊地址:遼河油田油建二公司人教科張輝 郵編:124012 <BR> 電子郵件:zhanghui@lh.cnpc.com.cn</P><P> 目前電話語音產(chǎn)品已在各方面得到廣泛應(yīng)用,常用的語音卡具有4線或8線通道,可以同時(shí)處理4線或8線電話的請求。以下介紹利用語音卡實(shí)現(xiàn)計(jì)算機(jī)自動應(yīng)答的醫(yī)療及養(yǎng)老帳戶金語音查詢系統(tǒng)。<BR> 系統(tǒng)功能<BR> 當(dāng)外線電話打入時(shí),計(jì)算機(jī)自動檢測到振鈴信號,并開始播放提示音,同時(shí)開始接收用戶的電話按鍵信息。用戶通過電話按鍵選擇查詢類別、輸入身份證號碼、查詢年度,計(jì)算機(jī)根據(jù)接收的信息從后臺ORACLE數(shù)據(jù)庫中取得查詢結(jié)果數(shù)據(jù),并將相應(yīng)帳戶金額數(shù)據(jù)進(jìn)行語音合成,再通過語音卡的相應(yīng)外線電話通道播放查詢結(jié)果,例如:"姓名張三 年度1999您的醫(yī)療帳戶金余額是一千二百三十四元五角六分 上年利息一百二十三元 統(tǒng)籌金劃入二十三元四角 個(gè)人繳納二十八元五角 帳戶內(nèi)報(bào)銷八百零八元八角八分"。用戶端電話接聽所查帳戶數(shù)據(jù)的語音信號。<BR> 編程思路<BR> 系統(tǒng)應(yīng)劃分為6個(gè)運(yùn)行階段:<BR> 1、 初始化語音卡、連接數(shù)據(jù)庫,等待外線電話打入。檢測到振鈴后進(jìn)入下一階段。<BR> 2、 接收用戶選擇的查詢類別。<BR> 播放提示音:"歡迎使用,查詢醫(yī)療帳戶請撥1,查詢養(yǎng)老帳戶請撥2,查詢離退休金請撥3"。用戶選擇1-3后進(jìn)入下一階段。默認(rèn)選擇為1。<BR> 3、 接收用戶輸入的身份證號碼。<BR> 播放提示音:"請您輸入身份證號碼"。用戶輸入后,系統(tǒng)判斷數(shù)據(jù)庫中是否存在此身份證號碼,如果存在,則進(jìn)入下一階段。否則提示重新輸入。<BR> 4、 接收用戶輸入查詢年度。<BR> 播放提示音:"請您輸入查詢年度"。用戶輸入后,生成查詢條件,取得查詢數(shù)據(jù)。進(jìn)入下一階段。<BR> 5、 合成及播放姓名語音。<BR> 6、 帳戶金數(shù)額語音合成及播放。<BR> 具體實(shí)現(xiàn)<BR> 由于電話語音卡的編程接口以windows動態(tài)鏈接庫(TW8VID32.DLL)方式提供,可以使用目前常用的可視化開發(fā)工具,如:delphi ,vb, pb, visual c++等。下面以PB環(huán)境舉例說明。<BR> 首先建立一個(gè)新的application ,一個(gè)新的窗口yyk,在application的open事件中,連接后臺ORACLE數(shù)據(jù)庫,并對語音卡進(jìn)行初始化。設(shè)置窗口的定時(shí)器。也可以在窗口yyk中設(shè)置一些代表各個(gè)通道當(dāng)前狀態(tài)的提示文本,在系統(tǒng)響應(yīng)用戶按鍵時(shí)可以隨時(shí)更新提示文本,以反映各通道的工作狀態(tài)。</P><P> 函數(shù)聲明Global external functions ,以及常量定義<BR> FUNCTION int TV_Installed() library "tw8vid32.dll"<BR> SUBROUTINE TV_Initialize() library "tw8vid32.dll" <BR> SUBROUTINE TV_Disable() library"tw8vid32.dll" <BR> FUNCTION int TV_ChannelType(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_OffHookDetect(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_RingDetect(int chno) library"tw8vid32.dll"<BR> ......................略<BR> 詳細(xì)的函數(shù)聲明附錄在最后。</P><P> 定義結(jié)構(gòu)ch_stru<BR> { string Fname //通道放音文件名<BR> int wstate //通道狀態(tài)<BR> int jieduan //運(yùn)行階段<BR> int cx_select //查詢類型<BR> string sfzhm //身份證號碼<BR> string nd //查詢年度<BR> string xingmin //姓名<BR> string sentence //通道放音字符 }</P><P> 定義全局變量ch_stru channel[8]<BR> int chnum<BR> 定義application的open事件<BR> integer i<BR> string ls_startupfile <BR> l_startupfile = "yyk.ini"<BR> //設(shè)置數(shù)據(jù)庫事務(wù)對象參數(shù)<BR> sqlca.DBMS = ProfileString (l_startupfile, "database", "dbms", "")<BR> sqlca.database = ProfileString (l_startupfile, "database", "database", "")<BR> sqlca.userid = ProfileString (l_startupfile, "database", "userid", "")<BR> sqlca.dbpass = ProfileString (l_startupfile, "database", "dbpass", "")<BR> sqlca.logid = ProfileString (l_startupfile, "database", "logid", "")<BR> sqlca.logpass = ProfileString (l_startupfile, "database", "LogPassWord", "")<BR> sqlca.servername = ProfileString (l_startupfile, "database", "servername", "")<BR> sqlca.dbparm = ProfileString (l_startupfile, "database", "dbparm", "")<BR> connect; //連接數(shù)據(jù)庫<BR> if sqlca.sqlcode <> 0 then<BR> MessageBox ("不能連通數(shù)據(jù)庫", sqlca.sqlerrtext)<BR> return<BR> end if<BR> open(yyk)<BR> if timer(0.06,yyk)=-1 then<BR> MessageBox ("錯(cuò)誤提示","設(shè)置定時(shí)器失敗, 程序不能執(zhí)行!")<BR> return<BR> end if<BR> chnum=tv_installed()<BR> if chnum<=0 then<BR> MessageBox ("錯(cuò)誤提示","未安裝語音卡!")<BR> else<BR> tv_initialize() //初始化語音卡<BR> if chnum>8 then<BR> chnum=8<BR> end if<BR> initchannel () //初始化各通道<BR> end if<BR> //application的open事件定義結(jié)束</P><P> 定義函數(shù)initchannel (),初始化各通道結(jié)構(gòu)channel[i]<BR> for i=1 to 8 <BR> channel[i].FName="welcome.tw"<BR> channel[i].wstate=WS_FREE<BR> channel[i].jieduan=1<BR> channel[i].cx_select=1<BR> channel[i].sfzhm=''<BR> channel[i].nd=''<BR> channel[i].xingmin=''<BR> channel[i].sentence=" "<BR> if i>chnum then<BR> channel[i].chtype = CT_EMPTY<BR> else<BR> channel[i].chtype=tv_channelType(i -1) //判斷通道類型,外線或內(nèi)線或空<BR> end if<BR> next<BR> //退出應(yīng)用時(shí),使語音卡無效。<BR> if chnum>0 then<BR> tv_disable()<BR> end if<BR> disconnect using sqlca ; //取消連接數(shù)據(jù)庫</P><P> //在窗口yyk的timer事件中處理各通道的請求<BR> int i<BR> for i=1 to chnum<BR> if channel[i].chtype=1 then<BR> //如果是外線通道,處理請求<BR> externalyyk (i) //自定義函數(shù)<BR> end if<BR> next</P><P> 自定義函數(shù)externalyyk (int chno)定義如下:<BR> // 函數(shù)externalyyk ()開始<BR> long retval<BR> integer DtmfVal,temp<BR> unsignedinteger sigtype<BR> double num<BR> string strRet, password,yyk_path,xm_temp<BR> CHOOSE CASE channel[chno].jieduan<BR> case 1 //選擇查詢類別<BR> <BR> CHOOSE CASE channel[chno].wstate<BR> CASE WS_FREE<BR> if tv_ringdetect(chno -1) > 1 then //檢測到振鈴<BR> channel[chno].wstate=WS_STARTFILE<BR> tv_offhookctrl(chno -1) //控制摘機(jī)<BR> tv_flushdtmf(chno -1) //清空某通道的雙音多頻碼(dtmf)<BR> end if<BR> case WS_STARTFILE<BR> //開始播放提示音,"歡迎使用,查詢醫(yī)療帳戶請撥1,查詢養(yǎng)老帳戶......" <BR> f_start_file(chno,WS_ONFILE) <BR> //自定義函數(shù)f_start_file(int chno ,int next_state) 定義如下:<BR> // long retval<BR> //啟動某通道文件放音<BR> // retval=tv_startplayfile(ch_no -1,channel[ch_no].FName,0,300000)<BR> // if retval<=0 then<BR> // tv_hangupctrl(ch_no -1) //如果啟動放音失敗則掛斷<BR> // channel[ch_no].wstate=WS_FREE<BR> // channel[ch_no].jieduan=1<BR> // 設(shè)置提示音文件<BR> // channel[ch_no].FName="welcome.tw"<BR> // else<BR> // 否則改變通道狀態(tài)標(biāo)志<BR> // channel[ch_no].wstate=next_state<BR> // end if<BR> // <BR> // return 1<BR> case WS_ONFILE<BR> //如果檢測到忙音,則停止放提示音,并控制掛斷。<BR> if tv_monitorbusy(chno -1,SIG_BUSY1,5)<>0 or tv_monitorbusy(chno -1,SIG_BUSY2,5)<>0 then<BR> tv_stopplayfile(chno -1)<BR> channel[chno].wstate=WS_FREE<BR> tv_hangupctrl(chno -1)<BR> channel[chno].jieduan=1<BR> else<BR> //否則繼續(xù)播放剩余提示音<BR> retval=tv_playfilerest(chno -1)<BR> if retval<=0 then //如果提示音播放完畢<BR> //設(shè)置等待接收雙音多頻碼DTMF的時(shí)間為35秒<BR> tv_starttimer(chno -1,35) <BR> //準(zhǔn)備轉(zhuǎn)到接收雙音多頻碼DTMF<BR> channel[chno].wstate=WS_WAITDTMF<BR> else<BR> DtmfVal=tv_getdtmfchar(chno -1) //檢測用戶按鍵信息<BR> if DtmfVal<>-1 then<BR> tv_stopplayfile(chno -1) //檢測到按鍵,停止播放提示音<BR> channel[chno].wstate=WS_WAITDTMF<BR> if char(DtmfVal)<>'*' and char(DtmfVal)<>'#' then<BR> channel[chno].DtmfStr=""<BR> channel[chno].DtmfStr=channel[chno].dtmfstr+char(dtmfval)<BR> if len(channel[chno].dtmfstr)>=1 then<BR> channel[chno].wstate=WS_STARTFILE<BR> channel[chno].jieduan=2 //準(zhǔn)備轉(zhuǎn)到身份證輸入部分<BR> channel[chno].FName="srsfzhm.tw" //設(shè)置提示音文件,提示輸入身份證<BR> if integer(left(channel[chno].dtmfstr,1)) > 3 or integer(left(channel[chno].dtmfstr,1)) < 1 then<BR> channel[chno].cx_select=1 //默認(rèn)選擇為1<BR> else<BR> channel[chno].cx_select=integer(left(channel[chno].dtmfstr,1))<BR> end if<BR> end if<BR> end if<BR> end if<BR> end if<BR> end if<BR> case WS_WAITDTMF<BR> DtmfVal=tv_getdtmfchar(chno -1) //檢測用戶按鍵信息<BR> if DtmfVal<>-1 then //檢測到按鍵<BR> channel[chno].wstate=WS_WAITDTMF<BR> if char(DtmfVal)<>'*' and char(DtmfVal)<>'#' then<BR> channel[chno].DtmfStr=""<BR> channel[chno].DtmfStr=channel[chno].dtmfstr+char(dtmfval)<BR> if len(channel[chno].dtmfstr)>=1 then<BR> channel[chno].wstate=WS_STARTFILE<BR> channel[chno].jieduan=2 //準(zhǔn)備轉(zhuǎn)到接收身份證號部分<BR> channel[chno].FName="srsfzhm.tw" //設(shè)置放音文件名,提示輸入身份證號碼<BR> if integer(left(channel[chno].dtmfstr,1)) > 3 or integer(left(channel[chno].dtmfstr,1)) < 1 then<BR> channel[chno].cx_select=1 //默認(rèn)選擇為1(查詢醫(yī)療帳戶)<BR> else<BR> channel[chno].cx_select=integer(left(channel[chno].dtmfstr,1))<BR> end if<BR> end if<BR> end if <BR> <BR> else //未檢測到用戶按鍵信息<BR> if tv_monitorbusy(chno -1,SIG_BUSY1,5)<>0 or tv_monitorbusy(chno -1,SIG_BUSY2,5)<>0 then<BR> channel[chno].wstate=WS_FREE //檢測到忙音,掛機(jī),改變通道狀態(tài)為空閑<BR> tv_hangupctrl(chno -1)<BR> else<BR> if tv_timerelapsed(chno -1)<0 then<BR> channel[chno].wstate=WS_FREE //等待接收Dtmf數(shù)據(jù)碼超時(shí),掛機(jī)<BR> tv_hangupctrl(chno -1)<BR> end if<BR> end if<BR> end if<BR> end choose<BR> case 2 //獲取身份證號部分<BR> <BR> CHOOSE CASE channel[chno].wstate<BR> case WS_STARTFILE<BR> f_start_file(chno,WS_ONFILE)<BR> case WS_ONFILE<BR> //........省略,與前面類似<BR> case WS_WAITDTMF<BR> //........省略,與前面類似<BR> case WS_GETDTMF<BR> //..............省略<BR> if len(channel[chno].dtmfstr)=15 then<BR> channel[chno].sfzhm=channel[chno].dtmfstr //得到身份證號碼(15位)<BR> //準(zhǔn)備轉(zhuǎn)到查詢數(shù)據(jù)庫中是否存在此身份證號部分<BR> channel[chno].wstate=WS_looksfzhmfromdb <BR> end if<BR> case WS_looksfzhmfromdb<BR> channel[chno].a1=0<BR> //判斷數(shù)據(jù)庫中是否存在所輸?shù)纳矸葑C號碼<BR> choose case channel[chno].cx_select<BR> case 1 //從數(shù)據(jù)庫中醫(yī)療帳戶表中查找<BR> //a1>=1表示數(shù)據(jù)庫中存在所輸?shù)纳矸葑C號碼<BR> channel[chno].a1=f_count_yiliao(channel[chno].sfzhm)<BR> case 2 //從數(shù)據(jù)庫中養(yǎng)老帳戶表中查找<BR> channel[chno].a1=f_count_yanglao(channel[chno].sfzhm)<BR> case 3 //從數(shù)據(jù)庫中離退休表中查找<BR> channel[chno].a1=f_count_lituixiu(channel[chno].sfzhm)<BR> end choose<BR> //如果數(shù)據(jù)庫中存在所輸?shù)纳矸葑C號碼<BR> if channel[chno].a1 >= 1 then<BR> //從數(shù)據(jù)庫中獲取姓名<BR> choose case channel[chno].cx_select<BR> case 3<BR> channel[chno].xingmin=f_getxingmin_lituixiu(chno)<BR> case 2<BR> channel[chno].xingmin=f_getxingmin_yanglao(chno)<BR> case 1<BR> channel[chno].xingmin=f_getxingmin_yiliao(chno)<BR> end choose<BR> channel[chno].wstate=WS_STARTFILE<BR> channel[chno].jieduan=4 //準(zhǔn)備轉(zhuǎn)到接收查詢年度部分<BR> channel[chno].FName="srnd.tw" //設(shè)置放音文件名,提示輸入查詢年度<BR> else<BR> //數(shù)據(jù)庫中不存在所輸?shù)纳矸葑C號碼<BR> channel[chno].wstate=WS_STARTFILE<BR> channel[chno].jieduan=2 //準(zhǔn)備轉(zhuǎn)到接收身份證號碼部分<BR> //設(shè)置放音文件名,身份證號碼有誤或?yàn)檎业,請重?lt;BR> channel[chno].FName="nosfzhm.tw" <BR> end if <BR> end choose<BR> case 4 //獲取年度部分<BR> CHOOSE CASE channel[chno].wstate <BR> case WS_STARTFILE<BR> f_start_file(chno,WS_ONFILE)<BR> case WS_ONFILE<BR> //........省略,與前面類似<BR> case WS_WAITDTMF<BR> //........省略,與前面類似<BR> case WS_GETDTMF<BR> //........省略,與前面類似<BR> channel[chno].dtmfstr=channel[chno].dtmfstr+char(DtmfVal)<BR> if len(channel[chno].dtmfstr)=4 then //如果接收到四位代表年度的按鍵<BR> channel[chno].wstate=WS_retrievedatafromdb //轉(zhuǎn)到檢索數(shù)據(jù)部分<BR> end if<BR> case WS_retrievedatafromdb<BR> channel[chno].nd=channel[chno].dtmfstr //賦值年度<BR> if channel[chno].cx_select=1 then //查詢醫(yī)療帳戶<BR> if integer(left(channel[chno].dtmfstr,4)) < 1996 then<BR> channel[chno].dtmfstr='1996'<BR> channel[chno].nd='1996'<BR> end if<BR> if integer(left(channel[chno].dtmfstr,4)) > year(today()) then<BR> channel[chno].dtmfstr=string(today(),"yyyy")<BR> channel[chno].nd=string(today(),"yyyy")<BR> end if <BR> //檢索帳戶內(nèi)數(shù)據(jù),例如上年余額,利息,統(tǒng)籌金劃入,個(gè)人交納,帳戶內(nèi)報(bào)銷等<BR> f_getdata_yiliao(chno)<BR> //自定義函數(shù)f_getdata_yiliao(int i_chno)定義如下<BR> //real aa1,aa2,aa3,aa4,aa5,aa6<BR> //string sfz,s_nd<BR> //sfz=channel[i_chno].sfzhm<BR> //s_nd=channel[i_chno].nd<BR> // SELECT "QA39"."SNYE", <BR> // "QA39"."SNLX", <BR> // "QA39"."DWHR", <BR> // "QA39"."GRJN", <BR> // "QA39"."ZHNBX" <BR> // INTO :aa2, <BR> // :aa3, <BR> // :aa4, <BR> // :aa5, <BR> // :aa6 <BR> // FROM "QA39" <BR> // WHERE ( "QA39"."SFZHM" = :sfz ) AND <BR> // ( "QA39"."SJ" = :s_nd ) ;<BR> // aa1 = aa2 + aa3 + aa4 + aa5 - aa6 <BR> //channel[i_chno].a1=Round(aa1,2)<BR> //channel[i_chno].a2=Round(aa2,2)<BR> //channel[i_chno].a3=Round(aa3,2)<BR> //channel[i_chno].a4=Round(aa4,2)<BR> //channel[i_chno].a5=Round(aa5,2)<BR> //channel[i_chno].a6=Round(aa6,2)<BR> //return 1<BR> channel[chno].wstate=WS_STARTFILE <BR> channel[chno].jieduan=5 //準(zhǔn)備轉(zhuǎn)到播放姓名部分<BR> channel[chno].FName="ndxm.tw" //提示音文件,提示音"您的姓名"<BR> end if<BR> //養(yǎng)老帳戶機(jī)離退休金省略<BR> ....<BR> END CHOOSE<BR> case 5 //播放姓名語音<BR> CHOOSE CASE channel[chno].wstate<BR> CASE WS_STARTFILE<BR> //播放姓名語音"您的姓名"<BR> f_start_file(chno,WS_ONFILE)<BR> case WS_ONFILE<BR> f_on_file(chno,WS_startoutputxingmin)<BR> //自定義函數(shù)f_on_file(int ch_no,int next_state)定義如下:<BR> //long retval<BR> // if tv_monitorbusy(ch_no -1,SIG_BUSY1,5)<>0 or tv_monitorbusy(ch_no -1,SIG_BUSY2,5)<>0 then<BR> // tv_stopplayfile(ch_no -1)<BR> // channel[ch_no].wstate=WS_FREE<BR> // tv_hangupctrl(ch_no -1)<BR> // channel[ch_no].jieduan=1<BR> // channel[ch_no].FName="welcome.tw"<BR> // else<BR> // retval=tv_playfilerest(ch_no -1) //繼續(xù)播放剩余提示音<BR> // if retval<=0 then<BR> // channel[ch_no].wstate=next_state<BR> // end if<BR> // end if<BR> // return 1<BR> CASE WS_startoutputxingmin<BR> password="12345678" //語音合成庫口令<BR> yyk_path="" //語音合成庫路徑,當(dāng)前路徑<BR> temp=PasswordDetect(password,yyk_path)<BR> if temp < 0 then //如果語音合成庫出錯(cuò),則掛機(jī)<BR> tv_hangupctrl(chno -1)<BR> channel[chno].wstate=WS_FREE<BR> channel[chno].jieduan=1<BR> channel[chno].FName="welcome.tw"<BR> else<BR> xm_temp=trim(channel[chno].xingmin)<BR> retval=TV_StartPlayCh(chno -1,xm_temp) //播放姓名語音<BR> if retval < 0 then //如果播放姓名語音出錯(cuò),掛機(jī)<BR> tv_hangupctrl(chno -1)<BR> channel[chno].wstate=WS_FREE<BR> channel[chno].jieduan=1<BR> channel[chno].FName="welcome.tw"<BR> else<BR> channel[chno].wstate=WS_onoutputxingmin<BR> end if<BR> end if<BR> case WS_onoutputxingmin<BR> if tv_monitorbusy(chno -1,SIG_BUSY1,5)<>0 or tv_monitorbusy(chno -1,SIG_BUSY2,5)<>0 then<BR> tv_stopplaych(chno -1)<BR> channel[chno].wstate=WS_FREE<BR> tv_hangupctrl(chno -1)<BR> channel[chno].jieduan=1<BR> channel[chno].FName="welcome.tw"<BR> else<BR> retval=tv_playchrest(chno -1) //繼續(xù)播放姓名語音剩余部分<BR> if retval<=0 then //播放姓名語音完畢<BR> choose case channel[chno].cx_select<BR> case 1 //yiliao<BR> channel[chno].wstate=WS_yiliao_nd<BR> channel[chno].jieduan=7 //準(zhǔn)備轉(zhuǎn)到播放醫(yī)療帳戶數(shù)據(jù)部分<BR> channel[chno].FName="nd.tw" //設(shè)置放音文件名,提示所查年度<BR> case 2 <BR> .....<BR> case 3 <BR> .....<BR> end choose<BR> end if<BR> end if <BR> end choose<BR> case 6 //播放離退休金數(shù)據(jù)略</P><P> case 7 //播放醫(yī)療帳戶數(shù)據(jù)<BR> CHOOSE CASE channel[chno].wstate<BR> case WS_yiliao_nd<BR> f_start_file(chno,WS_yiliao_on_nd) //播放年度提示語音<BR> case WS_yiliao_on_nd <BR> f_on_file(chno,WS_yiliao_nd_data)<BR> case WS_yiliao_nd_data<BR> f_start_year(chno,channel[chno].nd,WS_yiliao_on_nd_data) //播放年度數(shù)據(jù)語音<BR> case WS_yiliao_on_nd_data <BR> f_onmoney(chno,WS_yiliao_a1,"ye.tw") <BR> //自定以函數(shù)f_onmoney(int ch_no,int next_state,string fname)如下: <BR> //long retval<BR> // if tv_monitorbusy(ch_no -1,SIG_BUSY1,5)<>0 or tv_monitorbusy(ch_no -1, SIG_BUSY2,5)<>0 then<BR> // channel[ch_no].wstate=WS_FREE<BR> // tv_stopplayfile(ch_no -1)<BR> // tv_hangupctrl(ch_no -1)<BR> // channel[ch_no].jieduan=1<BR> // channel[ch_no].FName="welcome.tw"<BR> // else<BR> // retval=tv_playsentencerest(ch_no -1) //繼續(xù)播放剩余的放音字符<BR> // if retval<=0 then<BR> // channel[ch_no].wstate=next_state<BR> // channel[ch_no].FName=fname<BR> // end if<BR> // end if<BR> // return 1 <BR> case WS_yiliao_a1 <BR> f_start_file(chno,WS_on_yiliao_a1)<BR> case WS_on_yiliao_a1<BR> f_on_file(chno,WS_yiliao_a1_data)<BR> case WS_yiliao_a1_data<BR> f_startmoney(chno,channel[chno].a1,WS_on_yiliao_a1_data)<BR> //自定以函數(shù)f_startmoney(int ch_no,real data_a,int next_state)如下:<BR> //long retval<BR> //double num<BR> // num=double(data_a)/1.0<BR> // 賦值生成的放音字符串,makemoney(num)對給定的數(shù)生成xx千x百X十X元X角X分放音字符<BR> // channel[ch_no].sentence=makemoney(num)<BR> // 播放帳戶金額語音<BR> // retval=tv_playsentence(ch_no -1,channel[ch_no].sentence)<BR> // if retval<=0 then // 播放帳戶金額語音失敗<BR> // channel[ch_no].wstate=WS_FREE<BR> // tv_hangupctrl(ch_no -1)<BR> // channel[ch_no].jieduan=1<BR> // channel[ch_no].FName="welcome.tw"<BR> // else<BR> // channel[ch_no].wstate=next_state<BR> // end if<BR> // return 1<BR> //自定以函數(shù)makemoney(real num)<BR> //string strTmp<BR> //string strRet<BR> //double yuan, jiao, fen<BR> //if money=0 then<BR> // strRet=char(2)<BR> // strRet=strRet+char(19)<BR> // return strRet<BR> //end if<BR> //strRet=""<BR> //strTmp=space(60)<BR> //if money<0 then <BR> // strRet=strRet+char(18)<BR> // money=abs(money)<BR> //end if<BR> //yuan=truncate(money,0)<BR> //money=(money - yuan)*10.0<BR> //jiao=truncate(money,0)<BR> //money=(money - jiao)*10.0<BR> //fen = truncate(money,0)<BR> //if (yuan>0) then<BR> // tv_MakeSentence(yuan,strTmp) //生成多文件放音字符串<BR> // strRet=strRet + strTmp<BR> //// strRet=strRet + strTmp + char(19) //元<BR> //end if<BR> //if jiao=0 then <BR> // if fen>0 then<BR> // strRet=strRet+char(2)+char(fen+2)+char(21)<BR> // end if <BR> //else<BR> // strRet=strRet+char(jiao+2)+char(20) // 角<BR> // if fen>0 then<BR> // strRet=strRet+char(fen+2)+char(21) // 分 <BR> // end if <BR> //end if<BR> //return strRet <BR> case WS_on_yiliao_a1_data<BR> f_onmoney(chno,WS_yiliao_a2,"snye.tw")<BR> //播放"上年余額"數(shù)據(jù)語音<BR> case WS_yiliao_a2 <BR> f_start_file(chno,WS_on_yiliao_a2)<BR> case WS_on_yiliao_a2<BR> f_on_file(chno,WS_yiliao_a2_data)<BR> case WS_yiliao_a2_data<BR> f_startmoney(chno,channel[chno].a2,WS_on_yiliao_a2_data)<BR> case WS_on_yiliao_a2_data<BR> f_onmoney(chno,WS_yiliao_a3,"snlx.tw")<BR> //播放"上年利息"數(shù)據(jù)語音等<BR> case WS_yiliao_a3 <BR> ....<BR> case WS_on_yiliao_a3_data<BR> retval=tv_playsentencerest(chno -1)<BR> if retval<=0 then<BR> channel[chno].wstate=WS_STARTFILE<BR> channel[chno].jieduan=1<BR> channel[chno].FName="welcome.tw"<BR> end if<BR> END CHOOSE <BR> case 8 //播放養(yǎng)老帳戶數(shù)據(jù)略<BR> END CHOOSE<BR> // 函數(shù)externalyyk ()結(jié)束<BR> 應(yīng)用效果<BR> 本系統(tǒng)已經(jīng)應(yīng)用于油田采油廠,方便了人們對帳戶金的查詢。無論距離多遠(yuǎn),僅需使用電話就可以得到所需信息,全天24小時(shí)隨時(shí)提供查詢服務(wù)。達(dá)到了系統(tǒng)設(shè)計(jì)要求,具有準(zhǔn)確性、易于操作的特點(diǎn)。</P><P> 附錄<BR> //設(shè)置函數(shù)聲明,設(shè)置系統(tǒng)常量<BR> FUNCTION int TV_Installed() library "tw8vid32.dll"<BR> SUBROUTINE TV_Initialize() library "tw8vid32.dll" <BR> SUBROUTINE TV_Disable() library"tw8vid32.dll" <BR> FUNCTION int TV_ChannelType(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_OffHookDetect(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_RingDetect(int chno) library"tw8vid32.dll"<BR> FUNCTION unsignedint TV_StartPlay(int chno,string sp,unsignedint play) library"tw8vid32.dll"<BR> FUNCTION unsignedint TV_StopPlay(int chno) library"tw8vid32.dll"<BR> FUNCTION unsignedint TV_PlayRest(int chno) library"tw8vid32.dll"<BR> FUNCTION long TV_StartPlayFile(int chno,string sp,long long_min,long long_max) library"tw8vid32.dll"<BR> FUNCTION long TV_PlayFileRest(int chno) library"tw8vid32.dll"<BR> FUNCTION long TV_StopPlayFile(int chno) library"tw8vid32.dll"<BR> SUBROUTINE TV_MakeSentence(double double_test, REF string sp) library"tw8vid32.dll"<BR> FUNCTION long TV_PlaySentence(int chno,string sp) library"tw8vid32.dll"<BR> FUNCTION long TV_PlaySentenceRest(int chno) library"tw8vid32.dll"<BR> SUBROUTINE TV_FlushDTMF(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_GetDTMFChar(int chno) library"tw8vid32.dll"<BR> FUNCTiON string TV_GetDTMFStr(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_CheckSignal(int chno,int int1,int int2) library"tw8vid32.dll"<BR> FUNCTION int TV_ListenerOffHook(int chno) library"tw8vid32.dll"<BR> SUBROUTINE TV_StartMonitor(int chno) library"tw8vid32.dll"<BR> FUNCTION int TV_MonitorOffHook(int chno,int tirme) library"tw8vid32.dll"<BR> FUNCTION int TV_MonitorBusy(int chno,int int1,int int2) library"tw8vid32.dll"<BR> SUBROUTINE TV_StartTimer(int chno,long timer) library"tw8vid32.dll"<BR> FUNCTION long TV_TimerElapsed(int chno) library"tw8vid32.dll"<BR> SUBROUTINE TV_SetVoicei(int num,string fn) library"tw8vid32.dll"<BR> FUNCTION int PasswordDetect(string password,string path) library"Playch32.dll"<BR> FUNCTION int TV_StartPlayCh(int chn,string sentence) library"Playch32.dll"<BR> FUNCTION int TV_PlayChRest(int chn) library"Playch32.dll"<BR> FUNCTION int TV_StopPlayCh(int chn) library"Playch32.dll"<BR> CONSTANT Integer WS_NULL=0<BR> CONSTANT Integer WS_FREE=1<BR> CONSTANT Integer WS_STARTFILE=2<BR> CONSTANT Integer WS_ONFILE=3<BR> CONSTANT Integer WS_WAITDTMF=4<BR> CONSTANT Integer WS_GETDTMF=5<BR> CONSTANT Integer WS_STARTSENTENCE=6<BR> CONSTANT Integer WS_ONSENTENCE=7<BR> CONSTANT Integer WS_STARTMONEY=8<BR> CONSTANT Integer WS_ONMONEY=9<BR> CONSTANT Integer WS_WAITEND=10<BR> CONSTANT Integer WS_looksfzhmfromdb=11<BR> CONSTANT Integer WS_retrievedatafromdb=12<BR> CONSTANT Integer WS_startoutputxingmin=13<BR> CONSTANT Integer WS_onoutputxingmin=14<BR> CONSTANT Integer WS_yiliao_nd=16<BR> CONSTANT Integer WS_yiliao_on_nd=18<BR> CONSTANT Integer WS_yiliao_nd_data =100<BR> CONSTANT Integer WS_yiliao_on_nd_data =101<BR> CONSTANT Integer WS_yiliao_a1 =40<BR> CONSTANT Integer WS_on_yiliao_a1 =41 <BR> CONSTANT Integer WS_yiliao_a1_data =42<BR> CONSTANT Integer WS_on_yiliao_a1_data =43<BR> CONSTANT Integer WS_yiliao_a2 =44<BR> CONSTANT Integer WS_on_yiliao_a2 =45 <BR> CONSTANT Integer WS_yiliao_a2_data =46<BR> CONSTANT Integer WS_on_yiliao_a2_data =47<BR> CONSTANT Integer WS_yiliao_a3 =48<BR> CONSTANT Integer WS_on_yiliao_a3 =49 <BR> CONSTANT Integer WS_yiliao_a3_data =50<BR> CONSTANT Integer WS_on_yiliao_a3_data =51<BR>
 

狀 態(tài): 離線

公司簡介
產(chǎn)品目錄

公司名稱: 中華工控網(wǎng)
聯(lián) 系 人: 客服中心
電  話: 0755-26546361
傳  真: 0755-26585268
地  址: 深圳市南山區(qū)創(chuàng)業(yè)路現(xiàn)代城華庭1棟6A
郵  編: 518054
主  頁:
 
該廠商相關(guān)技術(shù)文摘:
智能儀器儀表的發(fā)展特點(diǎn)與前景分析
電動機(jī)性能虛擬儀器測試系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
視頻監(jiān)控護(hù)航高鐵安全運(yùn)營
基于PLC,觸摸屏及變頻器對吹膜機(jī)的改造
永宏P(guān)LC應(yīng)用于自助圖書借還終端機(jī)
基于永宏P(guān)LC的GSM通訊原理及其應(yīng)用
改善汽車生態(tài)學(xué)、安全性和舒適性,四大測試分析是關(guān)鍵
改善汽車生態(tài)學(xué)、安全性和舒適性,四大測試分析是關(guān)鍵
數(shù)控技術(shù)的發(fā)展趨勢及產(chǎn)業(yè)化
數(shù)控技術(shù)發(fā)展戰(zhàn)略與發(fā)展途徑的思考
用Energid 的軟件進(jìn)行機(jī)器人的抓取和操作
如何借助RFID技術(shù)升級企業(yè)信息管理水平
更多文摘...
立即發(fā)送詢問信息在線聯(lián)系該技術(shù)文摘廠商:
用戶名: 密碼: 免費(fèi)注冊為中華工控網(wǎng)會員
請留下您的有效聯(lián)系方式,以方便我們及時(shí)與您聯(lián)絡(luò)

關(guān)于我們 | 聯(lián)系我們 | 廣告服務(wù) | 本站動態(tài) | 友情鏈接 | 法律聲明 | 不良信息舉報(bào)
工控網(wǎng)客服熱線:0755-86369299
版權(quán)所有 中華工控網(wǎng) Copyright©2022 Gkong.com, All Rights Reserved