One way to record a program's Audio output


One way to record a program's Audio output


Table of Contents

  • 1 PulseAudio Audio Server Introduction
  • 2 Record a program's Audio output.

1 PulseAudio Audio Server Introduction

Linux Audio System can be divided into 3 layers.
  • Alsa/Oss package provide a bottom layer to driver sound card.
  • PulseAudio/Jack/ESD package provide middle ware layer named Audio Server.
  • Multimedia applications written by the API provided by Audio Server.
PulseAudio is focused on desktop and mobile audio needs. It doesn't try to address low latency, but does provide seamless device switching, network routing, global per-application volume control and lots great stuff.

2 Record a program's Audio output.

Following is the step by step tutorial to record an Audio output.
  1. Load a null-sink
    
    
    pactl load-module module-null-sink sink_name=steam
    
    
    
  2. Load combine-sink module-combine-sink is used to combine slaves sinks to build virtual sinks.
    
    
    # First use "pactl list sinks" to list the sinks which you want to merge.
    # add the sink's name slaves, separated by commas
    pactl load-module module-combine-sink slaves="alsa_output.pci-0000_00_1b.0.analog-stereo,steam"
    
    
    
  3. redirect the sink-input, which you want to record, to combine sink.
    
    
    # 19 is sink-input number get from cmd "pactl list sink-inputs"
    # combined is sink name get by "pactl list sinks"
    pactl move-sink-input 19 combined
    
    
  4. record the null source
    
    
    parec -d steam.monitor | oggenc -b 192 -o steam.ogg --raw -
    

Comments

Popular posts from this blog

Bluedroid stack in android

How to setup a NAT server?

Network programming in elisp