4
我試圖通過在SoX中使用脈衝響應進行卷積來應用混響。下面的腳本不正是我想要的:SoX FIR單線程
#!/usr/bin/env bash
#
# Convolve audio file with and impulse response (IR)
#
# Usage:
#
# applyReverb.sh <ir.wav> <audio.wav> <output.wav>
# IR duration (needed for zero-padding to prevent SoX from cutting
# the resulting audio after applying the FIR filter
IR_DUR=`soxi -D $1`
# read IR from wav, resample it if necessary, make sure is mono
# and save it as plain text (.dat format in SoX). Also reduces gain
# to prevent clipping later
sox --norm=-10 -c 1 $1 -r 44100 filter.dat
# extract the coeffients (second column, skipping the first 2 lines)
awk 'NR<3{next}{print $2}' filter.dat > filter.txt
# apply reverb using SoX's fir effect (need front zero-padding to for
# the extra samples due to the convolution
sox "|sox $2 -p pad $IR_DUR 0" --norm $3 fir filter.txt
問題
我怎樣才能做到這一點沒有臨時文件(*過濾器)?我知道答案在於管道內,但我無法讓它工作。
小心解釋爲什麼它downvoted? – jorgeh
對我來說這看起來是一個合理的問題。 – lCapp
@ICapp感謝您的支持和恢復平衡,假設您提高了它;)。無論如何,如果你有興趣,我找到了解決方案(見下面的答案) – jorgeh