Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Basic Audio problem  (Read 4434 times)

0 Members and 1 Guest are viewing this topic.

Etane

  • Newbie
  • *
  • Posts: 2
    • View Profile
Basic Audio problem
« 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.

Gelu

  • Newbie
  • *
  • Posts: 2
    • View Profile
Basic Audio problem
« Reply #1 on: June 17, 2009, 09:36:43 pm »
Did you copy the audio DLL's to your debug directory?

Did you try other file?

Etane

  • Newbie
  • *
  • Posts: 2
    • View Profile
Basic Audio problem
« Reply #2 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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Basic Audio problem
« Reply #3 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything