Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wired Behavior of AudioSensor #127

Open
ZetaRing opened this issue Sep 6, 2023 · 3 comments
Open

Wired Behavior of AudioSensor #127

ZetaRing opened this issue Sep 6, 2023 · 3 comments

Comments

@ZetaRing
Copy link

ZetaRing commented Sep 6, 2023

Hi, I am working with sound space but found something strange. Can anyone help me out?
I am reading RIR from a audio sensor but the length of RIR arrays changed after first time. I think the RIR array should be same because the agent did not move and the simulator time did not change. Here is my code:

    cfg = conf()
    sim = habitat_sim.Simulator(cfg)

    audio_sensor = sim.get_agent(0)._sensors["audio_sensor"]
    audio_sensor.setAudioMaterialsJSON("data/mp3d_material_config.json")
    audio_sensor.setAudioSourceTransform(np.array(source))
    for i in range(4):
        obs = sim.get_sensor_observations()
        rir = np.array(obs["audio_sensor"]).T
        print(sim.get_world_time(), len(rir))

Here is the output:

0.0 17194
0.0 19065
0.0 19065
0.0 19065

Here is the config of the audio sensor:

    audio_sensor_spec = habitat_sim.AudioSensorSpec()
    audio_sensor_spec.uuid = "audio_sensor"
    audio_sensor_spec.enableMaterials = True  # make sure _semantic.ply file is in the scene folder
    audio_sensor_spec.channelLayout.type = habitat_sim.sensor.RLRAudioPropagationChannelLayoutType.Mono
    audio_sensor_spec.channelLayout.channelCount = 1
    audio_sensor_spec.position = [0.0, 1.5, 0.0]
    audio_sensor_spec.acousticsConfig.sampleRate = 16000
    audio_sensor_spec.acousticsConfig.indirect = True
    sensors.append(audio_sensor_spec)
@ZetaRing ZetaRing closed this as completed Sep 6, 2023
@ZetaRing ZetaRing reopened this Sep 6, 2023
@ZetaRing ZetaRing changed the title Wired Behavior of AudioSensor A Serious Bug of AudioSensor Sep 19, 2023
@ChanganVR
Copy link
Contributor

@Wind-Wing the acoustics simulation is based on Monte-Carlo path tracing to speed things up so there is a little bit of stochasticity (expected). However, the macro characteristics of the impulse response should be almost the same, e.g., rt60. If you plot these impulse responses, you should not really see a difference. Let me know if this is what you observe.

@ZetaRing ZetaRing changed the title A Serious Bug of AudioSensor Wired Behavior of AudioSensor Sep 28, 2023
@ZetaRing
Copy link
Author

Thanks for the replay! The plots are almost the same.
However, I think the doc should mention this problem. This output is really confusing.

@ChanganVR
Copy link
Contributor

Sounds good. Will add that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants