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

Author Topic: Bad sound playing  (Read 5871 times)

0 Members and 2 Guests are viewing this topic.

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Bad sound playing
« on: April 07, 2014, 09:19:07 pm »
I have a sound with sand rustling, but in SFML it sounds like (clap?) Sorry, i don't know how to call this sound. I thought it's my fault, then I tested it in SFML Sound example with the same result. Or may be it is OpenAL's fault?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Bad sound playing
« Reply #1 on: April 07, 2014, 09:22:57 pm »
My guess would be that you are running into this issue: https://github.com/SFML/SFML/issues/310
Easiest fix is to simply reencode your sound and ensure that samples are normalized.

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Bad sound playing
« Reply #2 on: April 07, 2014, 09:30:50 pm »
I tried with converted to wav 22KHz mono - same result. Or this is not enough? Last versions of OpenAL and libsndfile not given effect too.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Bad sound playing
« Reply #3 on: April 07, 2014, 09:32:50 pm »
The issue is not mono vs stereo, nor the sample rate (22Mhz or other). It's the range of the individual samples.

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Bad sound playing
« Reply #4 on: April 07, 2014, 09:35:40 pm »
Yeah, but i hoped that converting process will clamp samples.

22Mhz
Are you going to kill someone? =)

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Bad sound playing
« Reply #5 on: April 07, 2014, 09:38:54 pm »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Bad sound playing
« Reply #6 on: April 07, 2014, 09:56:42 pm »
You know, if you want anyone else besides you to test it, you should provide a minimal and complete example and if that's about the same issue as in your project thread, then I guess it's still the issue of playing the sound too fast one after the other. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Bad sound playing
« Reply #7 on: April 07, 2014, 10:12:06 pm »
you should provide a minimal and complete example

I tested it in SFML Sound example with the same result.
I think all of us here have this minimal and complete example.  ;)

jannugimes

  • Guest
Re: Bad sound playing
« Reply #8 on: April 12, 2014, 02:49:15 pm »
22Mhz is how much frequency

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Bad sound playing
« Reply #9 on: June 29, 2014, 04:23:21 pm »
I played back your sound file in a media player (i.e. not using SFML) and it still sounds like a clap. If it's supposed to be rustling then your sample rate is too high. You can play it slower in SFML by reducing its pitch. You might instead want to alter it to the correct rate in a sample editor.

EDIT: The sample you attached is a clap-type sound. There is no rustling in it. If you want a rustling sound, you should use a rustling sample  ;)
« Last Edit: June 29, 2014, 04:33:20 pm by Golden Eagle »
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*