I wrote some code in C++ to play a sound:
#include <Windows.h>
#include <iostream>
int main() {
BOOL result = PlaySound(TEXT("C:\\Windows\\Media\\tada.wav"), NULL, SND_FILENAME | SND_ASYNC);
if (result == TRUE) {
std::cout << "Sound played successfully!" << std::endl;
}
else {
std::cout << "Error playing sound." << std::endl;
}
return 0;
}
It says it played successfully, but I don't hear anything. Anyone know what's wrong?
Thanks.