使用 PulseAudio 同时从同一源的两个端口进行录音

使用 PulseAudio 同时从同一源的两个端口进行录音

经过大量搜索却没有找到任何有用的信息后,我来到这里向比我更聪明的人寻求帮助。

我需要同时录制 2 个音频源。一个来自计算机背面的 Line In,另一个来自前面的麦克风。这样做的原因是,一个是扬声器的声音输出,另一个来自翻译服务。但是,根据命令,这两个设备使用相同的“源” pactl list。以下是输出:

 Source #2
 State: IDLE
 Name: alsa_input.pci-0000_00_1b.0.analog-stereo
 Description: Built-in Audio Analog Stereo
 Driver: module-alsa-card.c
 Sample Specification: s16le 2ch 44100Hz
 Channel Map: front-left,front-right
 Owner Module: 5
 Mute: no
 Volume: 0:  56% 1:  56%
         0: -15,30 dB 1: -15,30 dB
         balance 0,00
 Base Volume:   9%
              -63,00 dB
 Monitor of Sink: n/a
 Latency: 70035 usec, configured 371519 usec
 Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
 Properties:
  alsa.resolution_bits = "16"
  device.api = "alsa"
  device.class = "sound"
  alsa.class = "generic"
  alsa.subclass = "generic-mix"
  alsa.name = "ALC662 rev1 Analog"
  alsa.id = "ALC662 rev1 Analog"
  alsa.subdevice = "0"
  alsa.subdevice_name = "subdevice #0"
  alsa.device = "0"
  alsa.card = "0"
  alsa.card_name = "HDA Intel PCH"
  alsa.long_card_name = "HDA Intel PCH at 0xfe420000 irq 47"
  alsa.driver_name = "snd_hda_intel"
  device.bus_path = "pci-0000:00:1b.0"
sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
  device.bus = "pci"
  device.vendor.id = "8086"
  device.vendor.name = "Intel Corporation"
  device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"
  device.form_factor = "internal"
  device.string = "front:0"
  device.buffering.buffer_size = "65536"
  device.buffering.fragment_size = "32768"
  device.access_mode = "mmap+timer"
  device.profile.name = "analog-stereo"
  device.profile.description = "Analog Stereo"
  device.description = "Built-in Audio Analog Stereo"
  alsa.mixer_name = "Intel CougarPoint HDMI"
  alsa.components = "HDA:10ec0662,103c1497,00100101 HDA:80862805,80861497,00100000"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-card-pci"
 Ports:
  analog-input-microphone: Microphone (priority: 8700, available)
  analog-input-linein: Line In (priority: 8100, available)
 Active Port: analog-input-microphone
 Formats:
        pcm

在录音软件(名为 Galicaster)中,你可以创建包含需要捕获的源位置的配置文件,如下所示:

[track3]
amplification = 1
name = Line In
vumeter = True
location = alsa_input.pci-0000_00_1b.0.analog-stereo
file = sound.mp3
device = pulse
path = /home/capture/Repository/attach
flavor = presenter
active = True

基本上,我需要知道如何指定每个轨道需要使用的端口,例如:

track3 需要使用analog-input-microphoneSource2 的端口,track4(第二条音轨)需要使用analog-input-linein

有人知道我该如何指定吗?我尝试使用简单的附加功能,例如location = alsa_input.pci-0000_00_1b.0.analog-stereo.analog-input-microphonelocation = alsa_input.pci-0000_00_1b.0.analog-stereo:analog-input-microphone,但没有任何效果。录音软件启动时出现错误。

有没有办法实现这一点?如果有,怎么做?

相关内容