#!/bin/sh
model=tts_models/multilingual/multi-dataset/xtts_v2
mkdir out
if [ ! -t 0 ]; then
    while IFS= read -r line; do
        tts --text "$line" --model_name $model --speaker_wav samples/genericfemale.wav --language_idx en --out_path out/$(echo $line | sed 's/ /_/g').wav
    done
else
    for word in "$@";
    do
        tts --text "$word" --model_name $model --speaker_wav samples/genericfemale.wav --language_idx en --out_path out/$(echo $word | sed 's/ /_/g').wav
    done
fi
