Wednesday, 22 May 2013

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

No comments:

Post a Comment