Saturday, November 16, 2019

Random Mixing of Noises to Speech ( Two different folder)

Random Mixing of Noises to Speech ( Two different folder)

folder="clean_audio"
out_folder="wind_mixed_audio"
sep="_"
#akumar31 ,aprasad4 ,chanthu ,chirag ,rsandhu
for file in $folder/*.wav
do
    filename=`basename $file`
    #outfile=rsandhu_$filename
    echo $file
    #sox -r 48000 -c 1 $file -r 16000 -c 1 $outfile
    wind_file=`ls /data/alok/processed_wind_noise/alok/*.wav |sort -R  | tail -n 1`
    echo $wind_file
    sox -m $file  $wind_file $out_folder/mix_$filename trim 0 `soxi -D $file`
done  

===
random copy 50 files

a=0
while [ $a -lt 50 ]
do
    # Print the values
    echo $a
    wind_file=`ls *.wav |sort -R  | tail -n 1`
        echo $wind_file
        cp $wind_file gen_eng_samples/.

    # increment the value
    a=`expr $a + 1`
done

===
fade in and out at start and end of Audio

#! /bin/bash

FADE_IN_L="0:3"
FADE_OUT_L="0:4"


for i in *.wav
do
        
        LENGTH=`soxi -d $i`
        sox $i faded/$i fade $FADE_IN_L $LENGTH $FADE_OUT_L
done

No comments:

Post a Comment

Featured Post

XDP - Getting Started with XDP (Linux)