|
现在的小交换机用普通电话设置很繁琐,用网上的拨号工具却只能输入很短的号码,只好自己用拨号引来拼凑实现了。
首先借用了这里的豪华板登陆界面里的播放声音函数,然后分解字符播放数字按键字符。附件音频要放在同目录里的sound里。
还没有完全想好通用电话机设置,有爱好的帮忙完善吧。
Option Compare Database
Private Declare Function sndPlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub PlaySound(SoundFile As String)
sndPlaySound SoundFile, 1
End Sub
Option Compare Database
Public Sub PlayPHONESound(StrSound As String)
'============================================================
' 项目名称:
' 过程函数名: PlayPHONESound 类型:Public Sub
'-------------------------------------------------------------
' 版权所有: 懒虫
' 作者: venden (venden@yahoo.com.cn) 2008年1月1日
'-------------------------------------------------------------
' 参数:StrSound As String
' 返回:
'-------------------------------------------------------------
' 说明:播放电话按键音
'-------------------------------------------------------------
' 修订历史:
'=============================================================
Dim Str4Phone As String
Dim Str2Phone As String
' Dim Str9Phone As String
Dim I As Integer
Dim J As Long
Dim ASound As Sound
' MsgBox StrSound
If Trim(StrSound) <> "" Then
Str4Phone = StrSound
For I = 1 To Len(Str4Phone)
Str2Phone = Mid(Str4Phone, I, 1)
' MsgBox Str2Phone
Select Case Str2Phone
Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
' Str9Phone = Str2Phone
Case "#"
' Str9Phone = Str2Phone
Case "*"
Str2Phone = "x"
Case Else
Str2Phone = ""
End Select
' MsgBox Str9Phone
If Str2Phone = "" Then
For J = 1 To 159999999
Next J
Else
Set ASound = New Sound
ASound.PlaySound CurrentProject.Path & "\sound\" & Str2Phone & ".wav"
Set ASound = Nothing
For J = 0 To 9990000
Next J
End If
Next I
End If
End Sub |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|