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

Author Topic: SFML 2.3 sound clipping  (Read 3643 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
SFML 2.3 sound clipping
« on: July 07, 2015, 06:09:31 pm »
Hello

I've just upgraded from 2.1 to 2.3, and the first thing I've noticed is that my sound files are "clipping", making a kind of crackling/corrupting sound at the end. They are all .wav files.

It looks like a lot of stuff has changed in SFML 2.3, audio wise, has anyone else seen this issue?

Thanks
Ed
SFML 2.1

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: SFML 2.3 sound clipping
« Reply #1 on: July 07, 2015, 06:20:03 pm »
Can you provide one of said wave files and describe better when and how the "clipping" occurs. The term clipping is a specific meaning when it comes to audio, so I wonder whether you actually mean clipping or just a clipping sound.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: SFML 2.3 sound clipping
« Reply #2 on: July 08, 2015, 10:03:27 am »
Hi

See this example wave file - but every wave file in the game has the same problem..and it was working fine on 2.1 and 2.2. I see libsndfile DLL is no longer required; can someone explain (or show me documentation) why this is?

By "clipping" I mean a clipping noise, but also there is a kind of pop noise, and a "scratching" sound also. I have seen this problem on other embedded hardware  I used to use, which is normally because there is a driver problem with transferring data to the audio chip, and the amplifier just makes these noises because the data is junk.

Any changes to OpenAL, etc??

Thanks
Ed
SFML 2.1

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: SFML 2.3 sound clipping
« Reply #3 on: July 08, 2015, 10:33:39 am »
libsndfile was removed because its licensing didn't allow for static linking on iOS and iOS only supports static linking, instead we now use vorbis, ogg and flac directly.

OpenAL has not been updated between 2.2 and 2.3 as such I don't see this to be the issue.

I've just tried this sample code with your wave file and everything seems to play nicely on my Windows 8.1 machine.

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

int main()
{
        sf::SoundBuffer buf;
        buf.loadFromFile("button_click.wav");
       
        sf::Sound sound;
        sound.setBuffer(buf);
        sound.play();
       
        while(sound.getStatus() == sf::Sound::Playing)
                sf::sleep(sf::seconds(1.f));
}

Am I assuming right that this is on Windows XP?
We had someone else report an issue with his Windows XP machine, but in the end it seemed to have been a driver issue or similar. Personally I suggest you to build everything including the dependencies from scratch on your XP machine, that way you get "native" libraries for your system and compiler. Not sure if that will solve the issue though, but if you can't find an other way, this might be worth trying.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: SFML 2.3 sound clipping
« Reply #4 on: July 08, 2015, 10:37:05 am »
Thanks for the info and testing; actually this is on Win 7. I'll rebuild everything and see what happens :)
SFML 2.1

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: SFML 2.3 sound clipping
« Reply #5 on: July 08, 2015, 10:45:35 am »
Hmmm...

Well I suggest to build SFML with your compiler first, then run my short example and if that doesn't work you could still try to rebuild the dependencies, though I think that won't fix things.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/