Seems like the wav file is currupted. Try with another file and see if it works.
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.
Show posts Menuelse {
sf::Sound sound; // <- Sound object gets created
sound.setBuffer(buffer);
sound.play();
} // <- Sound object gets destroyed as it goes out of scope
sf::SoundBuffer buffer;
sf::Sound sound;
#include <SFML/Audio.hpp>
#include <TGUI/TGUI.hpp>
#include <conio.h>
int main()
{
// Create the window
sf::RenderWindow window(sf::VideoMode(800, 600), "Window");
tgui::Gui gui(window);
// Load the font (you should check the return value to make sure that it is loaded)
gui.setGlobalFont("TGUI/fonts/DejaVuSans.ttf");
tgui::Button::Ptr button(gui);
button->load("TGUI/widgets/Black.conf");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
// Pass the event to all the widgets (if there would be widgets)
gui.handleEvent(event);
}
window.clear();
// Draw all created widgets
gui.draw();
window.display();
}
return EXIT_SUCCESS;
}
tgui::ListBox::Ptr listBox(gui);
listBox->load("TGUI/widgets/Black.conf");
tgui::Button* button = window.add<tgui::Button>();
button->load("TGUI/objects/Button/Black");
tgui::Button::Ptr button(gui);
button->load("TGUI/widgets/Black.conf");