我正在使用gstreamer开发Voip应用程序,我使用gstreamer中的rtp示例创建了应用程序,我将客户端和服务器放在相同的代码中,每个应用程序都在一个进程中,我让它工作,但问题出在回声上,所以我试图实现speex aec,但问题是我只有麦克风的输入,但我无法从扬声器获得输出。
发送语音的部分是
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");
}以及接收声音的部分
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呢?谢谢
发布于 2016-09-22 09:19:17
现在上游GStreamer中包含了一个回声抵消器。它将随GStreamer 1.10一起发布。它使用了WebRTC项目的数字信号处理器模块,这比speex要好得多。我会推荐使用它。在echo循环上的简单用法:
gst-launch-1.0 autoaudiosrc ! webrtcdsp ! webrtcechoprobe ! autoaudiosink有关更多详细信息,请参阅http://ndufresne.ca/2016/06/gstreamer-echo-canceller/。
发布于 2014-05-23 22:13:42
您不需要“扬声器的输出”,您需要的是发送到扬声器的音频。
https://stackoverflow.com/questions/23810421
复制相似问题