New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some WAV files fail to play (regression) #955

Closed
crumblingstatue opened this Issue Aug 26, 2015 · 7 comments

Comments

Projects
None yet
6 participants
@crumblingstatue

crumblingstatue commented Aug 26, 2015

Since sometime after SFML 2.1, some WAV files that successfully played before fail to play.

Here is the code I've used to test:

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

int main() {
    sf::SoundBuffer buf;
    if (!buf.loadFromFile("Startup.wav")) {
        std::cerr << "Fatal error: Could not load sound file.";
        return 1;
    }
    sf::Sound sound(buf);
    sound.play();
    sf::sleep(sf::milliseconds(2000));
}

The files load without error, but when playing them, only silence can be heard.

I've uploaded 2 sample WAV files that fail to play to http://www.filedropper.com/bad.

I've tried bisecting, but I came across commits that make the test code fail to build, so there are multiple candidates:

6096d22 (Definitely not the one, only touches MSVC extlibs)
5e0e645 (Adds FLAC support, probably doesn't touch WAV?)
f0608ea (This is my suspect)
3fbfde3

Tested on Arch Linux, x86_64

@madpew

This comment has been minimized.

Show comment
Hide comment
@madpew

madpew Aug 26, 2015

From looking at the 2 example files given I suspect it might have something to do with either both files having a bitdepth of 24 instead of the default 16 and/or higher than usual samplingrates (48k and 96k) instead of the 44k default. But I'm just guessing.

madpew commented Aug 26, 2015

From looking at the 2 example files given I suspect it might have something to do with either both files having a bitdepth of 24 instead of the default 16 and/or higher than usual samplingrates (48k and 96k) instead of the 44k default. But I'm just guessing.

@LaurentGomila

This comment has been minimized.

Show comment
Hide comment
@LaurentGomila

LaurentGomila Aug 26, 2015

Member

Indeed, the WAV reader currently supports 8, 16 and 32 bits samples, but not 24.

Member

LaurentGomila commented Aug 26, 2015

Indeed, the WAV reader currently supports 8, 16 and 32 bits samples, but not 24.

@Foaly

This comment has been minimized.

Show comment
Hide comment
@Foaly

Foaly Aug 31, 2015

Contributor

I implemented a fix for this. If you want to you can check it out and test it.

Contributor

Foaly commented Aug 31, 2015

I implemented a fix for this. If you want to you can check it out and test it.

@Foaly

This comment has been minimized.

Show comment
Hide comment
@Foaly

Foaly Sep 1, 2015

Contributor

@crumblingstatue Hello I tryed to download your files to test if my fix solves the problem, but the download link is dead. Could you reupload the files, so we can be sure. Thanks!

Contributor

Foaly commented Sep 1, 2015

@crumblingstatue Hello I tryed to download your files to test if my fix solves the problem, but the download link is dead. Could you reupload the files, so we can be sure. Thanks!

@crumblingstatue

This comment has been minimized.

Show comment
Hide comment
@crumblingstatue

crumblingstatue Sep 18, 2015

@Foaly I tested your branch, the sound now plays audibly.
I also uploaded one of the sounds here: https://hostr.co/EdbamoWFmfuf

crumblingstatue commented Sep 18, 2015

@Foaly I tested your branch, the sound now plays audibly.
I also uploaded one of the sounds here: https://hostr.co/EdbamoWFmfuf

@Foaly

This comment has been minimized.

Show comment
Hide comment
@Foaly

Foaly Sep 18, 2015

Contributor

Cool! Thank you very much. Glad to hear it fixes your problem.

Contributor

Foaly commented Sep 18, 2015

Cool! Thank you very much. Glad to hear it fixes your problem.

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Sep 20, 2015

Member

Superseded by #958
Fixed in b7d7ac4

Member

eXpl0it3r commented Sep 20, 2015

Superseded by #958
Fixed in b7d7ac4

@eXpl0it3r eXpl0it3r closed this Sep 20, 2015

@eXpl0it3r eXpl0it3r added this to the 2.4 milestone Sep 20, 2015

@eXpl0it3r eXpl0it3r added s:superseded and removed s:accepted labels Sep 20, 2015

@eXpl0it3r eXpl0it3r self-assigned this Sep 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment