3

I’m trying to figure out how to record the system audio from raspbian. I want to record audio from either the OS or a specific program... like recording an audio stream... if it possible? I tried searching but everything is talking about using a USB sound card. Any help is appreciated.

randbasic
  • 33
  • 1
  • 4

1 Answers1

2

I want to record audio from either the OS or a specific program.

You can store all speaker output by this procedure.

  1. Install these packages:

    sudo apt-get install pulseaudio-utils lame
    
  2. Search for your speakers and tap into your speaker's monitor stream:

    pacmd list-sinks | grep -e 'name:' -e 'index' -e 'Speakers'
    

    Find the monitor stream by:

    pacmd list-sources | grep -e 'name:' -e 'index'
    

    enter image description here

  3. Play anything you want to record and run this command with your alsa monitor output:

    parec -d alsa_output.pci-0000_00_1f.3.analog-stereo.monitor | lame -r -V0 - OutputAudio.mp3
    
  4. Hit ctrl+c to stop recording. Play the OutputAudio.mp3.


Source

Mohi Rostami
  • 4,434
  • 1
  • 20
  • 39