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

C++
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