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

Author Topic: Disable audio filters  (Read 4516 times)

0 Members and 1 Guest are viewing this topic.

Mills

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Disable audio filters
« on: February 05, 2020, 05:47:39 pm »
I didn't  find anything related to this in the forums.

I am programming some kind of "fantasy computer"in CSFML just for fun, similar to pico-8 (and things like that).

I nearly got it working, and it uses tiny wave samples with very low quality (1000Hz). I want the sound to be even more "retro" disabling the filters.

Is it possible to disable the fefault filters used by openal wave player?

Thanks.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: Disable audio filters
« Reply #1 on: February 05, 2020, 06:29:59 pm »
What filters are you referring to exactly?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mills

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Disable audio filters
« Reply #2 on: February 05, 2020, 06:49:53 pm »
What filters are you referring to exactly?

I did not explain it very well, I think people call it "sound dithering". I attached two samples to show it.
I just resampled a small sample from 8192 Hz to 44100 without any filters.

I just can use the resampled sounds like that, but I wanted them to be tiny in size.

If the hardware or the player has no sound filter, it sounds like the unfiltered version. SFML is playing like the filtered one.




eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: Disable audio filters
« Reply #3 on: February 06, 2020, 04:58:56 pm »
I don't think we use any special filtering, but maybe it's just a default filtering or maybe we're doing some resampling, which will act as a "filter".
The fact is that SFML will load your file in the provided sample rate. Whether SFML then resamples that or whether OpenAL has some default filter, I don't know.

Maybe Laurent knows?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Disable audio filters
« Reply #4 on: February 06, 2020, 05:50:57 pm »
I don't know what OpenAL does internally, but I don't think there's any filter.

It's not clear how you produced these 2 files. And how you produced the file that you want SFML to play. Can you upload it?
Laurent Gomila - SFML developer

Mills

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Disable audio filters
« Reply #5 on: February 06, 2020, 09:01:36 pm »
I think nobody imagined OpenAL would be used with such low frequencies, so I just resampled the audio myself and solved the issue.

Input files are still at low sample rates, but I used the sound buffer functions from SFML to resample them internaly to 44100 (just copy from a sample array to other array), so that they sound "unfiltered" in all sound players.

About the sounds I uploaded...

I created the "filtered" wave in audacity, just resample from low sample rates to 44100, and it will also add some default dithering, destroying the retro sound.
The "unfiltered" file was created using open modplug tracker, which has a lot of "retro" options for audio.

Here you see the resampling options in open modplug:



And here the resampled waveforms (44100Hz):



Hope this helps someone trying to get retro sounds :).

« Last Edit: February 06, 2020, 09:05:50 pm by Mills »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Disable audio filters
« Reply #6 on: February 06, 2020, 09:46:33 pm »
I see. The default resampler in OpenAL-Soft seems to use linear interpolation. After a quick search I found that you can change this behavior in OpenAL's config file, see https://github.com/kcat/openal-soft/blob/master/alsoftrc.sample#L170
Laurent Gomila - SFML developer