Answers for "how to put sound in c++"

C++
0

how to play sounds in c++

PlaySound(TEXT("sound.wav"), NULL, SND_FILENAME);
Posted by: Guest on September-03-2021
0

how to play sound in c++

#include <iostream>
#include <windows.h>
#include <mmsystem.h>
using namespace std;

int main(){
    //PlaySound(TEXT("mywavsound.wav"), NULL, SND_FILENAME); - My erroring code
    PlaySound(TEXT("mywavsound.wav"), NULL, SND_FILENAME | SND_ASYNC);// - the correct code
        
    int test = 0;
    cin>>test;
    return 0;
}
Posted by: Guest on January-24-2022

Browse Popular Code Answers by Language