I'm sure I'm doing something stupid, but I can't for the life of me get the audio system working. Not having any problems with graphics at all, just audio.
I'm using Microsoft Visual Studio C++ 2010.
I'm using SFML 1.6.
I've installed OpenAL.
I've installed libsndfile.
I'm linking:sfml-audio-d.lib; sfml-graphics-d.lib; sfml-main-d.lib; sfml-network-d.lib; sfml-system-d.lib; sfml-window-d.lib; opengl32.lib; glu32.lib; assimp.lib; BulletCollision-d.lib; BulletDynamics-d.lib; LinearMath-d.lib
My project configuration is set to Debug. My project SubSystem is set to Console (so I can vew std::cerr). The engine.hpp file is pretty complicated, but in this instance all it's doing is loading settings from an INI file and loading an sf::RenderWindow instance using the INI settings.
// Windows Headers
#include <Windows.h>
// SFML Headers
#include <SFML\System.hpp>
#include <SFML\Audio.hpp>
// ReoTekEngine Headers
#include "Engine.hpp"
int main(int argc, char* argv[])
{
// TODO: Parse Command Line Options Here.
rt::ReoTekEngine GameEngine;
GameEngine.LoadEngineSettings( "default.ini" );
GameEngine.OpenRenderWindow();
// TODO: Insert Code Here.
FILE *fp;
fp = std::fopen( "01_Reign_of_Hell.mp3", "r" );
if( fp == NULL )
{
// Error
std::cerr << "File \"01_Reign_of_Hell.mp3\" does not exist." << std::endl;
}
sf::Music MusicTrack;
if( !MusicTrack.OpenFromFile( "01_Reign_of_Hell.mp3" ) )
{
// Error
};
sf::Clock Clock;
while( Clock.GetElapsedTime() < 5.0f ){};
GameEngine.CloseRenderWindow();
GameEngine.SaveEngineSettings( "default.ini" );
return EXIT_SUCCESS;
}
I have 01_Reign_of_Hell.mp3 in the core project directory, same as my default.ini file which my application has no problems reading or writing. Using fopen to test the file shows that the file exists.
Can someone tell me why it would say "Failed to open "01_Reign_of_Hell.mp3" for reading"?