Google 그룹스는 더 이상 새로운 유즈넷 게시물 또는 구독을 지원하지 않습니다. 과거의 콘텐츠는 계속 볼 수 있습니다.

Make a sound

조회수 868회
읽지 않은 첫 메시지로 건너뛰기

#Hai

읽지 않음,
2003. 6. 22. 오전 1:01:1303. 6. 22.
받는사람
I want to send out a small piece of sound (ex: a series of 5 beep) to the
speaker (by C#).
How to do that ?


Michael Mayer

읽지 않음,
2003. 6. 22. 오전 3:54:0303. 6. 22.
받는사람
I did a quick google search on "C# messagebeep"

Here's a hard way to do it (involves directx 9 sdk)
http://www.codeproject.com/csharp/MessageBeep.asp

And a few other good ways are listed in a message at:
http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=8811

From the 2nd URL, I think my own favorite would be this one (but then
again, i have no particularly bad feelings towards vb).
...you could call VB Runtime Beep like this.
Add referece to Microsoft Visual Basic.NET Runtime
//And then you just use this in your code:
Microsoft.VisualBasic.Interaction.Beep();

-mike


" #Hai" <LH...@SoftHome.net> wrote in message
news:OZWoPzHO...@TK2MSFTNGP10.phx.gbl...

L3m0n

읽지 않음,
2003. 6. 22. 오전 6:28:4403. 6. 22.
받는사람
The simpler way do obtain the internal speaker beep is to use the
Beep(frequency,duration) function. In order to user it u got to import
kernel32.dll.

using System;
using System.Runtime.InteropServices;

class MainClass
{
[DllImport("kernel32.dll")]
public static extern bool Beep(int freq,int duration);

public static void Main(string[] args)
{
Console.WriteLine("un beep");
Beep(1000,1000);
Console.WriteLine("un beep più alto e più corto");
Beep(2000,500);
}
}
-Alessandro-

" #Hai" <LH...@SoftHome.net> ha scritto nel messaggio
news:OZWoPzHO...@TK2MSFTNGP10.phx.gbl...

Herfried K. Wagner

읽지 않음,
2003. 6. 22. 오전 7:10:2403. 6. 22.
받는사람
Hello,

" #Hai" <LH...@SoftHome.net> schrieb:


> I want to send out a small piece of sound (ex: a series of 5 beep)
> to the speaker (by C#).
> How to do that ?

Method 1:

\\\
Console.WriteLine( "\a" ); // Beep
///

Method 2:

\\\
[DllImport("kernel32.dll")]
private static extern bool Beep(int frequency, int duration);
///

Method 3:

\\\
Microsoft.VisualBasic.Interaction.Beep()
///

Method 4:

http://www.palmbytes.de/content/dotnetmisc/klassen.htm
-> class "SystemSound"

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


새 메시지 0개