Skip to content. Skip to navigation

ICTP Portal

Sections
You are here: Home linux sala registrazione noise reducer (post-processing script)
Personal tools
Document Actions

noise reducer (post-processing script)

Click here to get the file

Size 1 kB - File type text/x-sh

File contents

#!/bin/bash

noise_profile=/data/recording/noise_profile.sox

target=${1}

if [ -z "$target" ]; then
    echo "Missing mandatory argument"
    echo "Usage: $0 file"
    echo "noise profile file: $noise_profile"
    ecit 1
fi

[ -n "$2" ] && noise_profile=${2}

if ! [ -f "$noise_profile" ]; then
    echo "Missing noise profile file $noise_profile"
    echo "Exiting"
    exit 1
fi

fmt=$(echo $target|sed 's/.*\.\([^\.]*\)/\1/g')
new_target=$(echo $target | sed "s/.${fmt}$//")
new_target=${new_target}_reduced.${fmt}


sox ${target} ${new_target} noisered ${noise_profile} 

Powered by Plone This site conforms to the following standards: