<div>HI </div>
<div> </div>
<div>Please help me.</div>
<div>When I link "wavparse" to the "audioconvert" it is failed. but if I use "mad", it will success.</div>
<div> </div>
<div>I have ran it from the command line:</div>
<div>"gst-launch filesrc location=./media/login.wav ! wavparse ! audioconvert ! audioresample ! alawenc ! rtppcmapay" it is ok.</div>
<div> </div>
<div>I don't know why it failed, please help me, how can I can the error details?</div>
<div> </div>
<div>Thanks in advance. </div>
<div> </div>
<div>Freeman </div>
<div> </div>
<div>P.S the source code:</div>
<div> </div>
<div> // Source "filesrc ! wavparse ! audioconvert "<br> GstElement* src = gst_element_factory_make("filesrc", "src");<br> SET(src, "location", cmd->filename);<br> <br> printf("File = %s\n", cmd->filename);<br>
<br> // Parse<br> GstElement* parse = NULL;<br> switch (cmd->filetype)<br> {<br> case EWAVE:<br> printf("Using wav parser\n");<br> parse = gst_element_factory_make("wavparse", "parse");<br>
break;<br> case EMP3:<br> printf("Using mp3 parser\n");<br> parse = gst_element_factory_make("mad", "parse");<br> break;<br> default:<br> break;<br> }<br> <br> // Converter<br>
GstElement* convert = gst_element_factory_make("audioconvert", "con");</div>
<p> // Audio Sample<br> GstElement* sample = gst_element_factory_make("audioresample", "sample");<br> <br> // The Package Format<br> GstElement* encoder = NULL;<br> GstElement* payload = NULL;<br>
<br> switch (cmd->codec)<br> {<br> case EG711:<br> encoder = gst_element_factory_make("alawenc", "encoder");<br> payload = gst_element_factory_make("rtppcmapay", "payload");<br>
break;<br> <br> default:<br> break;<br> }<br> <br> // Link source and converter<br> gst_bin_add_many(GST_BIN (pipeline), src, parse, convert, <br> sample, encoder, payload, NULL);<br> <br> res = gst_element_link_many(src, parse, convert, sample, encoder, payload, NULL);<br>
g_assert(res == TRUE);<br></p>