0

I am trying to get music to loop in the background of a game. However im really not sure how to do this. Can anyone give me a starting point please? I am using Visual C++ btw.

Edited by Hidden_mistakes: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Hidden_mistakes
0

If you are on windows, then you can use PlaySound . If not then there might be something similar to your
OS. If all fails, you will have to use a 3rd party library.

0

I got this piece of code

#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>

#pragma comment(lib,"Winmm.lib")

int main(void)
{
	PlaySound("file.wav",NULL,SND_FILENAME);

	return 0;
}

But it will only play at the begining of the program where i want it to loop- how can i do this?

Edited by Hidden_mistakes: n/a

0

I got it to work by using this code

PlaySound("beep.wav",NULL,SND_FILENAME|SND_ASYNC | SND_LOOP);

Thanks for your help

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.