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.

Sound Ausgabe

Empfohlene Antworten

Veröffentlicht

Hallo,

habe ein kleines Programm geschrieben, in welchem ich Töne bzw. Files ausgeben möchte. z.B. eine akkustischer Hinweis bei einem Fehler.

Ist es wirklich so, daß das ein größeres Problem darstellt.

Kenne es nur von Basic, da war das doch kein Problem!!!

Mir wäre auch egal, ob das Systemtöne sind, oder ob nur ne .wave Datei abgespielt wird.

Einfach soll es sein!!!

Kann mir da jemand helfen???

Danke schon einmal!!!

also damit ich dichr richtig verstehe du möchtest einfach ein system Beep wie es beispielsweis beim starten des rechners kommt ?

Ja genau, das wäre schon einmal nicht schlecht!

Bräuchte aufgrund meiner Programm-Meldungen 3 verschiedene Töne.

Wie die erzeugt bzw, aufgerufen werden ist eigentlich egal.

Kann z.B. ein Beep leicher verwendet werden, als eine wave Datei?

Âlso MSDN sagt das hier dazu

Beep

The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes.

BOOL Beep(

DWORD dwFreq, // sound frequency

DWORD dwDuration // sound duration

);

Parameters

dwFreq

[in] Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).

Windows 95/98/Me: The Beep function ignores this parameter.

dwDuration

[in] Specifies the duration, in milliseconds, of the sound.

Windows 95/98/Me: The Beep function ignores this parameter.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

oder

MessageBeep

The MessageBeep function plays a waveform sound. The waveform sound for each sound type is identified by an entry in the registry.

BOOL MessageBeep(

UINT uType // sound type

);

Parameters

uType

[in] Sound type, as identified by an entry in the registry. This parameter can be one of the following values. Value Sound

-1 Simple beep. If the sound card is not available, the sound is generated using the speaker.

MB_ICONASTERISK SystemAsterisk

MB_ICONEXCLAMATION SystemExclamation

MB_ICONHAND SystemHand

MB_ICONQUESTION SystemQuestion

MB_OK SystemDefault

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

After queuing the sound, the MessageBeep function returns control to the calling function and plays the sound asynchronously.

If it cannot play the specified alert sound, MessageBeep attempts to play the system default sound. If it cannot play the system default sound, the function produces a standard beep sound through the computer speaker.

The user can disable the warning beep by using the Sound control panel application.

Terminal Services: To send a beep to a client, use the Beep function. The Beep function is redirected to the client, whereas MessageBeep is not, except on Windows NT 4.0 where MessageBeep(-1) calls Beep.

Example Code

For an example, see Notifying the User of Errors.

Requirements

Windows NT/2000/XP: Included in Windows NT 3.1 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Winuser.h; include Windows.h.

Library: Use User32.lib.

See Also

Error Handling Overview, Error Handling Functions, Beep, FlashWindow, MessageBox

für beide must du die Winuser.h, die Windows.h und die Winbase.h includen

Hallo,

habe ein kleines Programm geschrieben, in welchem ich Töne bzw. Files ausgeben möchte. z.B. eine akkustischer Hinweis bei einem Fehler.

Ist es wirklich so, daß das ein größeres Problem darstellt.

Welches Betriebssystem?

Im Fall von Windows wäre PlaySound (Parameter siehe Doku) eine Möglichkeit.

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.