【发布时间】:2014-05-22 14:57:58
【问题描述】:
我正在使用 gstreamer 开发 Voip 应用程序,我使用 gstreamer 中的 rtp 示例创建了应用程序,我将客户端和服务器放在相同的代码中,并且每个都在一个进程中,我让它工作但问题出在echo,所以我尝试实现 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);
我可以使用 speex AEC 吗? 谢谢
【问题讨论】:
标签: c linux gstreamer voip rtp