Closed shengchiliu closed 3 years ago
Hi. Apologies for this, we haven't updated the brian2hears
package in a while, so it has not kept up with the demise of Python 2 and weave and the related changes in Brian 2. We will hopefully fix this soon (see PR #11) and then make a new release. Until then you have three options:
pip install https://github.com/brian-team/brian2hears/archive/remove_weave.zip
@mstimberg many thanks for the solutions. Except this module error, there is another question that I hope to use cochlear filtering my HRTFs to get ideal localised HRTFs. Your example code demos how apply the HRTF to a sound (hrtf_fb = hrtf.filterbank(sound)), but for my case I simply want to get the filtered HRTFs. Do you know how to do get the HRTFs without applying to a sound? Thanks in advance.
I just made a new release, so if you update brian2hears to version 0.9.2 it should now hopefully work. I cannot comment much on the HRTF question, I'm only helping with the maintenance of this package, I haven't used it myself in a number of years. I think that the htrf
variable, i.e. before you call filterbank
on it is just the measured HRTF. it is stored as a Sound
object which might seem odd, but a Sound
is basically just an array of values together with the timing information, i.e. the sampling rate. You can call numpy.array(htrf)
to get it as a standard numpy array. You can find out more about this in the documentation.
I'm trying to use the example code https://brian2hears.readthedocs.io/en/stable/auto_examples/sound_localisation_model.html?highlight=cochlear%20filter%20hrtf#sphx-glr-download-auto-examples-sound-localisation-model-py to apply cochlear filtering to HRTFs. However, I got an error. (ModuleNotFoundError: No module named 'brian2.codegen.runtime.weave_rt')