none
關於 modem 程式的問題(about tapi) RRS feed

  • 問題

  • 先前做一個用 serialport 連 modem , 下 at command 去做語音相關的程式,
    但是因 modem 不同, 會用到的 command 也不同,
    所以改用安裝 driver 的方式, 再由 register 去讀取所需的 at command,
    再加以修改, 給予不同的參數,
    但不知該如何 enum 所有的 modem driver 給 user 選擇,
    因此不知道該從哪個 clsid 去找 command....

    上網查了一段時間, 好像有個 tapi 是專門做這件事的,
    但是卻不知道如何使用 tapi3lib ,
    請問有前輩可以給個方向及範例嗎? 萬分感激.
    2007年5月25日 上午 03:30

解答

  • 哇 今天測試了 TurboPower 公司釋出之免費語音套件

    真的可以透過數據機發出語音給受話者

     

    且當您的數據機不支援時,當您在勾選語音項目他就會告訴你

    你的數據機支不支援了


    不過有個問題是, 當他播放十幾秒的時候整個系統會 showdown

    小弟猜是因為wav的關係?

    因此現在正在錄製新的wav讓他播放看看

    不過,每次測試都要有當機的心理準備~~  @@


    待小弟完整測試完畢後 再將測試方式寫出來給大家分享~  Big Smile

    PS: 也希望有跟小弟一樣問題的朋友一起測試  底下是他下載的連結

     

    http://www.delphifans.com/SoftView/SoftView_1825.html

     

    2008年1月21日 上午 05:28

所有回覆

  • 哈哈 您好

     

     

    小弟我也在研究這個 有機會一起討論囉!!

    2008年1月18日 上午 01:33
  •  

    我有找了一些關於tapi的相關資料 大約7xMB左右如果您有興趣 我再傳給您

     

    一起互相研究看看囉~~

     

    不過,目前似乎都只能做到撥出 但是不能做到播放語音  我在想 是不是一定只能透過硬體呢?

     

    2008年1月18日 上午 01:40
  •  

    您好, 小弟目前是直接從 registry 裡頭取得需要的 at command 來操作, 這部份已 OK 了, 謝謝~

    modem 使用聲音的部份, 小弟是用到錄音而已, 並沒有播放語音, 但應該差不多吧,

    錄音部份視 chip 而定, 有的用 at+vrx , 有的用 at#vrx , 當然在這之前還有一些 init 的 cmd 要下..

     

    2008年1月18日 上午 01:46
  •  嗯嗯   厲害, 我現在 連 at command  都還沒找到幾組哩!!  ^^

    2008年1月18日 上午 01:52
  •  

    不過 我想跟您確任依下    透過數據機的部分確定是可以錄音 但可以撥音嗎?

     

     

    因為我找到很多資料都僅止於錄音 與撥號 並沒有撥音的功能?

     

     

     

    數據卡是否支援,似乎也是個問題

     

     

    以下是我找到錄音的部份,分享給其他朋友參考

    --------------------------------------------------------------------------------------------------------------------------------------

    [Voice.AddReg]
    ;HKR,,Enumerator,,serwave.vxd
    HKR, EnableCallerID, 1, ,       "at#cid=1<cr>"             ; Enable formatted ClaaerID
    HKR, , AbortPlay, ,             "<h10><h18>at<cr>"         ; ???
    HKR, , CallerIDPrivate, ,P                                 ; ???
    HKR, , CallerIDOutSide, ,O                                 ; ???
    HKR, GenerateDigit, 1, ,        "at#vts=<Digit><cr>"       ; ???
    HKR, OpenHandset, 1,,           "at#cls=8<cr>"             ; Select voice
    HKR, OpenHandset, 2,,           "at#vls=1<cr>"             ; route handset thru modem
    HKR, CloseHandset, 1,,          "at#cls=0<cr>"             ; Select data
    HKR, LineSetPlayFormat, 1,,     "at#vls=0<cr>"             ; route telephone interface thru modem
    HKR, LineSetRecordFormat, 1,,   "None"                     ;
    HKR, LineSetRecordFormat, 2,,   "NoResponse"               ;
    HKR, HandsetSetRecordFormat, 1,,"at#vbs=4<cr>"             ; set 4 bits per sample ADPCM at 7200 sample rate
    HKR, HandsetSetPlayFormat, 1,,  "at#vbs=4<cr>"             ; set 4 bits per sample ADPCM at 7200 sample rate
    HKR, SpeakerPhoneEnable, 1,,    "at#vls=6<cr>"             ; enable microphone and speaker
    HKR, SpeakerPhoneDisable, 1,,   "at#vls=6<cr>"             ; enable microphone and speaker
    HKR, SpeakerPhoneDisable, 2,,   "at#tl=0<cr>"              ; playback mute
    HKR, SpeakerPhoneDisable, 3,,   "at#vls=0<cr>"             ; route telephone interface thru modem
    HKR, SpeakerPhoneMute, 1,,      "at#tl=0<cr>"              ; playback mute
    HKR, SpeakerPhoneUnMute, 1,,    "at#tl=5<cr>"              ; playback at 0 db
    HKR, SpeakerPhoneSetVolumeGain,1,, "at#tl=<Gain><cr>"      ; platback volume
    HKR,, SpeakerPhoneSpecs, 1, 00,00,00,00, 00,00,00,00, 01,00,00,00, 08,00,00,00 ; 1=-24db (low), 5=0db, 8=18db (high)
    HKR, StartPlay, 1,,             "at#vtx<cr>"               ; start transmit
    HKR, StopPlay, 1,,              "None"
    HKR, StopPlay, 2,,              "NoResponse"
    HKR, StartRecord, 1,,           "at#vrx<cr>"               ; start record
    HKR, StopRecord, 1,,            "None"
    HKR, StopRecord, 2,,            "NoResponse"
    HKR,, TerminatePlay,,           "<h10><h03>at<cr>"         ; empty buffer and stop play audio data
    HKR,, TerminateRecord,,         "<h10>E<cr>at<cr>"         ; finish and stop recording
    HKR,, VariableTerminator,,      <cr><lf>                   ; characters to terminate callerID
    HKR, VoiceAnswer, 1,,           "at#cls=8<cr>"             ; set in voice mode
    HKR, VoiceAnswer, 2,,           "at#vls=0<cr>"             ; route telephone interface thru modem
    HKR, VoiceAnswer, 3,,           "at#vbt=1<cr>"             ; set tone duration 100ms
    HKR, VoiceAnswer, 4,,           "ats30=20<cr>"             ; voice inactivity timer, 20 sec
    HKR, VoiceAnswer, 5,,           "ata<cr>"                  ; answer
    HKR, VoiceDialNumberSetup, 1,,  "at#cls=8<cr>"             ; set in voice mode
    HKR, VoiceDialNumberSetup, 2,,  "at#vls=0<cr>"             ; route telephone interface thru modem
    HKR, VoiceDialNumberSetup, 3,,  "at#vbt=1<cr>"             ; set tone duration 100ms
    HKR, VoiceDialNumberSetup, 4,,  "ats30=20<cr>"             ; voice inactivity timer, 20 sec
    HKR,, VoiceProfile, 1,          67,16,00,00                ; specified voice modem, capabilities to Unimodem
    HKR, VoiceToDataAnswer, 1,,     "at#cls=0<cr>"             ; select data mode
    HKR, VoiceToDataAnswer, 2,,     "ata<cr>"                  ; Answer
    HKR,Config,BaudRate, 1, 00,c2,01, 00                       ; 115200
    HKR,Config,WaveDevices, 1, 01, 00                          ;; normally, have 2 wave devices, line and
                                                               ;; handset.  If handset is not supported
                                                               ;; only have 1 wave device, so serwvdrv
                                                               ;; needs to know this so it only reports
                                                               ;; one device.  If this entry is omitted
                                                               ;; default is 2
    HKR,Config,XformID, 1, 00, 00, 00, 00                      ;; Neither of the following are for DAVICOM modem
                                                               ;; 0: No concersions, raw format
                                                               ;; 1: 4 bit Rockwell ADPCM 7200Hz
                                                               ;; 3: 4 bit IMA ADPCM 7200Hz
                                                               ;; 7: 8 bit unsigned PCM 7200Hz
                                                               ;; 8: 8 bit unsigned PCM 8000Hz
                                                               ;; 9: 4 bit Rockwell ADPCM 7200Hz with software gain increase

     

     

     

     

     

     

     

     

     

     

     

     

    ; ----------------------------------------------------------------
    ; Voice section
    ; ----------------------------------------------------------------
    [IS_101_Voice]
    HKR,,Enumerator,,serwave.vxd

    ; note NT5 voice bit "02" enabled at end of voiceprofile
    HKR,, VoiceProfile,    1,27,22,08,02 

    ; see REG.DOC in Windows 2000 DDK for details
    ; ------- start section for NT5 voice support --------------
    HKR, WaveDriver,  BaudRate       ,1, 00, c2, 01, 00
    ; note: two bytes...formerly this was a dword in serial wave driver
    ; we will do IMA ADPCM 4 bit; 8000 Hz
    HKR, WaveDriver,  XformID       ,1, 04, 00  
    HKR, WaveDriver,  WaveDevices, 1, 02, 00   ; number of wavedevices
    HKR, WaveDriver,  XformModule    ,, "umdmxfrm.dll"
    HKR, WaveDriver,  WaveHardwareID ,, "RockwellADPCMVoiceModemWave"
    ; ------- end section for NT5 voice support --------------

    ; speakerphone settings, next section:
    HKR,, SpeakerPhoneSpecs,       1, 83,00,00,00,  79,00,00,00,  83,00,00,00,  79,00,00,00
    HKR, SpeakerPhoneEnable,      1,, "at+vsp=1<cr>"
    HKR, SpeakerPhoneMute,        1,, "at+vls=5<cr>"
    HKR, SpeakerPhoneUnMute,      1,, "at+vls=7<cr>"
    HKR, SpeakerPhoneSetVolumeGain,  1,, "at+vgs=<Vol><cr>"
    HKR, SpeakerPhoneSetVolumeGain,  2,, "at+vgm=<gain><cr>"

    HKR, EnableCallerID, 1,, "at+vcid=1<cr>"
    HKR, EnableDistinctiveRing, 1,, "at+vdr=1,10<cr>"

    HKR,, HandsetCloseDelay,      1, 0A,00,00,00
    HKR, StartPlay,               1,, "at+vtx<cr>"
    HKR, StopPlay,                1,, "at+flo=0<cr>"
    HKR, StartRecord,             1,, "at+vrx<cr>"
    HKR, StopRecord,              1,, "None"
    HKR, StopRecord,              2,, "NoResponse"

    ; note change in TerminateRecord macro to "!"
    HKR,, TerminateRecord,,      "!"
    HKR,, TerminatePlay,,        "<h10><h03>"

    HKR,, AbortPlay,,            "<h10><h03>"
    HKR, OpenHandset,             1,, "at+fclass=8<cr>"
    HKR, OpenHandset,             2,, "at+vls=2<cr>"
    HKR, LineSetPlayFormat,       1,,  "at+vsm=2,8000,0,0<cr>"
    HKR, LineSetPlayFormat,       2,,  "at+flo=2<cr>"
    HKR, LineSetPlayFormat,       3,, "at+vgt=131<cr>"
    HKR, LineSetRecordFormat,     1,,  "at+vsm=2,8000,0,0<cr>"
    HKR, LineSetRecordFormat,     2,,  "at+vgr=131<cr>"
    HKR, HandsetSetRecordFormat,  1,,  "at+vsm=2,8000,0,0<cr>"
    HKR, HandsetSetPlayFormat,    1,,  "at+vsm=2,8000,0,0<cr>"
    HKR, HandsetSetPlayFormat,    2,, "at+flo=2<cr>"
    HKR, HandsetSetPlayFormat,    3,,  "at+vgt=131<cr>"

    HKR,, ForwardDelay,           1,00,20 
    HKR, CloseHandset,            1,, "at+vls=0<cr>"
    HKR, CloseHandset,            2,, "at+fclass=0<cr>"
    HKR, VoiceToDataAnswer,       1,, "at+fclass=0<cr>"
    HKR, VoiceToDataAnswer,       2,, "ata<cr>"
    HKR, VoiceAnswer,               1,, "at+fclass=8<cr>"
    HKR, VoiceAnswer,               2,, "at+vls=1<cr>"
    HKR, VoiceDialNumberSetup,      1,, "at+fclass=8<cr>"
    HKR, VoiceDialNumberSetup,      2,, "at+vls=0<cr>"
    HKR, GenerateDigit,             1,, "at+vts=<Digit><cr>"
    HKR,, CallerIDPrivate,,P
    HKR,, CallerIDOutSide,,O
    HKR,, VariableTerminator,,<cr><lf>

    HKR, Responses, "DRON=", 1, 91, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "DROF=", 1, 92, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "DATE=", 1, 93, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "TIME=", 1, 94, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "NMBR=", 1, 95, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "NAME=", 1, 96, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "MESG=", 1, 97, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "RING1", 1, 18, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "RING2", 1, 19, 00, 00,00,00,00, 00,00,00,00
    HKR, Responses, "RING3", 1, 1a, 00, 00,00,00,00, 00,00,00,00

     

     

    來源:

    http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.tapi/2006-08/msg00324.html

     

     

    Option Explicit
    Const MediaAudio As Integer = 8
    Const MediaModem As Integer = 16
    Const MediaFax As Integer = 32
    Const MediaVideo As Long = 32768

    Public WithEvents oTAPI As TAPI3Lib.TAPI ' will hold our TAPI object
    'Private oAddress As ITAddress ' will hold our selected address (you can
    hold many address in an array)
    Private RegCookie As Integer
    Private CallNotificationObject As ITCallNotificationEvent
    Private CallStateObject As ITCallStateEvent
    Private CallInfoObject As ITCallInfoChangeEvent
    Private CurrentCallerID As String

    Dim MediaTypes As Long

    'property let NewTAPI as TAPI3Lib.TAPI

    'Public Property Let NewTAPI(objTapi As TAPI)
    'Set oTAPI = objTapi
    'Setup
    'End Property

    'Public Property Get NewTAPI() As TAPI3Lib.TAPI
    'Set NewTAPI = oTAPI
    'End Property





    Sub Setup()
    'Reset
    Initialize
    Register
    End Sub

    Private Sub oTAPI_Event(ByVal TapiEvent As TAPI3Lib.TAPI_EVENT, ByVal pEvent
    As Object)
    ' If Not CallInfoObject Is Nothing Then Debug.Print
    CallInfoObject.Call.CallInfoString(CIS_CALLERIDNUMBER)
    'Debug.Print "Type " & TapiEvent & " Event Raised at " & Time()
    Select Case TapiEvent
    Case TE_TAPIOBJECT '1
    Debug.Print "TE_TAPIOBJECT Event Raised at " & Time()
    Case TE_ADDRESS '2
    Debug.Print "TE_ADDRESS Event Raised at " & Time()

    Case TE_CALLNOTIFICATION '4
    Debug.Print "TE_CALLNOTIFICATION Event Raised at " & Time()
    Set CallNotificationObject = pEvent
    CallNotificationEvent
    Case TE_CALLSTATE '8
    Debug.Print "TE_CALLSTATE Event Raised at " & Time()
    Set CallStateObject = pEvent
    CallStateEvent
    Case TE_CALLMEDIA '16
    Debug.Print "TE_CALLMEDIA Event Raised at " & Time()
    Case TE_CALLHUB '32
    Debug.Print "TE_CALLHUB Event Raised at " & Time()
    Case TE_CALLINFOCHANGE '64
    Debug.Print "TE_CALLINFOCHANGE Event Raised at " & Time()
    Set CallInfoObject = pEvent
    CallInfoEvent
    Case TE_PRIVATE '128
    Debug.Print "TE_PRIVATE Event Raised at " & Time()
    Case TE_REQUEST '256
    Debug.Print "TE_REQUEST Event Raised at " & Time()
    Case TE_AGENT '512
    Debug.Print "TE_AGENT Event Raised at " & Time()
    Case TE_AGENTSESSION '1024
    Debug.Print "TE_AGENTSESSION Event Raised at " & Time()
    Case TE_QOSEVENT '2048
    Debug.Print "TE_QOSEVENT Event Raised at " & Time()
    Case TE_AGENTHANDLER '4096
    Debug.Print "TE_AGENTHANDLER Event Raised at " & Time()
    Case TE_ACDGROUP '8192
    Debug.Print "TE_ACDGROUP Event Raised at " & Time()
    Case TE_QUEUE '16384
    Debug.Print "TE_QUEUE Event Raised at " & Time()
    Case TE_DIGITEVENT '32768
    Debug.Print "TE_DIGITEVENT Event Raised at " & Time()
    Case TE_GENERATEEVENT '65536
    Debug.Print "TE_DIGITEVENT Event Raised at " & Time()
    Case TE_ASRTERMINAL '131072
    Debug.Print "TE_ASRTERMINAL Event Raised at " & Time()
    Case TE_TTSTERMINAL '262144
    Debug.Print "TE_TTSTERMINAL Event Raised at " & Time()
    Case TE_FILETERMINAL '524288
    Debug.Print "TE_FILETERMINAL Event Raised at " & Time()
    Case TE_TONETERMINAL '1048576
    Debug.Print "TE_TONETERMINAL Event Raised at " & Time()
    Case TE_PHONEEVENT '2097152
    Debug.Print "TE_PHONEEVENT Event Raised at " & Time()
    Case TE_TONEEVENT '4194304
    Debug.Print "TE_TONEEVENT Event Raised at " & Time()
    Case TE_GATHERDIGITS '8388608
    Debug.Print "TE_GATHERDIGITS Event Raised at " & Time()
    Case TE_ADDRESSDEVSPECIFIC '16777216
    Debug.Print "TE_ADDRESSDEVSPECIFIC Event Raised at " & Time()
    Case TE_PHONEDEVSPECIFIC '33554432
    Debug.Print "TE_PHONEDEVSPECIFIC Event Raised at " & Time()
    End Select
    'ResetTapi
    'On Error Resume Next
    'Debug.Print CallInfoObject.Call.CallInfoString(CIS_CALLERIDNUMBER)
    End Sub


    Private Sub CallNotificationEvent()
    ' here we should check to see various notifications of new and ended calls
    Debug.Print "CallNotificationEvent Type " & CallNotificationObject.Event & "
    " & Time()
    Select Case CallNotificationObject.Event

    Case CNE_MONITOR
    ' the notification is for a monitored call
    Debug.Print "Call Notification: CNE_MONITOR " & Time()
    Case CNE_OWNER
    ' the notification is for an owned call
    Debug.Print "Call Notification: CNE_OWNER " & Time()
    End Select
    Set CallNotificationObject = Nothing
    End Sub

    Private Sub CallStateEvent()
    'Debug.Print "CallStateEvent Called " & Now()
    ' here we should check to see call state and handle connects and
    disconnects
    Select Case CallStateObject.State
    Case CALL_STATE.CS_IDLE '0
    Debug.Print "Call State: CS_IDLE " & Time()
    Case CALL_STATE.CS_INPROGRESS '1
    Debug.Print "Call State: CS_INPROGRESS " & Time()
    Case CALL_STATE.CS_OFFERING '4
    Debug.Print "Call State: CS_OFFERING " & Time()
    ' a call is offering so if you dont want it then pass it
    ' the code to pass the call is the following
    'Dim CallControl As ITBasicCallControl = CallStateObject.Call
    'CallControl.HandoffIndirect
    (CallStateObject.Call.CallInfoLong(CALLINFO_LONG.CIL_MEDIATYPESAVAILABLE)
    Case CALL_STATE.CS_CONNECTED '2
    Debug.Print "Call State: CS_CONNECTED " & Time()
    ' call is connected
    Case CALL_STATE.CS_QUEUED
    Debug.Print "Call State: CS_QUEUED " & Time()
    ' call is beeing queued
    Case CALL_STATE.CS_HOLD
    Debug.Print "Call State: CS_HOLD " & Time()
    ' call is on hold
    Case CALL_STATE.CS_DISCONNECTED
    CurrentCallerID = ""
    Debug.Print "Call State: CS_DISCONNECTED " & Time()
    'Register
    ' call is disconnected
    End Select
    Set CallStateObject = Nothing
    End Sub

    Private Sub CallInfoEvent()
    Debug.Print "CallInfoEvent Called " & Time()
    Dim CallerID As String
    On Error Resume Next
    CallerID = Nz(CallInfoObject.Call.CallInfoString(CIS_CALLERIDNUMBER), "")
    On Error GoTo 0
    Application.SysCmd acSysCmdSetStatus, "CID: " & CallerID

    'Set CallInfoObject = Nothing
    If CallerID = "" Or CallerID = CurrentCallerID Then GoTo Finish
    Debug.Print "Last Caller: " & CurrentCallerID
    CurrentCallerID = CallerID
    'If CallerID = "" Then CallerID = "0527649971"
    Debug.Print "Caller ID: "; CallerID
    CallerID = Canonical(CallerID)
    Dim PersonID As Integer
    PersonID = Nz(DLookup("personid", "persons", "instr(phone1 & '|' &
    phone2 & '|' & phonework & '|' & cell1 & '|' & cell2 & '|' & cell3 & '|' &
    fax1 & '|' & fax2,'" & CallerID & "')"))
    If PersonID = 0 Then GoTo Finish
    DoCmd.OpenForm "frperson", , , "personid=" & PersonID
    Forms("frperson").lbCalling.Visible = True
    Application.SysCmd acSysCmdClearStatus
    'ResetTapi


    Finish:
    Shutdown
    Initialize
    Register
    End Sub

    Sub Shutdown()
    oTAPI.Shutdown
    Set oTAPI = Nothing
    Set CallNotificationObject = Nothing
    Set CallStateObject = Nothing
    Set CallInfoObject = Nothing
    End Sub

    Sub Register()
    Dim Address As ITAddress
    Dim oAddress As ITAddress
    For Each Address In oTAPI.Addresses ' AddressCollection ' looping
    through address collection
    If Address.State = ADDRESS_STATE.AS_INSERVICE Then ' checking if
    address is working
    Dim MediaSupport As ITMediaSupport
    Set MediaSupport = Address ' extracting meida support interface
    from the address
    MediaTypes = MediaSupport.MediaTypes ' extracting media types
    supporting
    Set MediaSupport = Nothing ' dispose of the object
    If (MediaTypes And MediaModem) = MediaModem Then
    If (MediaTypes And MediaAudio) = MediaAudio Then
    Set oAddress = Address ' select this address
    Exit For
    End If
    End If
    End If
    Next Address
    If oAddress Is Nothing Then Exit Sub
    Debug.Print "Registered at " & Time()
    RegCookie = oTAPI.RegisterCallNotifications(oAddress, True, False,
    MediaTypes, 1)
    oTAPI.EventFilter = (1 Or 2 Or 4 Or 8 Or 16 Or 32 Or 64 Or 128 Or 256 Or
    512 Or 1024 Or 2048 Or _
    4096 Or 8192 Or 16384 Or 32768 Or 65536 Or 131072 Or 262144 Or
    524288 Or 1048576 Or 2097152 Or 4194304 Or _
    8388608 Or 16777216 Or 33554432)
    End Sub

    Sub Initialize()
    Dim m_TAPI As New TAPI
    m_TAPI.Initialize
    Set oTAPI = m_TAPI
    Set m_TAPI = Nothing
    End Sub



    Thankfully, YisMan

    2008年1月18日 上午 02:57
  • 我自己沒在做這方面,不過我看過的資料是直接拿 Voice Modem 的 Voice Driver 來錄放音,以前 Voice Modem 旁邊會有兩個插孔可以接喇叭跟麥克風。

     

    也就是說開發時,用一般音效卡開發,但是要列舉音效卡,測試時,選擇 Modem 的音效卡驅動程式即可。就根本不用管 Modem 類型,因為 Modem 廠商提供的音效卡驅動程式就幫你轉好了。

     

    所以 API 要熟的是 waveIn* / waveOut* 跟 acm* 系列的函數,不管壓縮的話,可以不要使用 acm* ,而這部分 DirectX 也都處理好了,若用 DirectX 時,只要會用 DirectPlay ,不用管 API 。

     

    註:現在整合型的 AC97 晶片我不確定,以前電腦有內建 Voice Modem 或透過 COM 接的,都會有多個音效卡可以選擇,若選到 Modem 的音效卡會在喇叭上聽不到聲音,就是因為把聲音播到 Modem 去了,專門工作的電腦的話,可以直接插 Voice Modem 外接孔側聽,把電腦預設音效卡設到 Modem 上,這樣連列舉音效卡都可以省了

    2008年1月18日 上午 04:16
    版主
  •  

    一開始我寫錄音的時候, 也是從 MODEM 上直接接線到音效卡....

    但以 User 來說, 多接一條線就是多一個麻煩, 所以後來下 at cmd 從 com port 取得 pcm data,

     

    因為一直不知道怎麼用 tapi , 後來乾脆自己來....

    一樣是要把 modem 的 driver 裝好,

    然後去 registry 裡頭找,

    SYSTEM\CurrentControlSet\Services\Modem\Enum 這底下的 Count 會指出有幾個 driver,

    再到 SYSTEM\CurrentControlSet\Enum\ 找到 ClassGUID, Driver

    再到 SYSTEM\CurrentControlSet\Control\Class\ 可以找到該 Driver,

    然後裡頭會列舉所有的 at command,

    錄音會用到的是 VoiceAnswer, HandsetSetRecordFormat, StartRecord,

    停止會用到的是 TerminateRecord, CloseHandSet,

    至於播放的話, 我現在這台電腦沒有裝, 所以暫時就沒辦法試了....

    2008年1月18日 上午 05:06
  • 那個外接孔是測試、監聽用的~ 正式用不用接線。

     

    Voice Modem 全部驅動程式裝起來就會有 Modem 音效卡,在控制台 聲音及音訊裝置 音訊及語音 下拉式選單可以看到,若是這邊設為輸出,就等於你從音效卡拉線接到 Voice Modem 外接孔,只是從 COM port 這邊出去而已。

    2008年1月18日 上午 05:29
    版主
  • 嗯嗯, 我今天也在阿雨的VB.Net討論區找到ㄧ個可以檢驗自己數據卡是否支援語音的功能

    http://hi.baidu.com/wlclass/blog/item/0efdd01b7816e8d7ac6e75ac.html

     

    但只能確定是它可以支援錄音,但是撥音卻不確定是否可行?

     

     

    璉璉 大大您說的 是不是數據機線路 那個呢?

     

    那個我有嚐試過, 倘若透過  Windows Media Player 似乎不能撥出?

     

    所以,想嚐試看看Wave API 就跟您說的依樣 透過內部去輸出看看~~

    不過要怎嚜整合在一起,小弟我還要試試看了

     

    以下在分享給跟我有衣樣需要的朋友

     

     

    TurboPower Async Professional 通信 串口 TAPI 傳真 終端

    http://www.2ccc.com/article.asp?articleid=381

    TurboPower Async Professional 通信 串口 TAPI 傳真 終端

    真正免費的TAPI套件, 小弟我剛剛抓下來了

    現在正在研究看看 

     

    2008年1月18日 上午 09:24
  • 播音是指播放語音還是脈衝的播號音?

     

    有些 Voice Modem 的音效卡驅動程式會把錄音跟放音的分在兩個虛擬音效卡,建議你檢查一下。

     

    假設你把預設的音效、語音都設為 Voice Modem 播音音效卡後,當你用 Media Player 時,你的喇叭不會出聲音,你可以拿電話起來聽看看,要注意音量大小,測試時建議全部都設到最大聲,因為有可能太小聲聽不到。

     

    Voice Modem 的外接孔可以接喇叭監聽,我印象中這邊會聽到軟體播放出來的聲音,不管是音樂或是人聲。

     

    我之前只有測過人家的程式碼,自己沒寫,當時是我們做防洪系統時,本來要規劃自動語音警告洩洪,後來經費不足就拿掉了,那時搜集資料時有蒐集到 C ++原始碼,看起來就是直接播放。

     

    錄音跟播音都可以用同一支電話號碼測試,假設你的電話跟 Modem 是並聯,拿起室話播 162 ,再播你的電話,撥通後掛掉電話,等到 Modem 接起來後,你再把話筒拿起來聽或講話。

    2008年1月18日 上午 09:36
    版主
  •  

    大大您好

     

    其實我有試過這個方法 因為我的數據卡並無多餘的音效輸入接口故無法接喇叭來監聽

    但他的確有在我的系統中建立一個數據機的音效卡,但是無論在千千靜聽 或是 Media Player 都無法選擇該音效卡

    只能選擇 數據機音效  但,倘若透過那張音效卡的話 就無法播放任何音效檔案,除了正確的音效設備外

     

    故,我才會想說 是不是不支援 音效輸出呢? 只能監聽 或者 錄音~~

     

     

     

     

    我的數據卡(Motorola SM56 Speakerphone Modem)

    2008年1月18日 下午 05:30
  •  

    小弟我現在正在嘗試  TurboPower 公司釋出之免費語音套件  tpapro407a3    倘若測試成功 在po上跟大家分享~ Big Smile

    2008年1月21日 上午 02:48
  • 哇 今天測試了 TurboPower 公司釋出之免費語音套件

    真的可以透過數據機發出語音給受話者

     

    且當您的數據機不支援時,當您在勾選語音項目他就會告訴你

    你的數據機支不支援了


    不過有個問題是, 當他播放十幾秒的時候整個系統會 showdown

    小弟猜是因為wav的關係?

    因此現在正在錄製新的wav讓他播放看看

    不過,每次測試都要有當機的心理準備~~  @@


    待小弟完整測試完畢後 再將測試方式寫出來給大家分享~  Big Smile

    PS: 也希望有跟小弟一樣問題的朋友一起測試  底下是他下載的連結

     

    http://www.delphifans.com/SoftView/SoftView_1825.html

     

    2008年1月21日 上午 05:28
  •  

     

    今天開始研究 TurboPower 公司的元件  發現他能夠撥號出去 (ADTD PhoneNumber)

    但是,一但送出聲音出去就會造成藍色畫面@@

     

    今天也去了各大論壇找了一些Code教學

    成功可以撥號與送出聲音但是,卻無法得知對方是否接通了?或是已經掛斷?

     

    請問各位大大有什麼方法可以解決嗎?

     

    小弟使用的是底下這位大大的作品

    非常容易使用喔~~ ^^

     

     

    Title: Low Level TAPI
    Description: For accessing and programming a TAPI line device, like a Modem.
    This file came from Planet-Source-Code.com...the home millions of lines of source code
    You can view comments on this code/and or vote on it at: http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=37398&lngWId=1

    The author may have retained certain copyrights to this code...please observe their request and the law by reviewing all copyright conditions at the above URL.

    2008年1月25日 上午 08:21