Audio

錄音 - 同時錄製兩個音源,合併成一個 2 軌錄音

  • September 28, 2013

如何同時錄製兩個音頻源並創建一個文件,其中一個源是左聲道,另一個源是無損立體聲音頻錄製的右聲道?

我的發行版是 Kubuntu 12.04 LTS。

我的音頻源硬體列在底部。具體來說,我認為我想同時記錄的兩個來源是:

  1. alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor/#2:Scarlett 2i2 USB 模擬立體聲顯示器
  2. alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#3:Scarlett 2i2 USB 模擬立體聲

僅供參考,這個問題可能是相關的(但我不明白那裡顯示的命令):how to merge two audio input source using avconv

編輯:這絕對看起來很相關,但我很難理解它:http ://ubuntuforums.org/showthread.php?t=1962947

我對如何做到這一點的第一個猜測是這個簡單的腳本:

#!/bin/bash
OUTPUT="audio_`date +%Y-%m-%d_%H%M`"
avconv \
-f alsa -ac 2 -i <alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor> \
-f alsa -ac 1 -i <alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo> \
-map 0:0 -map 1:0 \
-acodec flac \
-threads 0 \
-y $OUTPUT

我假設我需要用正確的符號替換尖括號中的內容。我不知道上述腳本的其餘部分是否更接近……

這是我的硬體資訊:

$ pacmd list-cards  
Welcome to PulseAudio! Use "help" for usage information.  
>>> 3 card(s) available.  
[snip other cards]
index: 2
name: <alsa_card.usb-Focusrite_Scarlett_2i2_USB-00-USB>
driver: <module-alsa-card.c>
owner module: 6
properties:
       alsa.card = "1"
       alsa.card_name = "Scarlett 2i2 USB"
       alsa.long_card_name = "Focusrite Scarlett 2i2 USB at usb-0000:04:00.0-2, high speed"
       alsa.driver_name = "snd_usb_audio"
       device.bus_path = "pci-0000:04:00.0-usb-0:2:1.0"
       sysfs.path = "/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/usb3/3-2/3-2:1.0/sound/card1"
       udev.id = "usb-Focusrite_Scarlett_2i2_USB-00-USB"
       device.bus = "usb"
       device.vendor.id = "1235"
       device.vendor.name = "Novation EMS"
       device.product.id = "8006"
       device.product.name = "Scarlett 2i2 USB"
       device.serial = "Focusrite_Scarlett_2i2_USB"
       device.string = "1"
       device.description = "Scarlett 2i2 USB"
       module-udev-detect.discovered = "1"
       device.icon_name = "audio-card-usb"
profiles:
       output:analog-stereo: Analog Stereo Output (priority 6000)
       output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060)
       output:analog-stereo+input:iec958-stereo: Analog Stereo Output + Digital Stereo (IEC958) Input (priority 6055)
       output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500)
       output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5560)
       output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (priority 5555)
       input:analog-stereo: Analog Stereo Input (priority 60)
       input:iec958-stereo: Digital Stereo (IEC958) Input (priority 55)
       off: Off (priority 0)
active profile: <output:analog-stereo+input:analog-stereo>
sinks:
       alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#1: Scarlett 2i2 USB Analog Stereo
sources:
       alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor/#2: Monitor of Scarlett 2i2 USB Analog Stereo
       alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#3: Scarlett 2i2 USB Analog Stereo
ports:
       analog-output: Analog Output (priority 9900, available: unknown)
               properties:

       analog-input: Analog Input (priority 10000, available: unknown)
               properties:

       iec958-stereo-input: iec958-stereo-input (priority 0, available: unknown)
               properties:

       iec958-stereo-output: Digital Output (S/PDIF) (priority 0, available: unknown)
               properties:

lsusb -v 將 Focusrite_Scarlett_2i2 顯示為:

Bus 003 Device 002: ID 1235:8006 Novation EMS 
 idVendor           0x1235 Novation EMS
 idProduct          0x8006 

以下是有關此硬體的更多資訊:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
[snip]
card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

$ arecord -l
**** List of CAPTURE Hardware Devices ****
[snip]
card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

我的解決方案是使用 JACK 音頻連接套件(http://jackaudio.org/)。我最終安裝了 KX Studio 發行版(基於 Debian/Ubuntu),為了簡單起見,我刪除了 PulseAudio。

如何同時錄製兩個音頻源並創建一個文件,其中一個源是左聲道,另一個源是無損立體聲音頻錄製的右聲道?

JACK 允許我這樣做。我也在使用 Ardor 軟體 (DAW)。

引用自:https://unix.stackexchange.com/questions/88067