Question: This is my `$Version`

> 
> `"11.1.1 for Microsoft Windows (64-bit) (May 16, 2017)"`
> 
> 
> 

We have two methods to record sounds in *Mathematica* if we are in *11.1*.

* `SystemDialogInput["RecordSound"]`
* `AudioCapture[]`

But this two methods both cannot exclude those sounds in surroundings if you are recording from the microphone. I just want to record the system sounds output from the computer and not from a microphone. 

**So can we tell Mathematica to capture the system sound output without recording the microphone input?**

Currently available devices are:

```
 $AudioOutputDevices

```

> 
> [![enter image description here](https://i.stack.imgur.com/XCQDc.png)](https://i.stack.imgur.com/XCQDc.png)
> 
> 
>

Answer: 
Windows
-------

Idea copied from [here](https://www.howtogeek.com/217348/how-to-record-the-sound-coming-from-your-pc-even-without-stereo-mix/).  

---

On the volume tray icon, right click and select "Recording Devices"

![Mathematica graphics](https://i.stack.imgur.com/p49TL.png)

![Mathematica graphics](https://i.stack.imgur.com/VSvWV.png)

Be sure that disabled devices are listed. Tick *"Show Disabled Devices"*

![Mathematica graphics](https://i.stack.imgur.com/tmb5J.png)

You may have a device called *"Stereo Mix"* , *"What U Hear"* or *"Rec. Playback"*.
Enable the device if it is disabled. Now check that is listed in [`$AudioInputDevices`](http://reference.wolfram.com/language/ref/$AudioInputDevices.html), and notice the position of the device in the list.

```
TableForm[$AudioInputDevices, TableHeadings -> Automatic]

```

> 
> ![Mathematica graphics](https://i.stack.imgur.com/AK7ep.png)
> 
> 
> 

Now you can specify the device using [`AudioInputDevice`](http://reference.wolfram.com/language/ref/AudioInputDevice.html)

```
AudioCapture[
 "test.ogg"
 , AudioInputDevice -> $AudioInputDevices[[2]] 
 , Appearance -> "Detailed"
 , SampleRate -> Automatic
 ]

```

> 
> ![Mathematica graphics](https://i.stack.imgur.com/Ab92l.png)
> 
> 
>
**Mac OS**

1. Install SoX (the Swiss Army knife of sound processing programs.)

> 
> brew install sox 
> 
> 
>
2. Install Loopback (Route audio between applications on your Mac.)

<https://rogueamoeba.com/loopback/>
3. Create a virtual audio input device which routes the audio from Safari as input.(Don't forget to tick the checkbox to activate it)
[![enter image description here](https://i.stack.imgur.com/JoI8z.png)](https://i.stack.imgur.com/JoI8z.png)
4. Select the virtual audio input device as the default audio input device.
[![enter image description here](https://i.stack.imgur.com/pM8gd.png)](https://i.stack.imgur.com/pM8gd.png)
5. Record and play

In:

RunProcess[{"open", "<https://www.youtube.com/watch?v=L0MK7qz13bU>"}];
RunProcess[{"/usr/local/bin/rec", "-c", "2", "radio.aiff", "trim", 
 "0", "0:10"}]
RunProcess[{"/usr/local/bin/play", "radio.aiff"}]

Out:

[![enter image description here](https://i.stack.imgur.com/QmXgE.png)](https://i.stack.imgur.com/QmXgE.png)