首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gstreamer中的声学回声消除

gstreamer中的声学回声消除
EN

Stack Overflow用户
提问于 2014-05-22 22:57:59
回答 2查看 2.8K关注 0票数 1

我正在使用gstreamer开发Voip应用程序,我使用gstreamer中的rtp示例创建了应用程序,我将客户端和服务器放在相同的代码中,每个应用程序都在一个进程中,我让它工作,但问题出在回声上,所以我试图实现speex aec,但问题是我只有麦克风的输入,但我无法从扬声器获得输出。

发送语音的部分是

代码语言:javascript
复制
 pipeline = gst_pipeline_new (NULL);
  g_assert (pipeline);

  /* the audio capture and format conversion */
  audiosrc = gst_element_factory_make (AUDIO_SRC, "audiosrc");
  g_assert (audiosrc);
  audioconv = gst_element_factory_make ("audioconvert", "audioconv");
  g_assert (audioconv);
  audiores = gst_element_factory_make ("audioresample", "audiores");
  g_assert (audiores);
  /* the encoding and payloading */
  audioenc = gst_element_factory_make (AUDIO_ENC, "audioenc");
  g_assert (audioenc);
  audiopay = gst_element_factory_make (AUDIO_PAY, "audiopay");
  g_assert (audiopay);

  /* add capture and payloading to the pipeline and link */
  gst_bin_add_many (GST_BIN (pipeline), audiosrc, audioconv, audiores,
      audioenc, audiopay, NULL);

  if (!gst_element_link_many (audiosrc, audioconv, audiores, audioenc,
          audiopay, NULL)) {
    g_error ("Failed to link audiosrc, audioconv, audioresample, "
        "audio encoder and audio payloader");
  }

以及接收声音的部分

代码语言:javascript
复制
    gst_bin_add_many (GST_BIN (pipeline), rtpsrc, rtcpsrc, rtcpsink, NULL);

  /* the depayloading and decoding */
  audiodepay = gst_element_factory_make (AUDIO_DEPAY, "audiodepay");
  g_assert (audiodepay);
  audiodec = gst_element_factory_make (AUDIO_DEC, "audiodec");
  g_assert (audiodec);
  /* the audio playback and format conversion */
  audioconv = gst_element_factory_make ("audioconvert", "audioconv");
  g_assert (audioconv);
  audiores = gst_element_factory_make ("audioresample", "audiores");
  g_assert (audiores);
  audiosink = gst_element_factory_make (AUDIO_SINK, "audiosink");
  g_assert (audiosink);

  /* add depayloading and playback to the pipeline and link */
  gst_bin_add_many (GST_BIN (pipeline), audiodepay, audiodec, audioconv,
      audiores, audiosink, NULL);

  res = gst_element_link_many (audiodepay, audiodec, audioconv, audiores,
      audiosink, NULL);
  g_assert (res == TRUE);

我怎样才能使用AEC呢?谢谢

EN

回答 2

Stack Overflow用户

发布于 2016-09-22 09:19:17

现在上游GStreamer中包含了一个回声抵消器。它将随GStreamer 1.10一起发布。它使用了WebRTC项目的数字信号处理器模块,这比speex要好得多。我会推荐使用它。在echo循环上的简单用法:

代码语言:javascript
复制
gst-launch-1.0 autoaudiosrc ! webrtcdsp ! webrtcechoprobe ! autoaudiosink

有关更多详细信息,请参阅http://ndufresne.ca/2016/06/gstreamer-echo-canceller/

票数 2
EN

Stack Overflow用户

发布于 2014-05-23 22:13:42

您不需要“扬声器的输出”,您需要的是发送到扬声器的音频。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23810421

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档