LCAV / pyroomacoustics

Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
https://pyroomacoustics.readthedocs.io
MIT License
1.35k stars 419 forks source link

set_air_absorption question #191

Closed opasquetdotfr closed 6 months ago

opasquetdotfr commented 3 years ago

Hello !

I am trying to change 'set_air_absorption'. Should I simply use: room.set_air_absorption("0.0001, 0.0003, 0.0006, 0.001, 0.0019, 0.0058, 0.020300000000000002")

If so, I get the error: File "XXX/pyroomacoustics/room.py", line 942, in set_air_absorption self.air_absorption = self.physics().get_air_absorption() TypeError: 'Physics' object is not callable

I instead use: room.air_absorption = [x., x., x., x., x., x., x.] for "center_freqs": [125, 250, 500, 1000, 2000, 4000, 8000]

I am trying to do something that sounds different than a natural air reverb. My dream would be negative air absorption factors. So I am playing with parameters such as extreme speeds of sound etc. If you have an idea of which params I could play with...

Thank you very much !!

O.

fakufaku commented 3 years ago

Hi @opasquetdotfr , Apologies for the long delay to reply. Thank you so much for reporting this problem!!

There are two problems here. 1) I did not properly test this function and there is a bug that prevents the coefficients provided to be used 🙄 2) Once the bug is fixed, the code above will still not work because the coefficients should be provided in a list or array, e.g.

room.set_air_absorption([0.0001, 0.0003, 0.0006, 0.001, 0.0019, 0.0058, 0.020300000000000002])

I will update here when I fix the bug!

jvietorisz commented 8 months ago

Hello,

I am getting the same error in a more simple case, where I am interested in setting a single constant absorption coefficient (to mimic sound waves propagating through shallow water). Was this backend issue ever resolved? Thanks!

fakufaku commented 6 months ago

@opasquetdotfr @jvietorisz sorry this took so long, the bug is now corrected.