How to make a call and play a sound clip
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!
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
XiaogangPosted Jun 2, 2007, 8:17 PM
Mike GoldPosted May 31, 2007, 11:07 PM
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 );