SFML community forums
Help => Audio => Topic started by: wogoo on February 02, 2014, 02:32:00 pm
-
I have to use the Sf::Sound to play music instead of sound effects, loading first the entire file from memory.
However on my slow computer the music plays terribly (cracks, blocks, etc).
Is there a way to do this?
Thanks.
-
Clean up your pc or buy a new one that can at least handle streaming a single file from the hdd ;)
-
I think Sf::Sound does not stream the file, Sf::Music does this, am i wrong?
-
sf::Sound loads all audio data into memory before playing.
sf::Music streams audio data from the disk while playing.
I thought you meant in your original post that sf::Music has issues while playing...
-
No, i don't.
I have to play music with Sf::Sound (for a reason i can't explain here) but when i do this on slow computers i get a very bad sound.
Is Sf::Sound played in a separate thread?
-
Yes sf::Sounds are played back in a different thread.
Just to get this right: You are loading a "music file" (a long sound file) in a sf::SoundBuffer and when you play it you get cracks and other distortions?
-
Yes, the music does not play smoothly, like it's not played in an other thread (the cracks and distorsions are dued to the lag of the sound).
I tried also some games on the same pc and the audio works properly.
-
What are the specs of the pc in question?
And what are the specs of the sound file? (length, format, sample rate, channel count)
-
My fault, now i tried Sf::Music and i get the same issue :/
The specs of the computer are not relevant, i played and developed games for years with it without problems.
Regarding the music i tried a lot of files and formats but i get the same behaviour.
I create also an empty project with only a single music played and i get the same issue.
Could it be an OpenAl/Libsnd problem?
-
It could also be a driver issue. Try updating your audio drivers and using the latest version of SFML (build it from github source) and also make sure you are using the latest version of OpenAL/libsnd from the github source bin folder. ;)
-
.ogg files that weren't normalized tend to crack. Post the file you have problem with if you can or try find or make another cracking one that you can share.
-
Solved ;)
The OpenAL.dll's for 32 and 64 bit are swapped in SFML downloads.
In the 32-bit version (i tried only Windows) there is the 64-bit OpenAL (454kb, and the 32-bit version is 410kb).
Also in the source file download the dll's are swapped.
Please someone tell Laurent, i also get a crash when i tried the new 32-bit version on GitHub.
The main problem is that when i try to use the 64-bit Libsnd i get a crash, this not happens with OpenAL.
Additionally as i said i have no problem with my main computer, i get this issues with the other one.
-
I'm currious as to why sf::Music couldn't be used???
-
I'm currious as to why sf::Music couldn't be used???
...a reason i can't explain here...
Sounds ominous, doesn't it? ???