Recording audio from mic and speakers from commandline
I am using Fedora-21 workstation. I want to record audio, sometimes from my mic and sometimes from speakers. I am using the following command for it.
ffmpeg -f alsa -i pulse -c:a libmp3lame output.mkv
To record from my Mic: After executing this command, I goto "Volume Control" settings in GUI, then goto "Recording" tab, change it to "Built-in Audio Analog Stereo".
To record from my Speakers: After executing this command, I goto "Volume Control" settings in GUI, then goto "Recording" tab, change it to "Monitor of Built-in Audio Analog Stereo".
But how can this be done completely from command-line, for automating it using scripts.
P.S.: I want to integrate this solution with few other thing that I do using ffmpeg. So I would prefer a solution using ffmpeg.