Comments (5)
Some things to check:
-
sounds_path should refer to a folder, not a file
-
If the clean file is all silence, then the output will also be all silence, since the level of the added noise is relative to the amount of signal
If this does not help, can you please share the audio files to help reproduce the issue?
from audiomentations.
@scasasso Are you still having this issue? Did you do more digging based on my comment above?
from audiomentations.
I added a note to the AddBackgroundNoise docstring. Closing this issue now due to lack of response. Let's reopen this if it's a bug that can be reproduced and should be fixed.
from audiomentations.
Some things to check:
- sounds_path should refer to a folder, not a file
- If the clean file is all silence, then the output will also be all silence, since the level of the added noise is relative to the amount of signal
If this does not help, can you please share the audio files to help reproduce the issue?
import numpy as np
import time
import os
from scipy.io import wavfile
from audiomentations import (
AddGaussianNoise,
TimeStretch,
PitchShift,
Shift,
Normalize,
FrequencyMask,
TimeMask,
AddGaussianSNR,
Resample,
ClippingDistortion,
AddBackgroundNoise,
AddShortNoises,
PolarityInversion,
Gain,
Mp3Compression,
LoudnessNormalization,
Trim,
LowPassFilter,
HighPassFilter,
BandPassFilter,
ApplyImpulseResponse,
Reverse,
)
from audiomentations.core.audio_loading_utils import load_sound_file
from audiomentations.core.transforms_interface import (
MultichannelAudioNotSupportedException,
)
import librosa
noise_path = '/home/yinxingpan/audio_mentation/bg_noises'
augment = AddBackgroundNoise(
sounds_path=noise_path,
p=1
)
def read_raw_audio(audio, sample_rate=16000):
wave, _ = librosa.load(os.path.expanduser(audio), sr=sample_rate)
return wave
my_audio = read_raw_audio("abc.wav")
my_audio_with_noise = augment(my_audio, 16000)
wavfile.write("abc1.wav", rate=16000, data=my_audio_with_noise)
from audiomentations.
@laoyin are you having this issue with AddBackgroundNoise as well? I see you added a speech recording and some code. Can you give me a bit more context?
from audiomentations.
Related Issues (20)
- Dereverberation transform
- Improve Shift transform
- Add support for target_peak_dbfs and maybe a "true peak" boolean in Normalize
- Add support for zero phase peaking filter
- Add support for zero phase low/high shelf filter
- Speed augmentation HOT 4
- Add Chorus transform HOT 2
- Add Phaser transform HOT 1
- Add parameter for ensuring mp3 compression output length is the same as the input length HOT 3
- Enhance pitch shifting HOT 1
- test_simulate_apply_parity failure HOT 5
- Report specific python minor version HOT 2
- test_simulate_apply_parity - AssertionError: approx() is not supported in a boolean context HOT 7
- Obsolete link to DOI on the documentation page HOT 1
- Reference to non-released version in docs
- Add issue templates to the repository
- Question about documentation creation HOT 1
- Transform for adding noise with the same spectral profile as the given signal
- The blank frame will be added after applying the Limiter HOT 5
- Avoid picking silent part of noise file HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audiomentations.