我不知道如何實現雜波,但如果它使用脈衝鏈接,你可以打補丁發射應用程序標籤,你可以作出反應。
即去gst_pulsesink_set_mute實現,添加有:
GstStructure *str = gst_structure_new("custom_muted",
"muted", G_TYPE_BOOLEAN, mute, NULL);
GstMessage *msg = gst_message_new_application(GST_OBJECT(psink), str);
if (!gst_element_post_message(psink, msg)) {
fail..
}
然後在你的公共汽車看你的GST_MESSAGE_APPLICATION反應,並抓住它:
if (gst_message_has_name(p_msg, "custom_muted")) {
gboolean muted;
const GstStructure *str = gst_message_get_structure(p_msg);
gst_structure_get_boolean(str, "muted", &muted);
if (muted)
do_my_fancy_pause();
}
[ClutterGstPlayback(https://開頭開發商。 gnome.org/clutter-gst/stable/ClutterGstPlayback.html)內部使用playbin播放音頻。 [Playbin](https://developer.gnome.org/gst-plugins-libs/stable/gst-plugins-base-plugins-playbin.html#GstPlayBin--uri)使用autoaudiosink。所以我們不能總是假設它會使用脈衝鏈。 –
@AkashJain以及您可以指定[音頻接收器(https://developer.gnome.org/gst-plugins-libs/stable/gst-plugins-base-plugins-playbin.html#GstPlayBin--audio-sink)成爲pulseaudio .. – nayana