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

Author Topic: Audio (v 2.32 versus v 2.1)  (Read 6121 times)

0 Members and 2 Guests are viewing this topic.

fastrgv

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Audio (v 2.32 versus v 2.1)
« on: March 18, 2016, 11:56:24 pm »
Attached is a WAV file that worked in 2.1 and not in 2.32.  More importantly, it was very painful for me to discover the problem.  If it is easily possible I would like to see a filename printed out before a failure exit message: invalid or unsupported file.  Thx. Rod

...well I guess it's not attached...too large

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Audio (v 2.32 versus v 2.1)
« Reply #1 on: March 19, 2016, 01:28:36 am »
If your error handling is thorough, it would have been much more simple to narrow down where the problem is.

For example:
sf::SoundBuffer soundBuffer;
if (!soundBuffer.loadFromFile("sound.wav")
{
    std::cerr << "Could not load sound." << std::endl;
    return EXIT_FAILURE;
}

Or, if that isn't enough:
const std::string soundFilename{ "sound.wav " };
sf::SoundBuffer soundBuffer;
if (!soundBuffer.loadFromFile(soundFilename)
{
    std::cerr << "Could not load sound: " soundFilename << std::endl;
    return EXIT_FAILURE;
}
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

fastrgv

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Audio (v 2.32 versus v 2.1)
« Reply #2 on: March 19, 2016, 03:05:56 am »
Yes, I'm working on that.

 I mainly wanted people to be aware that WAV files that used to be acceptable in earlier versions of SFML audio may not be now.  I've googled and found many queries about problems with WAV files and this may explain why.  My solution was to use sox to convert to OGG format.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Audio (v 2.32 versus v 2.1)
« Reply #3 on: March 19, 2016, 08:51:15 am »
There has already been a fix. Check out the latest master.

It's just certain wave files that caused trouble.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

fastrgv

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Audio (v 2.32 versus v 2.1)
« Reply #4 on: March 19, 2016, 02:08:33 pm »
Thanks, good to hear that you have a fix already.  In case anyone is interested, here is a shortened version of the WAV file that gave me grief...

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Audio (v 2.32 versus v 2.1)
« Reply #5 on: March 21, 2016, 12:25:42 pm »
I mainly wanted people to be aware that WAV files that used to be acceptable in earlier versions of SFML audio may not be now.
That's very good of you and I apologise if I sounded rude or harsh.
I was mainly responding to this part of your question:
it was very painful for me to discover the problem.  If it is easily possible I would like to see a filename printed out before a failure exit message: invalid or unsupported file.
and it was a suggestion for future  ;)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

fastrgv

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Audio (v 2.32 versus v 2.1)
« Reply #6 on: March 21, 2016, 02:55:11 pm »
My error handling was indeed insufficient, mostly because I had never before had any problem with SFML, but also because the code in question is a neglected Ada binding on which I had spent minimal effort.  If anyone has the time to check it out, you can see the final result ... a 3D game called AdaGate (written almost completely in Ada):

https://github.com/fastrgv/AdaGate
« Last Edit: March 29, 2016, 08:09:30 pm by fastrgv »

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Audio (v 2.32 versus v 2.1)
« Reply #7 on: March 21, 2016, 06:55:08 pm »
What issue was that? Have I broken something with https://github.com/SFML/SFML/pull/1018 ?
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Audio (v 2.32 versus v 2.1)
« Reply #8 on: March 21, 2016, 08:17:30 pm »
I don't think so. He is still using 2.3.2, so he doesn't have your fix.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

fastrgv

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Audio (v 2.32 versus v 2.1)
« Reply #9 on: March 21, 2016, 11:31:40 pm »
...that is correct, I have not tried anything beyond 2.3.2 yet on my problem file.  Rod

 

anything