'arecord records silence instead of audio output

I am trying to record what my device is currently playing using arecord (it is playing audio via mplayer).

I've done everything I have been able to read so far such as checking under which user mplayer is running, setting the user as per the command below, but it only ever records silence.

This is the list of users where my user is ID 1000:

user:x:1000:1000:,,,:/home/user:/bin/bash

This shows that what I am trying to record is running by that user:

user   1217  2.3  1.3 131704 25524 ?        SL   09:11  12:15 /usr/bin/mplayer http://example.com/stream

This is the command I am running:

XDG_RUNTIME_DIR=/run/user/1000 /usr/bin/arecord -d 1 /home/user/rec.waw

The command will output:

Recording WAVE '/home/user/rec.waw' : Unsigned 8 bit, Rate 8000 Hz, Mono

And it writes the file, but the content is silent.

I have tried specifying --device but not sure how to specify it from the list of devices below (I tried --device=CARD=Headphones and --device=hw:CARD=Headphones but I get errors.

This is the output of arecord -L

user@device:~ $arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
default
    Playback/recording through the PulseAudio sound server
output
usbstream:CARD=b1
    bcm2835 HDMI 1
    USB Stream Output
usbstream:CARD=Headphones
    bcm2835 Headphones
    USB Stream Output

Any help would be appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source