0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PulseAudioを使ったアプリケーション間ループバック用の仮想オーディオデバイスの作成

Last updated at Posted at 2023-05-12

Zoomの会話をChromeに渡して文字起こししたかったので色々調べて仮想オーディオ構築したメモ。
入出力ともにシステムオーディオとループバックして汎用性を持たせてます。
dont_moveオプションあたりの情報がなかなか見つからなくて苦戦しました。

~/.config/pulse/default.pa.src
.include /etc/pulse/default.pa

# Create virtual.line
load-module module-null-sink \
  sink_name=virtual.line \
  sink_properties=device.description="virtual.line.input"

# Create virtual.line.source
load-module module-remap-source \
  master=virtual.line.monitor \
  source_name=virtual.line.source \
  source_properties=device.description="virtual.line.output"

# Create virtual.mixmic
load-module module-null-sink \
  sink_name=virtual.mixmic \
  sink_properties=device.description="virtual.mixmic.input"

# Create virtual.mixmic.source
load-module module-remap-source \
  master=virtual.mixmic.monitor \
  source_name=virtual.mixmic.source \
  source_properties=device.description="virtual.mixmic.output"

# Loopback virtual.line -> virtual.mixmic
load-module module-loopback \
  sink=virtual.mixmic sink_dont_move=true \
  source=virtual.line.monitor source_dont_move=true

# Loopback Default Input -> virtual.mixmic
load-module module-loopback \
  sink=virtual.mixmic sink_dont_move=true

# Loopback virtual.line -> Default Output
load-module module-loopback \
  source=virtual.line.monitor source_dont_move=true

上記のdefault.pa.srcには可読性のため改行を加えています。
有効なPulseAudio Configファイルとするためには次のように置換する必要があります。

sed -ze 's/\\\n//g' default.pa.src > default.pa
~/.config/pulse/default.pa
.include /etc/pulse/default.pa

# Create virtual.line
load-module module-null-sink sink_name=virtual.line sink_properties=device.description="virtual.line.input"

# Create virtual.line.source
load-module module-remap-source master=virtual.line.monitor source_name=virtual.line.source source_properties=device.description="virtual.line.output"

# Create virtual.mixmic
load-module module-null-sink sink_name=virtual.mixmic sink_properties=device.description="virtual.mixmic.input"

# Create virtual.mixmic.source
load-module module-remap-source master=virtual.mixmic.monitor source_name=virtual.mixmic.source source_properties=device.description="virtual.mixmic.output"

# Loopback virtual.line -> virtual.mixmic
load-module module-loopback sink=virtual.mixmic sink_dont_move=true source=virtual.line.monitor source_dont_move=true

# Loopback Default Input -> virtual.mixmic
load-module module-loopback sink=virtual.mixmic sink_dont_move=true

# Loopback virtual.line -> Default Output
load-module module-loopback source=virtual.line.monitor source_dont_move=true
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?