How can I "record" sound directly from an audio file?

1

1

What is the easiest way to route an audio output (e.g. a playing song) into the recording input of another application (e.g. discord's microphone input)?

I'm looking for a solution that is independent on the output volume and device.

For example: I want an audio file to play at full volume into discord's microphone input while my output volume is only at 20%. I do not neccessarily need to hear the audio file myself.

I'm self-answering this for Linux, but looking for someone who can provide a Windows and Mac OS solution too for a complete Q&A on this issue.

confetti

Posted 2018-08-16T12:19:53.153

Reputation: 1 625

Answers

3

Linux solution:

  1. Install pavucontrol, on my system it came with pulseaudio.
  2. Add a dummy audio device (basically a virtual soundcard): sudo modprobe snd-aloop. This uses alsa's module which for me uses less than half the CPU time as pulseaudio's null-sink module, that's why I prefer it. To use the pulseaudio module instead, run: pactl load-module module-null-sink
  3. Open pavucontrol (GUI application).
  4. Navigate to Input device and select All Input Devices from the dropdown at the bottom.
  5. Navigate to the recording tab and find your recording App. (e.g. Discord) there, set its audio input to Monitor of Built-in Analog Stereo. pulseaudio

  6. Go to the Playback tab, now play whatever song/sound you want played on discord.

  7. Select Built-in Audio Analog Stereo as the audio output of the desired application. More like Audio Proxy How-To :)

That's it. You can make it as loud as you want now, the audio will directly and only go to discord.

If you want to listen in live (at any volume) while it's playing look at the answer to my question here.

confetti

Posted 2018-08-16T12:19:53.153

Reputation: 1 625

Windows solution: https://www.vb-audio.com/Cable/index.htm There also is samples in Windows WDK how to make virtual audio device: https://code.msdn.microsoft.com/windowshardware/windows-driver-kit-wdk-80-e3161626

– Alex – 2018-08-16T12:33:06.280

Do you mind leaving a full answer? – confetti – 2018-08-16T13:10:11.937

Done. Organized it as the answer – Alex – 2018-08-16T13:54:52.087

2

Windows solutions:

1. Donationware program: VB-CABLE Virtual Audio Device.

VB-CABLE is a virtual audio device working as virtual audio cable. All signals coming in the CABLE input is going to the CABLE output. Then It becomes simple to make computer audio recording or to connect a player application to a recorder one.

enter image description here


2. DIY solution:
For those who'd like to create own solution, one can use examples from WDK that available for
download here

Alex

Posted 2018-08-16T12:19:53.153

Reputation: 5 606

1

On Mac you may try Soundflower, this is open source, and it creates supplementary audio inputs and outputs: - Sounflower (2ch) - Soundflower (64ch) and within your apps pref pane you can chose which one to use. Look to https://github.com/mattingalls/Soundflower

Hope that helps

Lorenzolamasse

Posted 2018-08-16T12:19:53.153

Reputation: 21

0

And for the Mac side try Audio Hijack from Rogue Amoeba.

It alloys you to take the output from any application and route it to the input of any other program. It is not freeware but you can download and ue it to record up to 10 minutes of sound before it overlays some noise on the file. Cost is $60.

I am not aware of any open source software that does this on a Mac.

Steve Chambers

Posted 2018-08-16T12:19:53.153

Reputation: 274

From a quick look at that page, it seems like what my question is looking for would be https://www.rogueamoeba.com/loopback/ from the same author, as Audio Hijack seems to lack the possibility of routing the audio back to the input of another application.

– confetti – 2018-08-20T00:22:04.533