Answer the question
In order to leave comments, you need to log in
Why doesn't PlaySound() play sound?
PlaySound()
plays standard system sound instead of .wav file. Here is a listing of the function where it is used:
void Scene1()
{
if(SelectNumber == 1) //Rock
cout << "You played Rock and Computer played Rock. It's Draw ;|" << endl;
else if(SelectNumber == 2) //Paper
{
cout << "You played Paper and Computer played Rock. Paper covers a Rock. You WIN ;)" << endl;
LPWSTR win = L"D:\c++_progs\testing\Release\winsound.wav";
PlaySound(win,NULL,SND_ASYNC);
}
else if(SelectNumber == 3) //Scissors
{
cout << "You played Scissors and Computer played Rock. Rock smashes Scissors. You Lose ;(" << endl;
LPWSTR lose = L"D:\c++_progs\testing\Release\losesound.wav";
PlaySound(lose,NULL,SND_ASYNC);
}
PlaySound()
:LPWSTR win = L"D:\c++_progs\testing\Release\winsound.wav";
PlaySound(win,NULL,SND_ASYNC);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question