Redirect Audio Out to Mic In (Linux)

Noah Petherbridge
kirsle
Posted by Noah Petherbridge on Wednesday, February 03 2010 @ 07:49:42 PM
I discovered a neat trick you can do with PulseAudio: redirect the audio output of your computer to the microphone input, so that any application that supports recording from a mic will get your audio output instead.

I needed to do this because I was testing something at work that involved an Asterisk server calling a softphone running on my Linux box, and it wanted me to record a voice prompt and then hang up. This computer didn't have a microphone installed, so I started looking for a way to fake the mic input and make it record an MP3 or something instead.

If your system is using PulseAudio (every recent Fedora and Ubuntu distribution does), the steps to follow are:

1) Open PulseAudio Volume Control

This is pavucontrol on the command line, and in Fedora is provided by the package pavucontrol.

Go to the "Input Devices" tab, and select "Show: Monitors" from the bottom of the window. If your computer is currently playing audio, you should see a bar showing the volume of the output:

Input Devices
The "Input Devices" tab showing monitors.

2) Start running an app that is recording audio, and go to the "Recording" tab and see if your app is listed.

In this screenshot I'm running Audacity and recording audio.

3) Click the input device button ("ALSA Capture from") and pick "Monitor of Internal Audio Analog Stereo")

Recording
The "Input Devices" tab showing monitors.

And that's pretty much it. If you see volume bars on the Recording tab now then it's probably working, and the recording app is now recording your audio output.

Here's a full desktop screenshot of me running `play audiodump.wav` (a WMA-to-WAV conversion of the Windows XP Welcome Music) in a terminal, the PulseAudio Volume Control running, and Audacity recording from the mic.

Audio Out to Mic In
Click for bigger screenshot.

Categories:

[ Blog ]

Comments

There are 12 comments on this page.

guest
guest
Posted on Wednesday, May 12 2010 @ 12:09:26 PM by John.

Thanks,

I found this useful.

guest
guest
Posted on Wednesday, December 22 2010 @ 04:01:55 PM by danyle.

yeah, really helped especially with google voice and espeak, thanks.

guest
guest
Posted on Tuesday, December 28 2010 @ 10:30:26 PM by gtech.

Wow this is great, works perfectly.

guest
guest
Posted on Saturday, July 30 2011 @ 10:20:33 AM by westen.

hi, can you please tell me how i can get my mic input to be heard over my speakers. massively appreciated

guest
guest
Posted on Tuesday, April 10 2012 @ 08:26:49 AM by dog.

Im using this for my honours thesis. Thanks! saved me some effort emulating recording process in the software im writing :)

guest
guest
Posted on Saturday, May 26 2012 @ 04:56:26 AM by srikrishna.

thanks this post is help full.
but this is only redirecting speaker to mic. original mic in is missing. i want both audio out and mic out to mic in is there any solution

guest
guest
Posted on Sunday, December 02 2012 @ 08:45:25 PM by simon.

Fantastic, thanks, I've been trying to work out how to do this for a long time.

guest
guest
Posted on Saturday, January 19 2013 @ 03:50:59 PM by avmfree.

Thanks. Very useful.

guest
guest
Posted on Friday, December 06 2013 @ 12:38:33 PM by cata.

thanks man! I knew about PulseAudio, but didn't know it can redirect sound. Much appreciate!

Avatar
guest
Posted on Tuesday, December 09 2014 @ 06:17:03 PM by george.

How to do the exact oposite?

Im participating in some video conferences and im making some kind of echo because of this.

But i cant find a way to do the oposite,

Thanks!

guest
guest
Posted on Tuesday, January 27 2015 @ 05:01:25 PM by Jerry.

I was banging my head on this problem for the past month! Thanks so much!

Avatar
guest
Posted on Wednesday, February 11 2015 @ 05:57:02 PM by _nix.

5 years ago and still helping. thank you! got the job done.

Add a Comment

Your name:
Your Email:
Message:
Comments can be formatted with Markdown, and you can use
emoticons in your comment.

If you can see this, don't touch the following fields.



Kirsle
Channels
Creativity
Software
Web Tools
Subdomains
Miscellany
Links


Fan Club