Skip to content

How to make a call and play a sound clip

Xiaogang

Asked May 31, 2007, 12:34 PM EDT2 answers
Share
LinkedInX
Hi All, I need to dial a phone number and play a sound clip over the phone. How can I implement it in C#? Thank you very much!

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0
    I believe this will require the TAPI (Telephone API) library to dial the phone in conjunction with the multimedia dll (or direct x) to play the sound.

    TAPI is not officially part of .NET as far as I know, but you can use the c:\windows\system32\tapi3.dll which is a COM object that will let you communicate with the telephone api.  Just add it as a reference to your project.

    To program TAPI, check out this article  to get you started.

    Sounds can be played easily through winmm.dll.  Just declare it with DllImport

     // PlaySound()
    using System.Runtime.InteropServices; 

    [DllImport("winmm.dll", SetLastError=true,                                 CallingConvention=CallingConvention.Winapi)]
     static extern bool PlaySound(
                    string pszSound,
                    IntPtr hMod,
                    SoundFlags sf );
    0
  • 0
    Thanks, Mike. The TAPI is really helpful. I am trying to find a function in TAPI to feed the playing sound to the modem. Still no progress.
    0