gpt4 book ai didi

linux - 在 Linux Mint 上使用 play 时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:54:09 24 4
gpt4 key购买 nike

我有一个脚本正在运行 play 并且以下错误“随机”出现在我的终端上:

play WARN alsa: under-run

是什么原因造成的?如果没有明显的解决方案,我可以以某种方式隐藏它吗?

这是我的脚本:

#!/bin/bash

$(stat -c %y ~/custom/log.txt > ~/custom/update.txt)

while :
do
now=$(stat -c %y ~/custom/log.txt)
update=$(cat ~/custom/update.txt)
if [ "$now" != "$update" ]
then
$(stat -c %y ~/custom/log.txt > ~/custom/update.txt)
$(play --single-threaded -nq synth 0.025 saw 299 vol 0.025)
fi
done

最佳答案

要忽略错误,您可以简单地将 stderr 转移到 /dev/null:

play --single-threaded -nq synth 0.025 saw 299 vol 0.025 2>/dev/null

请注意,这也会将任何其他错误转移到 /dev/null

关于linux - 在 Linux Mint 上使用 play 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28016620/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com