SFML community forums

Bindings - other languages => Java => Topic started by: Helios101 on February 22, 2014, 05:36:53 am

Title: .
Post by: Helios101 on February 22, 2014, 05:36:53 am
.
Title: Re: Problem with playing sound
Post by: pdinklag on February 22, 2014, 08:46:52 am
Well, did the sound load successfully, or do you get that "Error! sound failed to load properly" message in the console that you defined? You did not mention that. :)
Title: Re: Problem with playing sound
Post by: pdinklag on February 24, 2014, 07:23:14 am
Quote
Sound duration: 0.0 seconds
Well, there you have the reason as to why you don't hear anything.

Now, I'm pretty sure that your sound is not actually 0 seconds long, so something is probably wrong with the file. I think have made the experience myself that SFML (or to be more exact: libsndfile) does not support all WAV formats, however, I cannot find a reference right now.

Do you know exactly what format your WAV file is in? If not, could you upload it?

EDIT:
Little update, the libsndfile website lists the supported formats. Not sure how I didn't find it earlier:
http://www.mega-nerd.com/libsndfile/
Title: Re: Problem with playing sound
Post by: pdinklag on February 26, 2014, 02:28:58 pm
I'm honestly not sure. I know that the free tool Audacity can open as good as any WAV format. What I would do now is open that sound file in Audacity and save it as 16-bit PCM (pretty widespread standard that SFML can handle, too).

Would be nice to know if that works. Sorry I don't know an easier method right now. :(
Title: Re: Problem with playing sound
Post by: zsbzsb on February 26, 2014, 03:24:52 pm
I tried to upload the sounds but they are too large.

Well the forums aren't designed for that... ever consider an external hosting site like this (http://hashcookie.net/)?