美文网首页
数字音频生产脚本

数字音频生产脚本

作者: 泛坷 | 来源:发表于2023-12-13 16:41 被阅读0次
#!/bin/bash

output_file="numbers.txt"
audio_output_file="output.aiff"

output_mp3_file="output.mp3"

# 生成数字文本文件
for i in {1..200}; do
   echo "$i\n" >> $output_file
done

# 读取所有文本到一个变量
text_to_say=$(cat "$output_file")

# 通过say命令将所有文本转为一个音频文件
say "$text_to_say" -o "$audio_output_file"

echo "🍺音频文件已生成:$audio_output_file"

ffmpeg -i "$audio_output_file" -acodec mp3 -ab 192k "$output_mp3_file"

echo "🍺MP3文件已生成:$output_mp3_file"

ffmpeg相关配置

安装Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装ffmpeg:

brew install ffmpeg

更新Homebrew

brew update

尝试重新安装ffmpeg

brew reinstall ffmpeg

清理Homebrew缓存

brew cleanup

检查ffmpeg是否成功安装

ffmpeg -version

检查ffmpeg的详细信息

which ffmpeg

设置倍速

ffmpeg -i input.mp3 -filter:a "atempo=0.7" output_slow.mp3

相关文章

网友评论

      本文标题:数字音频生产脚本

      本文链接:https://www.haomeiwen.com/subject/wsabgdtx.html