我正在尝试编辑一个批处理文件,用于我正在处理的文本转语音功能。
基本上,我想把这个变成:
"SAY SOMETHING"
"SAY SOMETHING ELSE"
"ALSO SAY THIS"
变成这样:
voice -v 100 -r -2 -n "Microsoft Zira Desktop" -o "SAY SOMETHING.wav" -d "SAY SOMETHING"
voice -v 100 -r -2 -n "Microsoft Zira Desktop" -o "SAY SOMETHING ELSE.wav" -d "SAY SOMETHING ELSE"
voice -v 100 -r -2 -n "Microsoft Zira Desktop" -o "ALSO SAY THIS.wav" -d "ALSO SAY THIS"
可以做到吗?谢谢!
答案1
- Ctrl+H
- 找什么:
^((".+)")$
- 用。。。来代替:
voice -v 100 -r -2 -n "Microsoft Zira Desktop" -o $2.wav" -d $1
- 查看 环绕
- 查看 正则表达式
- 取消选中
. matches newline
- Replace all
解释:
^ # beginning of line
( # group 1
( # group 2
" # double quote
.+ # 1 or more any character but newline
) # end group 2
" # double quote
) # end group 1
$ # end of line
替代品:
voice -v 100 -r -2 -n "Microsoft Zira Desktop" -o # literally
$2 # content of group 2
.wav" -d # literally
$1 # content of group 1
截图(之前):
截图(之后):