带有VADER元素的gstreamer管道停顿在PAUSE上

带有VADER元素的gstreamer管道停顿在PAUSE上

本文介绍了与tee一起使用时,带有VADER元素的gstreamer管道停顿在PAUSE上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个使用Pocketsphinx的VAD元素的管道:

I have this pipeline that uses pocketsphinx's VAD element :


            Gst.parse_launch(
              "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" " +
              "! vader name=vad auto-threshold=true " +
              "! level name=wavelevel interval=100000000 " + // level interval is in nanoseconds
              "! wavenc " +
              "! filesink location=audioz.wav"
            );

工作正常,但当流媒体中没有声音时,流媒体停止播放来源.

It works fine except that the streaming stops when there is no voice comming in thesource.

我想独立于VAD继续录制,所以我用tee尝试了这个管道:

I want to recording to continue independently of the VAD,so I tried this pipeline with a tee :


            Gst.parse_launch(
              "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" " +
              "! tee name=t " +
              "! queue " +
              "! vader name=vad auto-threshold=true " +
              "! fakesink t. sync=false" +
              "! queue " +
              "! level name=wavelevel interval=100000000 " + // level interval is in nanoseconds
              "! wavenc " +
              "! filesink location=audioz.wav"
            );

这个总是停滞不前,状态从NULL-> READY-> PAUSE,并在PAUSE上永远停滞.

And this one is always stalling, state going from NULL -> READY -> PAUSE,and stalling forever on PAUSE.

独立VAD"的目标只是记录开始和结束时间(由VAD检测到)的语音片段.

The goal of the "independent VAD" is simply to record the begining and end timeof voice segments (detected by the VAD).

注释该行:!fakesink t.sync = false"解决了这个问题,因此以下管道可以满足我的需求:

commenting the line : "! fakesink t. sync=false"solves the problem, so the following pipeline does what I need :


            this.pipeline = Gst.parse_launch(
              "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" " +
              " ! tee name=t" +
              " t. ! queue " +
              " ! vader name=vad auto-threshold=true " +
              " t. ! queue " +
              " ! level name=wavelevel interval=1000000000 " + // level interval is in nanoseconds
              " ! wavenc " +
              " ! filesink location=audioz.wav"
            );

剩下的问题是,没有接收器的队列是否可以...

The remaining question is if it's OK to have a queue without a sink...

推荐答案

最简单的解决方案是在两个接收器上都设置async = 0.(fakesink和filesink)

The easiest solution is to set async=0 on both sinks. (fakesink and filesink)

这篇关于与tee一起使用时,带有VADER元素的gstreamer管道停顿在PAUSE上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 06:12