SFML community forums
Help => Audio => Topic started by: easy on September 22, 2011, 11:08:05 am
-
Hi!
I've got some Windows XP related problems.
The same version of SFML2 was compiled and installed on Windows XP and on Linux with no problems.
I have compiled my game on Windows, and added the neccessary .dlls: libsndfile-1.dll and openal32.dll, along with the sfml dlls.
A) First of all, it did not load any of my .ogg files (so I have later converted them to .wav). The output of the console was:
(https://legacy.sfmluploads.org/cache/pics/134_sfml2-audio-2.jpg)
Here's a 'corrupt' sound file:
https://legacy.sfmluploads.org/file/65 (https://legacy.sfmluploads.org/file/65)
This only happens on Windows, on Linux it's just fine.
Note that this particular problem was on VirtulaBox!
B) Still on VirtulaBox, sounds are converted to .wav, works both on Windows and on Linux, but on Windows, exiting the program throws this:
(https://legacy.sfmluploads.org/cache/pics/133_sfml2-audio.jpg)
C) On a real (non-VirtualBox) Windows XP, starts up fine, but there's no sound. Console output: "Failed to open the audio device". It does not crash on exit as in B).
The most important part for me is part C) the audio not playing on Windows.
Can you help me?
Thanks in advance,
easy
-
The most important part for me is part C) the audio not playing on Windows.
Can you help me?
This error is triggered when no audio device was found, which basically means that your audio is globally broken. I guess it's not true, otherwise you would already have noticed it ;)
Are you sure that it's the openal32.dll file from SFML which is used? For example, you could have another version in C:/Windows/System32.
-
This error is triggered when no audio device was found, which basically means that your audio is globally broken. I guess it's not true, otherwise you would already have noticed it
Yes, I've got sound otherwise :)
Are you sure that it's the openal32.dll file from SFML which is used? For example, you could have another version in C:/Windows/System32.
What do you mean? Is there an openal32.dll somewhere that comes with SFML?
Edit:
All right, Magic Man, with your versions of the .dlls, the game has sound!
Thank you! I wasn't aware of these libraries! :)
Just to report: it still crashes on exit, and it seems like playing many sounds simultaneously drop the FPS pretty much, and therefore the game lags. I have to investigate the latter more, since it might be the std::vector I'm using for storing temporary sounds... (although it does not happen on Linux)
-
Could someone please try to play this .OGG file with SFML on Windows?
https://legacy.sfmluploads.org/file/65 (https://legacy.sfmluploads.org/file/65)
It says it's 'malformed', but not on Linux.
-
Hi Laurent!
Still no avail:
I've tried .OGG, .FLAC files also, different Audacity versions, an other .OGG file but SFML2 does not play them. Reasons:
(https://legacy.sfmluploads.org/cache/pics/135_ogg-error.JPG)
(https://legacy.sfmluploads.org/cache/pics/137_flac-error-2.JPG)
Here's an independent sample .OGG file (http://lotr.wikia.com/wiki/File:HelmsDeepSound.ogg).
-
That's really bad because SFML uses libsndfile which uses the official Ogg/Vorbis library (libvorbis, at xiph.org).
-
I've just tried it out on a non-VirtualBox WindowsXP, and it was disappointing.
I've made 3 versions of the .exe, one for each music file type: OGG, FLAC, WAV.
The .OGG and .FLAC versions of it does not even start, constole message starts with "Failed to..." something, but it's too fast to read or to capture.
The .WAV version starts, but lags like hell, it's like 1-5-10 FPS, and the music does not play.
I've just installed M.A.R.S. which also uses SFML2, and has .OGG music, and here all the music and sounds plays well, so I don't know what's going wrong, I need to check their sources (and mine).
-
I can see no magic in their code, and I aslo can't see problems about mine:
What I do is, I open the music, set to loop, and play it.
I think I contact them, maybe they tell me what's the trick.
-
Do you mean that their OGG files don't work with your code?
-
Yes, I've just tried their "menu.ogg" out, the file is malformed, according to the console.
-
Weird. So they use a recent revision of SFML 2?
-
I guess not! But I've sent them a mail, we'll find out. BTW, I use this version: LaurentGomila-SFML-a647c68, which I've downloaded on 09. 14.
Edit: their version was compiled on 04. 26.
-
Can you try with the same version as them?
-
I did but back then there were no soundbuffer... arg! So evidently, it does not run even with their dlls. I'm gonna make a buit with no sounds but music!
Edit: ok, I've tried it, but then also the texture worked elsehow, because now it has problems with textures. I guess I should go with a minimal example instead.
-
All right, the minimal example worked fine with the dlls compiled by me, so it turned out that my game was still using somehow an other version of openal or libsndfile. Now I've copied these dlls into all the folders, and voilá! It works! :)