SFML community forums

Help => Audio => Topic started by: Etane on June 17, 2009, 09:11:02 pm

Title: Basic Audio problem
Post by: Etane on June 17, 2009, 09:11:02 pm
I'm having a little trouble trying to load a music file (.OGG) into my application. i am using the tutorial source just to try and test the audio, but it cant seem to find the file specified..
Code: [Select]

#include <SFML/Audio.hpp>
#include <iostream>

int main()
{

    sf::Music Music;
    if (!Music.OpenFromFile("test.ogg"))
        return EXIT_FAILURE;


 
    Music.Play();


    while (Music.GetStatus() == sf::Music::Playing)
    {
 
        sf::Sleep(0.1f);
    }
 
    return EXIT_SUCCESS;
}



i have my IDE (VS 2008) set in debug mode, and i have the audio file (test) in both my debug folder and the directory of my solution. there is no error, i debugged it and Music.OpenFromFile() is returning false... but i can figure out why it cant find it. any help would be greatly appreciated.
Title: Basic Audio problem
Post by: Gelu on June 17, 2009, 09:36:43 pm
Did you copy the audio DLL's to your debug directory?

Did you try other file?
Title: Basic Audio problem
Post by: Etane on June 17, 2009, 10:18:47 pm
Yes i have tried 3 different files, and the DLL's are in both my system 32 and my debug folder, the app would not compile to begin with, if i didn't have them there. but thanks for the ideas.
Title: Basic Audio problem
Post by: Nexus on June 17, 2009, 11:54:10 pm
What does the SFML error output (stderr) say?

Maybe, the DLLs are not the right ones. Download OpenAL32.dll, wrap_oal.dll and libsndfile-1.dll, place them into your solution directory (not "Debug" folder) and try it again. I had a similar error a while ago.