question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pre-loading background noise (and IR) in __init__?

See original GitHub issue

If one of the objective of torch-audiomentations is to do fast augmentation on GPU as part of a larger network, reading from disk for each new audio sample would slow down the forward pass dramatically, wouldn’t it?

https://github.com/asteroid-team/torch-audiomentations/blob/02752c9d6b7892c67d541af0c5279ec00f8216e3/torch_audiomentations/augmentations/background_noise.py#L47-L51

Would it make sense to allow the user to preload the whole background noise collection in memory during __init__ and then read from memory in apply_transform?

Or, if the background noise collection is too big to fit in memory, we could load a bunch of them, use them for a while, and then load another (random) bunch of them, etc.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mparientecommented, Oct 9, 2020

I usually have 64GB or more of RAM but quite slow I/O, so yes, it makes complete sense.

Or, if the background noise collection is too big to fit in memory, we could load a bunch of them, use them for a while, and then load another (random) bunch of them, etc.

This is more complicated, because you don’t know what the user can afford etc… But still doable. But the first option is definitely possible and a preload_wavs flag or something like that could completely do the job.

1reaction
hbredincommented, Oct 9, 2020

Yes. Big RAM, slow I/O as well, here 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create A Custom Preloading Screen | CSS3 Tutorial
Learn how to create a custom CSS3 animated preloading screen. Use CSS3 transitions and CSS3 animations to create an elegant preloading screen effect....
Read more >
Load in Background - Optimizing Audio Load Times in Unity
Selecting both Preload Audio Data and Load in Background means the audio data will begin loading during the scene loading process, but the ......
Read more >
Create a Quick MooTools Slideshow with Preloading Images
The following code snippet will show you how to create a simple slideshow with MooTools; the script will also preload the images and...
Read more >
How to Create an Awesome Image Preloader - Code
To fix the problem mentioned above, we'll load the icon first, and then call the init function. But the loading icon is a...
Read more >
High Fidelity, Near-Field Two-Way Audio Reference With ...
also capture ambient noise in addition to the useful near-end audio signal. The captured multi-microphone audio signals are corrupted by acoustic background.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found