暴力测试音频硬件shell脚本

以下Linux shell脚本用来结音频配件进行暴力测试。如有更好脚本,欢迎提供。

-----------------------------------------------------------------------

#! /bin/sh


while true

do

         aplay /root/test.wav & 

         sleep 8                 # sleep sometime < audio time length

         id=`ps | grep aplay | awk '{print $1}' | head -n 1`   # get the process id

        echo $id                # print the process id 

         kill -9 $id              # kill the aplay process
         sleep 20              # sleep 20 seconds
         sh /root/play.sh  # re-start this scripts

done

-----------------------------------------------------------------------

注:此处为什么用head,因为在buildroot下面,用ps | grep aplay会打印下面信息:

-----------------------------------------------------------------------

# ps | grep aplay
920 root aplay test.wav
922 root grep aplay

-----------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值