G Guest Jun 27, 2005 #1 I am new to .net and C#. Is there a way to initiate a default beep sound effect? Thanks
I Ido Samuelson Jun 27, 2005 #2 [DllImport("kernel32.dll")] public static extern bool Beep(int freq,int duration); Best Regards, Ido Samuelson Senior Consultant Advantech – Microsoft Division (Magen) (e-mail address removed) http://www.magen.com I am new to .net and C#. Is there a way to initiate a default beep sound effect? Thanks
[DllImport("kernel32.dll")] public static extern bool Beep(int freq,int duration); Best Regards, Ido Samuelson Senior Consultant Advantech – Microsoft Division (Magen) (e-mail address removed) http://www.magen.com I am new to .net and C#. Is there a way to initiate a default beep sound effect? Thanks
R rossum Jun 27, 2005 #3 I am new to .net and C#. Is there a way to initiate a default beep sound effect? Thanks Click to expand... Use '\a' ('a' for Alert): namespace Beep { class Program { static void Main(string[] args) { Console.WriteLine("\a"); } } } rossum The ultimate truth is that there is no ultimate truth
I am new to .net and C#. Is there a way to initiate a default beep sound effect? Thanks Click to expand... Use '\a' ('a' for Alert): namespace Beep { class Program { static void Main(string[] args) { Console.WriteLine("\a"); } } } rossum The ultimate truth is that there is no ultimate truth
G Guest Jul 13, 2005 #4 Ho hum.... so boring... Try this instead: 1. Install DirectX 9.0 SDK 2. Create a Windows Forms application 3. Add a reference to Microsoft.DirectX.DirectSound 4. Add the following code: using Microsoft.DirectX.DirectSound; .... private void button1_Click(object sender, System.EventArgs e) { Device dev = new Device(); dev.SetCooperativeLevel(this,CooperativeLevel.Normal); BufferDescription buffer_desc = new BufferDescription(); SecondaryBuffer buffer = new SecondaryBuffer( @"C:\WINDOWS\Media\ding.wav", buffer_desc, dev); buffer.Play(0,BufferPlayFlags.Default); } Or use any wav file you like -- Live a little!!!! - Harlow.
Ho hum.... so boring... Try this instead: 1. Install DirectX 9.0 SDK 2. Create a Windows Forms application 3. Add a reference to Microsoft.DirectX.DirectSound 4. Add the following code: using Microsoft.DirectX.DirectSound; .... private void button1_Click(object sender, System.EventArgs e) { Device dev = new Device(); dev.SetCooperativeLevel(this,CooperativeLevel.Normal); BufferDescription buffer_desc = new BufferDescription(); SecondaryBuffer buffer = new SecondaryBuffer( @"C:\WINDOWS\Media\ding.wav", buffer_desc, dev); buffer.Play(0,BufferPlayFlags.Default); } Or use any wav file you like -- Live a little!!!! - Harlow.