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.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich weiß einfach nicht, wie ich unterschiedliche Speakertöne in C++ erstellen kann.

Also ich will nur ein kleine Melodie erstellen in C++.

Gibt es für sowas ein Befehl?

Ich will die Länge und die Frequenz des Tones einstellen können.

P.S. Kennt jemand den HexCode für <ESC>

MfG

Hallo,

auf http://kaluza.physik.uni-konstanz.de/a/c/c.htm habe ich folgendes gefunden.


#include <stdio.h>
#include <DOS.h>
#include <conio.h>
int main (void)
{
// Anfangston zum Test
sound(1000);delay(1000);nosound();
while(!kbhit())
{
sound(400);
delay(200);
sound(800);
delay(200);
sound(1600);
delay(600);
}
nosound ();
return 0;
}
[/code]

Die ESC Taste hat den Dezimalcode 027 und dann den Hexcode 1B wenn ich mich nicht irre.

Frank

Sowas habe ich auch versucht, aber der Compiler kennt den Befehl Sound, Delay und nosound nicht.

Aber in der Online-Hilfe steht, dass diese Befehle in der DOS.h-Bibliothek stehen sollten, trotzdem kennt er diese Befehle nicht.

Vielleicht benutzt jemand einen Compiler, bei denen sowas geht und vielleicht kann der jenige mir auch den Namen des Compilers verraten.

MfG

Glaub mir das funktioniert nicht, ich habe keine Ahnung warum.

Ich gehe mal davon aus, dass die Bibliothek beschädigt ist.

Gibt es eine Möglichkeit, die Bibliothek zu ersetzen, oder zu erweitern???

MfG

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.