O
oci300
Bekanntes Mitglied
- Dabei seit
- 05.03.2008
- Beiträge
- 107
- Reaktionspunkte
- 0
Gelöscht
Zuletzt bearbeitet:
PlaySound("Hells Bells.wav", NULL, SND_LOOP | SND_ASYNC);
PlaySound(NULL, NULL, 0);
Natürlich. Probier's einfach mal mit:Das geht ja nicht, dieser Code.
könntest du mir den mal iwie verbessern?Code:#include <cstdlib> #include <iostream> #include <windows.h> using namespace std; int main(int argc, char *argv[]) { PlaySound("hund.wav"[COLOR="Red"])[/COLOR], NULL, SND_LOOP | [COLOR="Red"]SND_ASYNC[/COLOR]); system("PAUSE"); return 0; }
#include <windows.h>
int main(int argc, char *argv[])
{
PlaySound("test.wav", NULL, SND_LOOP | SND_SYNC);
return 0;
}
Hier ist SND_SYNC richtig:The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
Allerdings musst du Winmm.lib linken. Steht aber auch auf der MSDN-Seite:The sound is played synchronously, and PlaySound returns after the sound event completes. This is the default behavior.
Header: Declared in Mmsystem.h; include Windows.h.
Library: Use Winmm.lib.
Ich nutze den C++-Compiler von Microsoft und bin sehr zufrieden damit. Die Expressversion ist kostenlos.Und eine gute Programmierumgebung/Compiler sagen
C:\Dokumente und Einstellungen\OCI300\Eigene Dateien\WinMM.lib