Skip to content

Transformation block that mixes custom background noise into audio files

Notifications You must be signed in to change notification settings

vpeopleonatank/example-transform-block-mix-noise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transformation block: Mix background noise into audio files

This is an Edge Impulse transformation block that mixes background noise into audio files. It randomly picks a background sample, randomly changes the volume on the noise, and then combines these with the original file. It also downsamples the final audio file. You can use this to augment your data with realistic background noise in Edge Impulse.

Usage in Edge Impulse

  1. Install the Edge Impulse CLI.

  2. Initialize the block:

    $ edge-impulse-blocks init
    

    (To log in with a different account, run edge-impulse-blocks init --clean)

  3. Push the block:

    $ edge-impulse-blocks push
    
  4. In your Edge Impulse organization now go to Data transformation > Transformation blocks, select your new transformation block and click Edit transformation block. Then for 'CLI Arguments' set --frequency 16000 --out-count 10.

How to test locally

  1. Install Docker for desktop.

  2. Build the container

    $ docker build -t transform-mix-noise .
    
  3. Run the script (this creates 10 files, and downsamples to 16KHz):

    $ docker run --rm -it -v $PWD/:/data transform-mix-noise --in-file /data/data/jan.wav --out-directory /data/out --frequency 16000 --out-count 10
    
  4. The out/ directory now contains 10 files.

Updating the background audio file

To change the background audio go to Dockerfile and change the URL of the YouTube video. Alternatively you can copy a file into the container yourself.

About

Transformation block that mixes custom background noise into audio files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 70.7%
  • Dockerfile 29.3%