1

我想aubiopitch用来连续输出来自输入源的信号频率。因为aubiopitch喜欢让它的输入是一个文件,而不是一个流,所以我尝试使用进程替换

$ aubiopitch -i <(sox -q -d -t wav -)

我希望这能输出从我的默认音频输入设备读取的信号频率。相反,我得到了这个:

./sox WARN wav: Length in output .wav header will be wrong since can't seek to fix it
AUBIO ERROR: source_apple_audio: Failed opening /dev/fd/63, error in ExtAudioFileOpenURL (-40)
AUBIO ERROR: source_wavread: could not find RIFF header in /dev/fd/63
AUBIO ERROR: source: failed creating aubio source with /dev/fd/63 at samplerate 0 with hop_size 256
Error: could not open input file /dev/fd/63

问题似乎不在于sox,因为此命令工作正常:

cat <(sox -q -d -t wav -) > output.wav

它创建了一个output.wav似乎没有什么问题的文件,aubiopitch当然除了:

$ aubiopitch output.wav
Segmentation fault: 11

这里发生了什么?RIFF 标头的长度设置是否错误?

如果重要的话,我正在运行 OSX 10.7.5 并且我重新编译了 aubio 以使用我的旧 OSX 版本。

4

1 回答 1

0
$ sox -q -d -t wav - | aubiopitch -i -

当使用 libsndfile 支持编译时,'-' = stdin上面的命令可以给出以下输出。

sox WARN wav: Length in output .wav header will be wrong since can't seek to fix it
0.000000 0.000000
0.005805 707.323486
0.011610 [...]

如果你用更多的来源(avcodecapple_audio)编译了aubio,你会得到更多的警告。您可以通过重定向stderr到来隐藏这些警告/dev/null。这是一个例子aubioonset

$ ( sox -q -d -t wav - | aubioonset -i - ) 2> /dev/null
0.000000
0.096871
0.279297
[...]
于 2016-05-20T17:27:13.057 回答