home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / avcmachi.zip / tnum.cmd < prev    next >
OS/2 REXX Batch file  |  2000-12-05  |  1KB  |  54 lines

  1. /* Script to Play Number to Sound Card */
  2.  
  3. parse arg caller
  4. if caller='' then exit
  5.  
  6. number=substr(caller,11,7)
  7.  
  8. /* Load the DLL, initialize MCI REXX support */
  9. call RXFUNCADD 'mciRxInit','MCIAPI','mciRxInit'
  10. rc=mciRxInit()
  11.  
  12.  
  13. do while rc \= ""
  14. rc=linein(users.lst,,1)
  15. parse value rc with . c_id . . v_name u_name
  16. if c_id = "ID:"||number & left(v_name,1) <> "-" then
  17.   do
  18.   mcihallo=".\names\"word(rc,5)".wav"
  19.   call play_wav_file
  20.   signal mci_end
  21.   end
  22. end
  23.  
  24. do i=1 to length(number)
  25. mcihallo=".\number\"substr(number,i,1)".wav"
  26. call play_wav_file
  27. end
  28.  
  29. mci_end:
  30. call stream users.lst,'c','close'
  31. MacRC = mciRxExit()
  32. call RXFUNCDROP 'mciRxInit'
  33. exit(0)
  34.  
  35. /* -------------- Sound Card Ends -------------- */
  36.  
  37. /* -------------- Play_Wave_File --------------- */
  38. play_wav_file:
  39.  
  40. retst=''
  41. myopen="Open" mcihallo "Alias Wave shareable Wait"
  42. myplay="Play Wave Wait"
  43.  
  44.  
  45. MacRC = mciRxSendString(myopen, 'RetSt', '0', '0')
  46.  
  47. MacRC = mciRxSendString(myplay, 'RetSt', '0', '0')
  48.  
  49. MacRC = mciRxSendString('close Wave wait', 'RetSt', '0', '0')
  50.  
  51. return
  52.  
  53. /* -------------- Play_Wave_File Ends ---------- */
  54.