#!/bin/bash # RECORD_FILE="/tmp/my_recording.wav" RECORD_TIME=5 echo "==================================" echo "Recording will begin in 5 seconds." sleep 1 # ====================================== echo "Recording is in progress." arecord \ --format=S16_LE \ --rate=16000 \ --channels=1 \ --duration=$RECORD_TIME \ $RECORD_FILE # ========================================= echo "Recording completed." echo "start play recording..." aplay $RECORD_FILE echo -e "\n play completed!"