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

Idea: Rename AddBackgroundNoise? #232

Closed
iver56 opened this issue Sep 16, 2022 · 3 comments
Closed

Idea: Rename AddBackgroundNoise? #232

iver56 opened this issue Sep 16, 2022 · 3 comments

Comments

@iver56
Copy link
Owner

iver56 commented Sep 16, 2022

I feel like it isn't limited to adding specifically background noise - it could be any type of noise or actually any audio (it doesn't have to be noise although that is a common thing to do)

Any suggestions for a better name? AddNoise? AddNoiseFromFiles? MixInSoundFile?

@atamazian
Copy link
Contributor

How about AddExternalNoise?

@sudhanshu22gupta
Copy link

Simply renaming might be confusing in some scenarios. In my opinion, repeat of sound is typical for background noise only.

# Repeat the sound if it shorter than the input sound

    # Repeat the sound if it shorter than the input sound
    num_samples = len(samples)
    while len(noise_sound) < num_samples:
        noise_sound = np.concatenate((noise_sound, noise_sound))

    if len(noise_sound) > num_samples:
        noise_sound = noise_sound[0:num_samples]

    # Return a mix of the input sound and the background noise sound
    return samples + noise_sound

If the rename is considered to make it more general, this functionality could be controlled by a boolean parameter like noise_repeat. For non-background noises, mixing of audio should only be allowed for same length files.

@iver56
Copy link
Owner Author

iver56 commented Mar 11, 2024

Ok

@iver56 iver56 closed this as completed Mar 11, 2024
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

3 participants