0
0

Hi.

I have a little problem which I really don’t understand.

I program with windows with the IDE code blocks and I want to make a music play endlessly. I used the function FSOUND_Stream_SetLoopCount(FSOUND_STREAM *stream, int count)
but it doesn’t work and I really don’t know why because the value returned is true! The music is only played one time and nothing more at the end of the song.

Can somebody help me?

  • You must to post comments
0
0

What did you pass as the loop count argument? passing -1 should make it loop endlessly

When do you call FSOUND_Stream_SetLoopCount? Before the stream is played or after?

  • You must to post comments
0
0

[quote:3smoaye8]What did you pass as the loop count argument? passing -1 should make it loop endlessly
When do you call FSOUND_Stream_SetLoopCount? Before the stream is played or after?[/quote:3smoaye8]
Yes I passed -1 as argument and I called it before the stream is played, but it doesn’t change anything if it’s called before or after.

Here you can see my code :

[quote:3smoaye8]
FSOUND_Init(44100, 32, 0);
music = FSOUND_Stream_Open("start.wav", 0, 0, 0);
if (music == NULL)
{
fprintf(stderr, "Impossible de lire Hype_Home.mp3\n");
exit(EXIT_FAILURE);
}

i=FSOUND_Stream_SetLoopCount(musique,-1);
printf("i: %d",i); // It returns 1
FSOUND_Stream_Play(FSOUND_FREE, musique);
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);

FSOUND_Stream_Close(musique); /* On libère la mémoire */
FSOUND_Close();
SDL_Quit();

return EXIT_SUCCESS;
}[/quote:3smoaye8]

  • You must to post comments
0
0

I believe you need to use FSOUND_LOOP_NORMAL as a flag when you open the stream.

  • You must to post comments
0
0

Yeah thanks it works now.
But I don’t really understand why it didn’t work because I copied the code from a very famous website, so I don’t think there was a mistake or a incomplete program, otherwise it would have been corrected since a long time!

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.