[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to record sound to mp3 [wav, for those who can]



David Wright writes:

On Thu 25 Mar 2021 at 17:40:51 (+0100), Nicolas George wrote:
> David Wright (12021-03-25):

[...]

> > To record, you could type, for example, in another xterm:
> >
> > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
>
> This command does not record the sound being played.

… on your machine. That's why I wrote "If you can't get ALSA to work…".
You're a candidate for pulseaudio, I assume.

Not sure about that command above (no means to try it just now), but _with_ PulseAudio, I can record the sound that is being played back just fine by means of "monitor" audio devices. E.g. I have the following command to record my screen (`0:v`), the "monitor" device (`1:a`) and a microphone (`2:a`):

exec ffmpeg -video_size 1600x1200 -framerate 12 -f x11grab -i :0.0+0,0 -f pulse -ac 2 -i 0 -f pulse -i 1 -c:v libvpx-vp9 -deadline realtime -b:v 2M -c:a libvorbis -map 0:v -map 1:a -map 2:a "recording.webm"

adapted from these two sources:

-> https://trac.ffmpeg.org/wiki/Capture/Desktop
-> https://askubuntu.com/questions/682144/capturing-only-desktop-audio-with-ffmpeg

It may of course be true that the hardware _does_ support/accellerate this monitoring capability, but it does not seem to be entirely uncommon a feature? Here, it even works inside virtual machines :)

Btw. the existence of monitor devices can be checked in `pavucontrol` where under "Output" it lists two monitor devices here: One for the HDMI output and one for the "Built-in Analog Stereo" Output.

AFAICT, this recording facility is getting harder to find on most
computers, if you're not prepared to fork out for a sound card.
I've been fortunate, in that just as my ancient Pentium III expired,
I have acquired a Dell Precision T3500 which has a well endowed
(integrated) sound card.

I'm still finding my way round it: for example, it also has HDMI
playback, but I haven't yet worked out how to exploit it. The machine
has one DVI output and two DisplayPorts, so I need to find a
DisplayPort/HDMI adapter to see if that would yield anything.

[...]

As far as I can tell, DisplayPort can transport audio without the need for an HDMI adapter. Here, a Radeon Pro W5500 graphics card is connected to a Dell U2713HM display which has one HDMI, DP, VGA and DVI input each. The W5500 is connected to the DisplayPort and if I play sound to the "HDMI" output, the display outputs that sound through its headphones socket.

Similar to your case, there are no HDMI ports on the graphics card.
In my case, it is only DisplayPorts.

HTH
Linux-Fan

öö

Attachment: pgpQmwypIktrY.pgp
Description: PGP signature


Reply to: