在文件描述符上连续运行aubiopitch

编程入门 行业动态 更新时间:2024-10-27 23:24:20
本文介绍了在文件描述符上连续运行aubiopitch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用aubiopitch连续输出来自输入源的信号的频率.由于aubiopitch喜欢将其输入作为文件而不是流,因此我尝试使用流程替换:

I'd like to use aubiopitch to continuously output the frequency of a signal coming from an input source. Since aubiopitch likes to have its input be a file, not a stream, I tried using process substitution:

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

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

I'd expect this to output the frequency of the signal being read off of my default audio input device. Instead, I got this:

./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,因为此命令可以正常工作:

The problem doesn't seem to lie with sox, since this command works fine:

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

它会创建一个output.wav文件,似乎没有问题,但aubiopitch除外:

It creates an output.wav file that nothing seems to have trouble playing, except aubiopitch of course:

$ aubiopitch output.wav Segmentation fault: 11

这是怎么回事? RIFF标头设置的长度错误吗?

What's going on here? Is the issue with the RIFF header having the wrong length set?

如果有问题,我正在运行OSX 10.7.5,并且我重新编译了aubio以使其与我的旧OSX版本一起使用.

If it matters, I'm running OSX 10.7.5 and I recompiled aubio to work with my older OSX version.

推荐答案

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

使用libsndfile支持'-' = stdin进行编译时,因此上述命令可以提供以下输出.

When compiled with libsndfile support, '-' = stdin, so the above command could give the following output.

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 [...]

如果使用更多源(avcodec或apple_audio)编译了aubio,则会收到更多警告.您可以通过将stderr重定向到/dev/null来隐藏这些警告.这是aubioonset的示例:

If you compiled aubio with more sources (avcodec or apple_audio), you will get more warnings. You can hide these warnings by redirecting stderr to /dev/null. Here is an example with aubioonset:

$ ( sox -q -d -t wav - | aubioonset -i - ) 2> /dev/null 0.000000 0.096871 0.279297 [...]

更多推荐

在文件描述符上连续运行aubiopitch

本文发布于:2023-11-23 11:21:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621269.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   aubiopitch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!