Well, for simplify my work.<div><br></div><div>I&#39;m using gst_parse_launch to create the pipeline:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>gchar str[200];</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>sprintf(str, &quot;filesrc location=./media/%s&quot; <span class="Apple-tab-span" style="white-space:pre">        </span>\</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                </span> &quot;! audio/x-alaw, channels=1, rate=8000&quot;<span class="Apple-tab-span" style="white-space:pre">        </span>\</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span> &quot;! alawdec ! autoaudiosink&quot;, cmd-&gt;filename);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                                        </span> </div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>GError* err = NULL;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>pipeline = gst_parse_launch(str, &amp;err);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>g_assert(pipeline != NULL);</div><div><br></div><div><div>     <span class="Apple-tab-span" style="white-space:pre">        </span>                // Play</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>                g_print(&quot;Playing.&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>                gst_element_set_state (pipeline, GST_STATE_PLAYING);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>                g_loop = g_main_loop_new (NULL, FALSE);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>                g_main_loop_run (g_loop);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>                gst_element_set_state (pipeline, GST_STATE_NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>                g_print(&quot;Stopped\n&quot;);</div>
<div><br></div></div><div>But no sound output,  I tried at command-line, it works.  What&#39;s the problem?</div><div><br></div><div>Thanks</div><div><br></div><div><br></div></div><div><br><br><div class="gmail_quote">2009/11/4 Freeman Zhang <span dir="ltr">&lt;<a href="mailto:pcman.zhang@gmail.com">pcman.zhang@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Get it.<div><br></div><div>Thank you very much.<br><br><div class="gmail_quote">2009/11/4 Tim-Philipp Müller <span dir="ltr">&lt;<a href="mailto:t.i.m@zen.co.uk" target="_blank">t.i.m@zen.co.uk</a>&gt;</span><div>
<div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Wed, 2009-11-04 at 18:02 +0800, Freeman Zhang wrote:<br>
<br>
&gt; decoder = gst_element_factory_make(&quot;alawdec&quot;, &quot;decoder&quot;);<br>
&gt; res = gst_element_link_filtered (filesrc, decoder, caps);<br>
&gt; g_assert(res == TRUE);<br>
&gt;<br>
&gt; But it return:<br>
&gt;                          gst_element_link_pads_filtered: assertion<br>
&gt; `GST_IS_BIN (parent)&#39; failed<br>
<br>
</div>You need to add elements to a pipeline/bin before linking them.<br>
<br>
Cheers<br>
<font color="#888888"> -Tim<br>
</font><div><div></div><div><br>
<br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what&#39;s new with<br>
Crystal Reports now.  <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br></div>