在Linux Mint上使用play时出错

时间:2015-01-19 01:05:42

标签: linux bash

我有一个运行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

1 个答案:

答案 0 :(得分:1)

要忽略该错误,您只需将stderr转移到/dev/null

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

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

相关问题