Skip to content

Commit

Permalink
disallow spaces in filenames, convert to underscores (fixes previous …
Browse files Browse the repository at this point in the history
…commit)
  • Loading branch information
proycon committed Feb 16, 2023
1 parent 9802780 commit 7156b55
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions asr_nl/kaldi_recog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,10 @@ fi
cd "$resourcedir" || fatalerror "Resourcedir not found"
for inputfile in "$inputdir"/*; do

# added to robustify against spaces om filenames (louis)
filename0=$(basename "$inputfile")
echo "Processing $filename0" >&2
filename=`echo $filename0 | sed 's/ /_/g'`
echo "Processing $filename" >&2

extension="${filename##*.}"
file_id=$(basename "$inputfile" ."$extension")
file_id=$(basename "$inputfile" ."$extension" | sed 's/ /_/g')
sox "$inputfile" -e signed-integer -c 1 -r 16000 -b 16 "$scratchdir/${file_id}.wav" || fatalerror "Failure calling sox"
target_dir="$scratchdir/${file_id}_$(date +"%y_%m_%d_%H_%M_%S_%N")"
mkdir -p "$target_dir" || fatalerror "Unable to create temporary working directory $target_dir"
Expand Down

0 comments on commit 7156b55

Please sign in to comment.