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 - johnscape

Pages: [1]
1
Audio / Re: Program crash when opening music
« on: December 11, 2017, 07:07:44 pm »
Okay, I put the music out to the main cpp, now it works. It means, that I should use the release files, not the debug ones?

Edit: So, I tried to use the release files. Now, it won't crash, but from loading the music to playing the music, it's lagging.

Edit: I'm confused. It started working with the debug files. I don't know why, maybe I just had to rebuild it. Still, it's lagging a bit until I start playing the music.

Edit: The lagg was my fault. So, the music started playing after I rebuild once with the release files, then againg with the debug files. Thank you for the answers!

2
Audio / Program crash when opening music
« on: December 11, 2017, 02:24:05 pm »
So, I have been working on a little project of mine, and I have encountered a bug.
I have a special class for cinematics, where I use two music: a base and a special. I declare them in the header:
#ifndef INTROSCENE_H
#define INTROSCENE_H

#include "Screens/CinematicScreen.h"
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

class CharaIntroScene : public CinematicScreen
{
public:
        IntroScene(GameManager* gameManager);
        virtual ~IntroScene();
private:
       sf::Music Base;
       sf::Music Special;
};

#endif
 

And my source file:
#include "Screens/Cinematics/IntroScene.h"

IntroScene::IntroScene(GameManager* gameManager) : CinematicScreen(gameManager)
{
    Base.openFromFile("Assets/Music/Base.ogg");
    Special.openFromFile("Assets/Music/Special.ogg");

    Base.setLoop(true);
    Special.setLoop(true);
}
 

and I have a void where I start the music.
This way the game freeze and crash on load.
If I comment out the openFromFile part it loads.

I'm using windows 10 with codeblocks, and the corresponding SFML version.
Everything else is included, the dll files are in place.
And if I use the debugger, everything works, even the music plays. But it only works with the debugger.

So, what can be the problem?

Pages: [1]
anything