How to record output to speakers?
Is there a program for Ubuntu that can record sounds of only the output of the speaker and not any voices from outside the PC?
Solution 1:
If I'm not wrong, then I guess you are talking about recording "Stereo Mix" or loopback Output.
In layman's terms, Recording Stereo Mix means recording sound from speaker output.
Here's how to do it:
- Install
pavucontrol
from Ubuntu Software Center. - Install
audacity
from Ubuntu Software Center. - Select
pulse*
as recording device in Audacity. - Click Record Button.
- Open PulseAudio Volume Control (Search For PulseAudio Volume Control in Dash).
- Select Recording Tab.
- Now You Should see ALSA plug-in [audacity]. If you do not see ALSA plug-in [audacity], make sure you have clicked Record Button in audacity. You should be running recording in audacity while performing next step.
- Select "Monitor from *". See screen shot.
- Now you should be able to record the sound you hear from speaker or headphones.
Note: Tested in Ubuntu 12.10
Reference PulseAudio - Ubuntu Wiki
Solution 2:
A very small, bare-bones software that does exactly what you need, is called (rather obviously) "Audio Recorder", installed like this:
sudo add-apt-repository ppa:audio-recorder/ppa
sudo apt-get update && sudo apt-get install audio-recorder
Files are saved automatically to the ~/Audio
directory.
Solution 3:
Command Line
-
Install
sudo apt-get install pulseaudio-utils lame mpg123
-
Search for your speakers and tap into your speaker's monitor stream:
pacmd list-sinks | grep -e 'name:' -e 'index' -e 'Speakers'
or
pacmd list-sources | grep -e 'name:' -e 'index' -e 'Speakers'
-
Play anything you want to record and type in
parec -d alsa_output.pci-0000_00_1f.3.analog-stereo.monitor | lame -r -V0 - out.mp3
-
Hit
ctrl+c
to stop recording and play the recorded filempg123 out.mp3
Minimalistic GUI
A very simple GUI to do this, pull all the files from here and run install.sh
Goto Dash and search for Record Speakers
Solution 4:
I just made a small alias to record the PC audio output with one single command and stored in opus format instead of mp3.
-
Install the required packages:
sudo apt-get install pulseaudio-utils opus-tools
-
Edit your
.bashrc
file:nano ~/.bashrc
Copy the line below and append it to the end of your
~.bashrc
:alias recaudio="parec --monitor-stream="$(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}')" | opusenc --raw - $(xdg-user-dir MUSIC)/recording-$(date +"%F_%H-%M-%S").opus"
Save the file by pressing Ctrl+X (to close
nano
), then Y (for "Yes") and Enter (to confirm the file name). -
Now load the new
~/.bashrc
(or simply open a new terminal):source $HOME/.bashrc
Then try, just type
recaudio
It will create a file in your Music home folder called recording-[DATE].opus
.
Enjoy.