Playing a WAV file once modem dials a number?

I am writing some code to dial a phone number to notify a user when some sensor data falls out of range.

I would like to play a prerecorded WAV file when the phone is answered. Can this be done

I make the call using:

' Dial a number via an attached modem on COM1.

Using com3 As IO.Ports.SerialPort = _

My.Computer.Ports.OpenSerialPort("COM3", 9600)

com3.DtrEnable = True

com3.Write("ATM2" & vbCrLf)

com3.Write("ATDT XXXXXXXXXXXXX" & vbCrLf)

' This is where I would like to play a WAV file once the phone is answered

End Using

Thnx for any help you can give me.



Answer this question

Playing a WAV file once modem dials a number?

  • Castro

    That occured to me as well....I tried the following code after the dial (also inserted some delay just in case)...it would play it through the speakers but not to the phone:

    My.Computer.Audio.Play("C:\moonstep.wav", _

    AudioPlayMode.WaitToComplete)

    Perhaps I have to redirect the output somehow....I better check that this modem supports voice as well. But if anyone has done this, would love to see the code.

    Thnx


  • Jason Sacks - MSFT

    It will be difficult to play a wav over the modem without TAPI. Let us know if you are successful! With only Hayes AT commands and a standard voice modem the best you may be able to do is page a digital modem.
    To speed your development time, try using an ActiveX control for TAPI. You can download a free sample demo to play with which includes a large number of functioning code on how to use the control in several programming languages at: www.tapiex.com/product.htm or any other 3rd party TAPI control you can locate.

    I've used it in a RSView Scada alarm program to dial out both wav messages to phones and DTMF to pagers when a sensor goes into alarm.

  • Denvas

    Try the My.Computer.Audio.Play() method.


  • Enes Kabacaoglu

    You might want to check out the new Speech Server. I know it supports automated phone answering. I would imagine it could support phone calling as well.

    Jim Wooley
    http://devauthority.com/blogs/jwooley



  • Vaish

    It will be difficult to play a wav over the modem without TAPI. Let us know if you are successful! With only Hayes AT commands and a standard voice modem the best you may be able to do is page a digital modem.
    To speed your development time, try using an ActiveX control for TAPI. You can download a free sample demo to play with which includes a large number of functioning code on how to use the control in several programming languages at: www.tapiex.com/product.htm or any other 3rd party TAPI control you can locate.

    I've used it in a RSView Scada alarm program to dial out both wav messages to phones and DTMF to pagers when a tag goes into alarm.

  • Playing a WAV file once modem dials a number?