Record system output sound on Linux with Pacat (Pulseaudio)

Source: Internet
Author: User

Record system output sound on Linux with Pacat (Pulseaudio)

When PulseAudio was used as the sound server of the system, there was a simple-a-to-record the output sound to file on the Command line using the Pacat-command. This short article describes how to do it.

In order toFindThe correct device should run this command:pacmd list|grep ". Monitor"When you see something Like:alsa_output.pci-0000_06_05.0. analog-stereo.monitor/#1: Monitor of CA0106 SoundBlaster Analog Stereoand The soundcard corresponds to the one you want to Monitor and you know /c1>whichDevice name to use. Here it is:alsa_output.pci-0000_06_05.0. analog-stereo.monitorafterwards Pacat is used to read the signal and Sox are used to change the output format. See theMansPage of Sox forParameters to choose forCorrect output format. The default output from Pacat are raw audio, rate44100, Signed-integer, Little-endian, --bit and stereo. The Sox reads from standard input by specifying"-"as filename. The format of the outputfileis therefore specified after the"-" inchThe examples under. Here's an example byWriteto afloatFormatted RAW AudiofileWith mono sound at a rate of 40000sps:pacat--record-d alsa_output.pci-0000_06_05.0. analog-stereo.monitor | Sox-t Raw-r44100-s-l-B --C2-T-raw-r40000-f-b +-C1Output.rawthis One is Nice ifYou'll record sounds forUsinginchGnuradio. To record to a wav-fileWith a rate of 44100sps, simply DoLike This:pacat--record-d alsa_output.pci-0000_06_05.0. analog-stereo.monitor | Sox-t Raw-r44100-s-l-B --C2-"Output.wav"

Record system output sound on Linux with Pacat (Pulseaudio)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.