10

I'm trying to record a phone call made with Google Voice Chat using Audacity. I'm running Linux Mint 17.

In this example, I'm making an outbound phone call from my computer to a person on a normal phone. I will refer to audio travelling from my computer to the phone as outbound audio, and audio travelling from the phone to my computer as inbound audio.

I followed the section for PulseAudio in this tutorial. This almost works the way I want it to, but not perfectly because I can only record either outbound audio, or inbound audio, but not both simultaneously.

screenshot

In the PulseAudio Volume Control, there are 3 options available (see screenshot). They are:

  1. Monitor of GF108 High Definition Audio Controller Digital Stereo (HDMI)
  2. Monitor of Built-in Audio Analog Stereo
  3. Built-in Audio Analog Stereo.

If I choose option 1, no sound is recorded in Audacity. If I choose option 2, only inbound audio is recorded. If I choose option 3, only outbound audio is recorded.

This means that using Audacity, I can only record one side of the conversation at any given time. I'm trying to figure out how to record both sides of the conversation simultaneously.

The closest I have come to achieving my goal is to manually toggle the "ALSA Capture from" option between option 2 and option 3 during a conversation. But this is tedious and does not allow interruptions in the conversation to be recorded.

Is there a way to record both the "Built-in Audio Analog Stereo" and the "Monitor of Built-in Audio Analog Stereo" at the same time? If so, how?

axiopisty
  • 256
  • 1
  • 4
  • 16

4 Answers4

12

By creating a virtual sound card and looping back both the real sound card's input and output into it, it's possible to record both, without hearing yourself speak.

The following is adapted from this solution to a more complex problem.

First create a sink to be used as a virtual sound card, and add two loopbacks into it, which will be used to route the real sound card's input and output.

pacmd load-module module-null-sink sink_name=Virtual1 sink_properties=device.description=Virtual-Sound-Card
pactl load-module module-loopback sink=Virtual1
pactl load-module module-loopback sink=Virtual1

Next, open pavucontrol, navigate to the "Recording" tab and set the real sound card's input and output as the sources for each loopback, which in the OP's case would be "Built-in Audio Analog Stereo" and "Monitor of Built-in Audio Analog Stereo".

Example of Recording tab configuration

Finally, navigate pavucontrol's "Input Devices" tab and set the monitor of the virtual sound card as the fallback device (by clicking the button with a check mark in a green circle to the right of "Monitor of Virtual-Sound-Card").

Example of virtual sound card set as fallback

If you're using the ALSA plug-in, as depicted in the OP's screenshot, set "ALSA Capture from" to "Monitor of Virtual-Sound-Card" in the "Recording" tab.

Now, audacity should pick up the virtual sound card's input, which contains both the real sound card's input and output, while your speakers/headphones will still be reproducing the real sound card's output only, so you won't be hearing your microphone.

upuoth
  • 121
  • 1
  • 3
  • 1
    This almost works. I am able to redirect chromium karaoke music+mic input into audacity. The only problem is I don't hear any karaoke music while singing. Is there to send chromium audio to audacity+speaker/headset. – Peter Apr 05 '20 at 00:53
  • 1
    Works perfectly. You do not even have to set the monitor of the virtual sound card as fallback device. – Waschbaer May 15 '20 at 11:19
  • 2
    Is there a way to save the configuration in case of a system restart? Right now, I have to create the virtual sound card every time I startup Linux. – Waschbaer May 15 '20 at 11:20
  • This worked perfectly for me, thank you! This should be the accepted answer. – A B Jul 25 '22 at 14:00
8

You can try to enable "the stereo mixer" using pactl to load module-loopback

The idea is to mix the source stream from your microphone to the speakers. With a correct set for volume and reciprocal position of microphone and speakers you should be able to avoid the Larson effect. :-)

Load the module-loopback

 pactl load-module module-loopback

and after change the recording device (Alsa capture from) from the built-in to the monitor one.
[You find in Volume control->Recording->Alsa plug in / Alsa capture from].

There's a short video for Ubuntu system on youtube

Notes:

module-loopback
allows one to route audio from a source directly back to a sink.

Hastur
  • 18,764
  • 9
  • 52
  • 95
  • 12
    Is there a way to pipe both the output stream and input stream into a third stream which is then recorded? I'd like to record both sides of a conversation, but not hear my own voice through my speakers. – mhelvens Mar 27 '17 at 10:45
  • So there is no way to completely stop my own voice from playing back through my speakers? I've played with the volumes/gains and can see a sweet spot, but sound still comes through my headset enough to be annoying. – Vahid Pazirandeh Sep 13 '18 at 22:33
  • This works but latency is too bad. – Hendy Irawan Jan 08 '21 at 10:12
  • This answer should have a major caveat that you have to hear yourself since the input is looped. The other answer about creating a virtual device should be the accepted one instead! – A B Jul 25 '22 at 13:59
2

After trying all the hacks and tools (Audacity, audio recorder etc ). Finally found this Open Broadcaster Software (OBS), which is super easy and just does the job.

In Settings → Audio, I was able to select:

. Audio output (Either desktop or earphone or bluetooth also possible)
. Mic - (Desktop | earphone)

For Source, I selected Screen Capture (XSHM) to capture the entire desktop or can keep it blank as well.

To install:

sudo add-apt-repository ppa:obsproject/obs-studio && sudo apt install obs-studio

bak2trak
  • 121
  • 1
0

Note: Okay this answer might seem like a cop-out but it works and its great software, especially if you want to record your speaker output and microphone output at the same time. Or if you also need to video record your computer screen on top of the audio as well.

Anyways, been pulling my hair out forever googling for an answer that is simple to use and provides everything I need.

Just like the other user here, install and use Open Broadcaster Software (OBS). Seriously, that's it. Don't use the installation instructions from people here since it might be outdated. Googling "install OBS" or similar should bring up recent installation instructions tailored to your machine.

Just record with OBS and it will just make a video with your audio in it. If you only want to record audio, just record without a video source and it will make a blank video with your recording. If you want to record only speaker output and not the mic, simply mute the microphone with a press of a button. Intuitive.

(Note this gives you a video file. It doesn't bother me but if you need an audio file like an mp3 you would have to figure out how to convert the video file you made into an audio file (I don't know how to do that, but there are plenty of resources out there that tell you).)

jaquinocode
  • 101
  • 1