将虚拟接收器音频重定向到耳机

将虚拟接收器音频重定向到耳机

我通过这个命令创建了空接收器

pactl load-module module-null-sink sink_name=vspeaker sink_properties=device.description=virtual_speaker

例如,当我打开 discord 时,我可以选择 discord 作为输出设备虚拟扬声器但我无法以某种方式将其重定向到我的实际耳机(而非虚拟接收器)。

OBS Studio 提供了监控虚拟接收器并将其输出重定向到我的耳机的功能,但它有几秒钟的延迟,不适合我的需要。

我尝试做这样的事

pactl load-module module-null-sink sink_name=vspeaker sink_properties=device.description=virtual_speaker

但随后我在应用程序中看不到任何新的输出设备,也听不到虚拟接收器的声音。它只是选择了我的耳机。我尝试运行它,$ PULSE_SINK=virtual_sink APP_NAME但没有任何效果。

有没有办法监控或重定向虚拟接收器音频到实际耳机而没有太大的延迟?(类似适用于 Windows 的 Voicemeeter)

答案1

您已经非常接近需要运行两个命令了:

  1. 创建你的空接收器。
pactl load-module module-null-sink sink_name=Redirected_Audio sink_properties=device.description=Redirected_Audio
  1. 将新的空接收器“Redirected_Audio”重定向到您的耳机中。
pactl load-module module-loopback source=Redirected_Audio.monitor sink=name_of_headphones

.monitor请注意,我的空接收器名称后面有Redirected_Audio,这是必需的。如果您更改接收器的名称,请务必.monitor在此命令中包含。

但是你的耳机叫什么名字?

运行pactl list sinks并找到您的扬声器,该属性只是调用Name它可能很长但完全取决于型号,例如我的耳机显示为:

Sink #1
    State: RUNNING
    Name: alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo
    Description: PCM2902 Audio Codec Analogue Stereo
    Driver: module-alsa-card.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 23
    Mute: no
    Volume: front-left: 11796 /  18% / -44.68 dB,   front-right: 11796 /  18% / -44.68 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor Source: alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo.monitor
    Latency: 22938 usec, configured 26000 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 = "USB Audio"
        alsa.id = "USB Audio"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "1"
        alsa.card_name = "USB Audio CODEC"
        alsa.long_card_name = "Burr-Brown from TI USB Audio CODEC at usb-0000:2a:00.1-5, full speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:2a:00.1-usb-0:5:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:01.2/0000:20:00.0/0000:21:08.0/0000:2a:00.1/usb1/1-5/1-5:1.0/sound/card1"
        udev.id = "usb-Burr-Brown_from_TI_USB_Audio_CODEC-00"
        device.bus = "usb"
        device.vendor.id = "08bb"
        device.vendor.name = "Texas Instruments"
        device.product.id = "2902"
        device.product.name = "PCM2902 Audio Codec"
        device.serial = "Burr-Brown_from_TI_USB_Audio_CODEC"
        device.string = "front:1"
        device.buffering.buffer_size = "352800"
        device.buffering.fragment_size = "176400"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analogue Stereo"
        device.description = "PCM2902 Audio Codec Analogue Stereo"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    Ports:
        analog-output: Analogue Output (priority: 9900)
    Active Port: analog-output
    Formats:
        pcm

名字是alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo

相关内容