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

Pages: [1]
1
Audio / Re: Can't play any sounds - Program crashes
« on: September 21, 2017, 01:48:01 am »
Thanks changing the suffix to -d fixed it.

2
Audio / Can't play any sounds - Program crashes
« on: September 21, 2017, 12:03:34 am »
Hi I really need help with getting audio to work in my program. I've been working on it for awhile and I just can't figure it out.

When I try to run my program it just crashes and the exception it gives me is:
Exception thrown at 0x5719D687 (vcruntime140.dll) in Spacehip Game.exe: 0xC0000005: Access violation reading location 0x00542000. occurred

My code is (I had more but I started a new project to see if that would fix it):
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main() {
   sf::Music music;
   if (!music.openFromFile("music.wav"))
      return -1; // error
   music.play();

   //sf::RenderWindow window(sf::VideoMode(800, 600), "This is dumb");
}

I'm sure that my .wav file is in the right place and it plays when I use windows media player. A strange thing about the error is it gives me a bunch of random symbols, I attached a screenshot so people can see it.

Thanks for taking the time to help me. If I need to provide any more info I will.

Pages: [1]
anything