提取当前播放的声音输出通道为 mp3

提取当前播放的声音输出通道为 mp3

它必须与声源无关(youtube、在线广播、skype 电话等)。“我的扬声器”发出的所有内容都必须以任何质量不错的声音格式保存。

我怎样才能做到这一点?

PS 这是Ubuntu系统。

答案1

不确定 Ubuntu,在 Windows 上你应该在录音音频设置中选择输入混音通道而不是微型打印机。

应该是相同的方法,希望有帮助

答案2

我遇到了一个非常简单的解决方案:

wget http://outflux.net/software/pa-clone
chmod u+x pa-clone
./pa-clone output.wav

看起来像

#!/bin/bash
# Copyright 2008-2009, Kees Cook <[email protected]>
#
# Records the PulseAudio monitor channel.
# http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/
#
WAV="$1"
if [ -z "$WAV" ]; then
    echo "Usage: $0 OUTPUT.WAV" >&2
    exit 1
fi
rm -f "$WAV"

# Get sink monitor:
MONITOR=$(pactl list | grep -A2 '^Source #' | \
    grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1)

# Record it raw, and convert to a wav
echo "Recording to $WAV ..."
echo "Ctrl-C or Close this window to stop"
parec -d "$MONITOR" | sox -t raw -r 44100 -sLb 16 -c 2 - "$WAV"

里面。

相关内容