home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / am4pmsrc.zip / amc / record.amc < prev    next >
Text File  |  1995-05-22  |  2KB  |  42 lines

  1. /*********************************************************************/
  2. /* RECORD.AMC - Do a recording of a message                          */
  3. /*                                                                   *//* This program is called by AM4PM.EXE.                              */
  4. /*                                                                   *//* Input:  arg(1) Name of the file to record                         */
  5. /*                                                                   *//* Output: 0  Normal. Only AT+VLS=0 is done before waiting           */
  6. /*         1  Full init. Reinit COM-port and everything.             */
  7. /*         2  Terminate AM4PM.                                       */
  8. /*                                                                   *//*********************************************************************/
  9. CALL AMDPrint 'RECORD.AMC('arg(1)') started'
  10. CALL AMSetLastEventText 'Record'
  11.  
  12. CALL AMSendAT('AT+VLS=8{VCON}')     /* 2 = telco line, 8 = external mic */
  13.  
  14. CALL AMSetStateText 'Recording message' arg(1)
  15.  
  16. CrntMFile=AMOpenRecFile()
  17.  
  18. CALL AMStartRec(3) /* 1 = CELP, 2 = ADPCM2, 3 = ADPCM3 */
  19.  
  20. DLECode=AMWaitDLECode()
  21. CALL AMEndRec
  22.  
  23. select
  24. when DLECode='!' | DLECode='s' then
  25.    CALL AMCloseRecFile
  26. when DLECode='.' then
  27.    do
  28.       CALL AMCloseRecFile
  29.       'copy' CrntMFile arg(1)
  30.    end
  31. otherwise
  32.    do
  33.       CALL AMTrimFileEnd(1100)    /* Remove the short DTMF tone */
  34.       CALL AMCloseRecFile
  35.       'copy' CrntMFile arg(1)
  36.    end
  37. end
  38.  
  39. 'del' CrntMFile
  40. Exit 0
  41.  
  42.