Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kroga

Pages: [1]
1
Audio / Re: How to play another music after a music finish playing?
« on: December 09, 2014, 12:06:48 pm »
The only SFML stuff I use is audio. Other parts of program are just combination of beginner stuffs such as cin&cout, if-else statements, and some loops which doesn't affect the musics.

It looks something like:

#include <iostream>
#include <cstdlib>
#include <time.h>
#include <SFML/Audio.hpp>

... //Some functions prototype

using namespace std;
using namespace sf;

int main()
{
cout<<"..."<<endl;

Music music;
if (!music.openFromFile("music1.ogg"))
        return -1;
music.play();

if (music.Stopped==1) // I tried a lot of other things to check if music1 has stopped or\ not too
{
        Music music;
        if (!music.openFromFile("music2.ogg"))
            return -1;
        music.play();
        music.setLoop(true);
}

... // Long code of cin, cout, if-else, loops, switch-case, etc.

cin.get();
return 0;

}

... // other functions

2
Audio / Re: How to play another music after a music finish playing?
« on: December 09, 2014, 11:44:30 am »
I understand, and I had read the tutorial and documentation about Music and had tried many ways to let it check if the music has stopped, and if the music stopped, play the next music. Nothing seems to work. I guess the problem is that I only let it check once, but I could not figure out the way to let it check in each frame, even after I read through the documentation about Music and SoundSource. That's why I need at least a hint, like what function or anything else should I use to let it check in every frame.

3
Audio / Re: How to play another music after a music finish playing?
« on: December 09, 2014, 10:49:16 am »
What is the exact code to do that? Sorry, I'm beginner.

4
Audio / How to play another music after a music finish playing?
« on: December 09, 2014, 10:17:10 am »
Hello,

What I mean is, for example, I want my program to play music1.ogg and after it finish playing, I want it to continue playing music2.ogg. This sounds like a simple question, but I just cannot figure out how to do it.

Thank you for helps provided.

Pages: [1]