Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Beep Anweisung

Empfohlene Antworten

Veröffentlicht

Hi Ihr alle :) !

Eine Frage?

Ist es unter VB möglich eine Melodie etc. über den PC- Lautsprecher auszugeben?

Oder gibt es einen Code dafür?

Noch einfacher, gibt es ein tool dafür?

Will meinen Chef ein bischen ärgern damit.

Danke im vorraus

Gruss

B-B

Also zu alten QBasic zeiten gab es PLAY "...." welches eine Tonfolge ausgegeben hat.

Hi,

ist alles möglich :)


Private Declare Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Boolean


Private Sub Command1_Click()

Dim TonHoehe As Integer

Dim TonLaenge As Integer

TonHoehe = 50

TonLaenge = 150


        beeped = Beep(TonHoehe, TonLaenge)

End Sub

MfG

KarlBerg

Hi,

hab noch mehr gefunden.

Für die, die abgestimmte Töne wollen.

(Bin nicht 100% sicher, dass die Frequenzen stimmen)

Dafür braucht man:

-btnGenau (Button)

-CmbOct (ComboBox)

-CmbNote (ComboBox)


Private Declare Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Boolean

Dim beeped As Boolean       


Private Sub btnGenau_Click()

Dim TonLaenge As Integer

Dim Note As String

Dim Octave As Integer

Dim Freq As Integer

TonLaenge = 100



Octave = CmbOct.Text

Note = CmbNote.Text


Select Case Note

Case "A"

    Freq = 27.5

Case "A#"

    Freq = 29.1352

Case "B"

    Freq = 30.8677

Case "C"

    Freq = 32.7032

Case "C#"

    Freq = 34.6478

Case "D"

    Freq = 36.7081

Case "D#"

    Freq = 38.8909

Case "E"

    Freq = 41.2034

Case "F"

    Freq = 43.6535

Case "F#"

    Freq = 46.2493

Case "G"

    Freq = 48.9994

Case "G#"

    Freq = 51.9131

Case "A2"

    Freq = 55

End Select


        beeped = Beep(CLng(Freq) * 2 ^ (CLng(Octave) - 1), TonLaenge)


End Sub


Private Sub Form_Load()

CmbNote.AddItem "A"

CmbNote.AddItem "A#"

CmbNote.AddItem "B"

CmbNote.AddItem "C"

CmbNote.AddItem "C#"

CmbNote.AddItem "D"

CmbNote.AddItem "D#"

CmbNote.AddItem "E"

CmbNote.AddItem "F"

CmbNote.AddItem "F#"

CmbNote.AddItem "G"

CmbNote.AddItem "G#"

CmbNote.AddItem "A2"


CmbNote.ListIndex = 0


For i = 2 To 11

    CmbOct.AddItem i

Next i

CmbOct.ListIndex = 0

End Sub


MfG

KarlBerg

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.