1
Audio / Can't play MP3s with <SFML/Audio>?
« on: July 25, 2014, 08:49:02 pm »
So, first I'll post the code, then explain:
I am using Visual Studio 2013 Express, and when I run this program, I get an irritating beeping noise and get this message:
I don't really know what that means. Is there anything wrong with the code? I got it from the resources page - http://www.sfml-dev.org/tutorials/2.1/audio-sounds.php - so I assume it isn't that. Is there a way that I setup SFML wrong? I'd appreciate any help I can get! Thanks!
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <Windows.h>
int main()
{
ShowWindow(GetConsoleWindow(), SW_HIDE);
sf::Music music;
if (!music.openFromFile("C:\Users\Public\Music\Sample Music\Kalimba.mp3"))
return -1; // error
music.play();
return 0;
}
#include <SFML/Audio.hpp>
#include <Windows.h>
int main()
{
ShowWindow(GetConsoleWindow(), SW_HIDE);
sf::Music music;
if (!music.openFromFile("C:\Users\Public\Music\Sample Music\Kalimba.mp3"))
return -1; // error
music.play();
return 0;
}
I am using Visual Studio 2013 Express, and when I run this program, I get an irritating beeping noise and get this message:
Quote
Unhandled exception at 0x0F26DEF8 (msvcr110.dll) in sfmoDemo.exe: 0xC0000005: Access violation reading location 0x00297000.
I don't really know what that means. Is there anything wrong with the code? I got it from the resources page - http://www.sfml-dev.org/tutorials/2.1/audio-sounds.php - so I assume it isn't that. Is there a way that I setup SFML wrong? I'd appreciate any help I can get! Thanks!