Created
November 26, 2021 14:50
-
-
Save nac-39/85f929ad43def0d4a77fdb7eeccb8cec to your computer and use it in GitHub Desktop.
test.csvの一列目から音声を出力するコード.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export LANG=C | |
while read row; do | |
column1=`echo ${row} | cut -d , -f 2` | |
echo "${column1}..." | |
say -v Yuri "${column1}" -o "${column1}.aiff" | |
ffmpeg -loglevel 0 -i "${column1}.aiff" "${column1}.mp3" | |
rm -f "${column1}.aiff" | |
# 環境設定>アクセシビリティ>読み上げコンテンツ>システムの声から好きなやつを選んでね | |
done < test.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
これはMac専用のコードです.
Yuriはロシア人の声なので,お好みの国の声をMacの環境設定>アクセシビリティ>読み上げコンテンツ>システムの声から選んでね.
あとhomebrewでffmpegをダウンロードしてから実行してね.
csvは行と行の間を一行開けないとうまく行かなかった.検索と置換使ってうまくやろう.(\n -> \n\n)
zsh使ってる人は
で実行してね.