在子进程里执行shell命令
shell 可以通过添加一个小括号的方式,让命令在子shell进程执行,和bash xxx.sh
执行效果一样,运行过程中设置的环境变量,cd,exit都不影响当前shell,如:
func1() {
(
cd /tmp
touch testfile
exit 0
)
}
shell 可以通过添加一个小括号的方式,让命令在子shell进程执行,和bash xxx.sh
执行效果一样,运行过程中设置的环境变量,cd,exit都不影响当前shell,如:
func1() {
(
cd /tmp
touch testfile
exit 0
)
}
现在的手机通讯录都支持单独设置震动、铃声,所以这里提供一个生成无声的铃声的方法:
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -t 10 silence-ring.wav
-f lavfi
:表示使用滤镜anullsrc
:代表无声音源channel_layout=stereo
:立体声sample_rate=44100
:标准采样率-t 10
:持续时间为 10 秒wav
改为 mp3
来输出 MP3 文件