Create a Instant Microphone Audio Record Script using arecord and amixer

Why:  Sometimes you need to record something NOW.  Not Click menus and press record realizing that the microphone volume is too low.

Uses amixer, arecord and xterm all which are native applications with most Linux distros.  The script can be shortcutted to a button on the panel and give instant feedback that it is working with VU meters.  The record file is date-timestamped for easy reference.

The script is below and is commented for a bit more info on its working.


#!/bin/bash
amixer sset -c 0 'Mic' playback off
amixer sset -c 0 'Mic' 90%
amixer sset -c 0 'Mic Boost' 90%
amixer sset 'Capture' cap
amixer sset -c 0 'Capture' 90%
xterm -e arecord ~/record_$(date +%Y%m%d%H%M%S).wav -v -V'stereo' -f cd &

When you are done, just kill the script using Control+C and look in your home directory to find the datestamped wav file.  I found the arecord operating sends the microphone boost to 100% upon execution, but so does audacity.  This is not an issue for me but you may choose to use a lower ‘Capture’ level to even things out.

To migrate this script to a button on the panel, chmod +x the script file, then add the following command as a Custom Application Launcher

sh /path/to/script.sh

WindyCityTech Blogger
WindyWindyCityTech WordPress

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s