audiblelight.synthesize.render_event_audio

audiblelight.synthesize.render_event_audio#

audiblelight.synthesize.render_event_audio(event, irs, mic_alias, ref_db=-65, ignore_cache=True, fft_size=512, win_size=256, hop_size=128)#

Renders audio for a given Event object.

Audio is rendered following the following stages:
  • Load audio for the Event object and transform according to given SNR, noise floor, effects, etc.

  • Convolve Event audio with IRs from associated Emitter objects

Note that this function has no direct return. Instead, it simply populates the spatial_audio attribute of the event, which can then be written using (e.g.) librosa, soundfile, etc.

Parameters:
  • event (Event) – the Event object to render audio for

  • irs (np.ndarray) – the IR audio array for the given event, taken from the WorldState and this event’s Emitters

  • mic_alias (str) – the microphone alias associated with the IRs used here

  • ref_db (custom_types.Numeric) – the noise floor for the Scene

  • ignore_cache (bool) – if True, any cached spatial audio from a previous call to this function will be discarded

  • fft_size (custom_types.Numeric) – size of the FFT, defaults to 512 samples

  • win_size (int) – the window size of the FFT, defaults to 256 samples

  • hop_size (custom_types.Numeric) – the size of the hop between FFTs, defaults to 128 samples

Returns:

None

Return type:

None