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

Author Topic: Cant get Audio to work?  (Read 8338 times)

0 Members and 1 Guest are viewing this topic.

WorldRacer

  • Newbie
  • *
  • Posts: 16
    • View Profile
Cant get Audio to work?
« on: May 22, 2009, 04:37:57 pm »
Hi,

have the following error:

Failed to open "data\samba.ogg" for reading
Failed to play audio stream : sound parameters have not been initialized (call Initialize first)

what I've done wrong?

Code: [Select]

        sf::Music muHintergrund;
        std::cout << "[Audio]: Loading Media-File \"samba.ogg\"" << std::endl;
if (!muHintergrund.OpenFromFile("data\\samba.ogg"))
{
App.Close();
}


And in front of the main loop:

Code: [Select]
muHintergrund.Play();

File is existing...

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Cant get Audio to work?
« Reply #1 on: May 22, 2009, 05:19:52 pm »
The code seems fine.

*Check for file permissions

*Try using the / slash  for paths instead of the  backslash \

-Martín

WorldRacer

  • Newbie
  • *
  • Posts: 16
    • View Profile
Cant get Audio to work?
« Reply #2 on: May 22, 2009, 05:27:46 pm »
Already tried your tips...No result.

//EDIT: The file I'd use was broken

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Cant get Audio to work?
« Reply #3 on: May 22, 2009, 05:34:00 pm »
Can you attach a minimal project that reproduces the error (and the sound file)?

So I can try to compile it here and see what happens.

Are you using the latest libsndfile-1.dll from the SFML distribution?
It should be in your PATH system variable, in the %WINDOWS%\System32 folder or in the project's folder.

WorldRacer

  • Newbie
  • *
  • Posts: 16
    • View Profile
Cant get Audio to work?
« Reply #4 on: May 22, 2009, 05:37:21 pm »
^^look at my edited post, please. Problem is solved now

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Cant get Audio to work?
« Reply #5 on: May 22, 2009, 06:18:50 pm »
Great!

I know this library seems buggy sometimes, but even that way most of the times the problem comes from somewhere else.

Regards