Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any OCX or WinAPI to record a phone conversation?
Message
De
29/05/2002 12:10:21
 
 
À
29/05/2002 02:43:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00660828
Message ID:
00662564
Vues:
45
This message has been marked as a message which has helped to the initial question of the thread.
OK, you asked for it :>) The following was ripped from and old app and has been tested against SOME USR and Rockwell based modems. YMMV.

ASSUMPTIONS:

Operator is using a hanset plugged into the modem "Phone" jack
A cable is installed from modem "Line Out" or "Speaker" to sound card "Line Input"
The sound card has mixer capabilities and "Line Input" is enabled
Sound card external speakers may need to be muted to prevent feedback
You have the MS MCI control on your form, named "VREC" and have Record Enabled
*** THISFORM.TestResponse() is method/fuction to test for "OK", "VCON", etc.
*** response codes from the modem - not included here. Nor is any error
*** handling. Assume all is OK.
This code may be as a result of the operator's response to
your MESSAGEBOX() to pick up the phone "Ok" or ?
* Enter voice mode
THISFORM.Dialer.Output = "AT#CLS=8"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* Voice Line Select
THISFORM.Dialer.Output = "AT#VLS=0"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* Set Tone generation to 100 ms - not needed in this app
THISFORM.Dialer.Output = "AT#VBT=1"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* Now have the modem pick up the line
THISFORM.Dialer.Output = "ATA"+CHR(13)
Goodtogo = THISFORM.TestResponse("VCON")
The following code might be put in your Record button .click() method
* Set sample rate to 8kHz
THISFORM.Dialer.Output = "AT#VSR=8000"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* Set bits/Sample to 4
THISFORM.Dialer.Output = "AT#VBS=4"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* Voice Line Select - just to make sure
THISFORM.Dialer.Output = "AT#VLS=0"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* Setup MCI for Record
THISFORM.VREC.DeviceType = "waveaudio"
* Adjust the following to suit.
THISFORM.VREC.FileName = "C:\wavefiles\test.wav"

* Finish modem setup
THISFORM.Dialer.Output = "AT#VSM=130,8000"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

* and turn on Voice Receive
THISFORM.Dialer.Output = "AT#VRX"+CHR(13)
Goodtogo = THISFORM.TestResponse("CONNECT")

* Lastly, start the Record
THISFORM.VREC.Command = "Record"
A "Stop Record" button Click() might be:
THISFORM.VREC.Command = "Stop"
A "Hangup" button Click() might be:
THISFORM.Dialer.Output = "AT#BDR=0"+CHR(13)
Goodtogo = THISFORM.TestResponse("VCON")

THISFORM.Dialer.Output = "ATH"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")

THISFORM.Dialer.Output = "AT#CLS=0"+CHR(13)
Goodtogo = THISFORM.TestResponse("OK")
Instead of driving the MCI control as I have, you may want the operator to manually start and stop the process. Your choice.

Now do you see why a 3rd party control is recommended? Set a few properties, error checking and modem response handling done for you, etc. Hope this helps.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform