facebookresearch / sound-spaces

A first-of-its-kind acoustic simulation platform for audio-visual embodied AI research. It supports training and evaluating multiple tasks and applications.
https://soundspaces.org
Creative Commons Attribution 4.0 International
322 stars 55 forks source link

Using the same seed, the rendered IR is different #118

Open YYDreamzure opened 1 year ago

YYDreamzure commented 1 year ago

Hi, I have been trying to obtain RIR using Soundspace2.0. However, for the same seed (which leads to the same coordinates), the rendered IR is different for each run of the same script.

Using this script: seed = 11 sim.pathfinder.seed(seed) nav_point = sim.pathfinder.get_random_navigable_point() if sim.pathfinder.is_navigable(nav_point): audio_sensor.setAudioSourceTransform(nav_point + np.array([0.,1.66,0.])) observations = sim.get_sensor_observations() ir = np.array(sim.get_sensor_observations()["audio_sensor"]) print("Source name:", source_name, "World position:", coor) rt60 = measure_rt60(ir, sampling_rate, decay_db=30, plot=True) print(f'RT60 of the rendered IR for {source_name} is {rt60:.4f} seconds')

ChanganVR commented 1 year ago

Hi @YYDreamzure yes, that is true. Our path-tracing algorithm is based on Monte-Carlo sampling and thus there is some stochasticity to improve the speed, which is only for the indirect sound. For the direct sound, there should be no stochasticity.

YYDreamzure commented 1 year ago

@ChanganVR Thank you so much for your reply! In this case, would the simulated IR be affected by agent initialisation? For example, if I rerun the AgentInitialisation function everytime I changed a sound source location, would it be the same as when I use a single agent initialisation and do not re-run the AgentInitialisation function when I changed the source location? (All conditions set to False for Agent Initialisation) Thanks a lot for your help!

ChanganVR commented 11 months ago

Which AgentInitialisation function are you referring to? Are you talking about resetting the receiver location when you change the source location? If the location changes, of course, it will affect the IR since IR is a function of the receiver location. If you mean resetting the agent location to the same place, I don't see how it would affect the IR.