<div class="gmail_quote">I suppose you&#39;re finishing your application by pressing ctrl-c, I don&#39;t know if wavenc cares about it, but this way you get no eos (if wavenc cares about it to finish the file, this makes a difference). You might want to set num-buffers property of audiotestsrc and listen for EOS messages from the bus and quit the mainloop when it happens.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Btw, what was the problem with gst-launch -e ?</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Mon, Apr 27, 2009 at 7:42 PM, Guilherme <span dir="ltr">&lt;<a href="mailto:grlongo.ireland@gmail.com">grlongo.ireland@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thiago, I did it before and all I get is a cracked sound.<br>
<br>
Pretty weird.<br>
<br>
Have a look what I was doing before:<br>
<br>
<br>
<br>
<br>
#include&lt;gst/gst.h&gt;<br>
#include&lt;glib.h&gt;<br>
<br>
static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data);<br>
<br>
int main(int argc, char *argv[])<br>
{<br>
    GMainLoop *loop;<br>
<br>
    GstElement *pipeline, *source, *audioconvert, *wavenc, *filesink;<br>
    GstBus *bus;<br>
<br>
    gst_init(&amp;argc, &amp;argv);<br>
<br>
    loop = g_main_loop_new (NULL, FALSE);<br>
<br>
    /*creating elements*/<br>
    pipeline     = gst_pipeline_new (&quot;audio-player&quot;);<br>
    source       = gst_element_factory_make (&quot;audiotestsrc&quot;,<br>
&quot;file-source&quot;);<br>
    //audioconvert = gst_element_factory_make (&quot;audioconvert&quot;,<br>
&quot;audio-conversor&quot;);<br>
    wavenc       = gst_element_factory_make (&quot;wavenc&quot;,         &quot;wave-enc&quot;);<br>
    filesink     = gst_element_factory_make (&quot;filesink&quot;,<br>
&quot;audio-output&quot;);<br>
<br>
    if (!pipeline || !source || !audioconvert|| !wavenc || !filesink) {<br>
        g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
        return -1;<br>
    }<br>
<br>
   * g_object_set (G_OBJECT (filesink), &quot;location&quot;, &quot;foo.wav&quot;, NULL);*<br>
<br>
    /*set-up the pipeline*/<br>
<br>
    /*message handler*/<br>
    bus =  gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
    gst_bus_add_watch (bus, bus_call, loop);<br>
    gst_object_unref (bus);<br>
<br>
    /*colocar todos elementos na pipeline*/<br>
    gst_bin_add_many (GST_BIN (pipeline), source, wavenc, filesink, NULL);<br>
<br>
    /*Linkar elementos*/<br>
    //gst_element_link ();<br>
    gst_element_link_many (source, wavenc, filesink, NULL);<br>
    //g_signal_connect (demuxer, &quot;pad-added&quot;, G_CALLBACK (on_pad_added),<br>
decoder);<br>
<br>
    /* set pipeline playing status */<br>
    g_print (&quot;Running...\n&quot;);<br>
    gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<div class="im"><br>
    /*iterate*/<br>
    g_print (&quot;Recording\n&quot;);<br>
    g_main_loop_run (loop);<br>
<br>
    /* Out of the main loop, clean up nicely */<br>
   g_print (&quot;Returned, stopping playback\n&quot;);<br>
   gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
</div><div class="im">   g_print (&quot;Deleting pipeline\n&quot;);<br>
   gst_object_unref (GST_OBJECT (pipeline));<br>
<br>
  return 0;<br>
}<br>
<br>
</div>static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data) {<br>
<br>
    return TRUE;<br>
}<br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
Register Now &amp; Save for Velocity, the Web Performance &amp; Operations<br>
Conference from O&#39;Reilly Media. Velocity features a full day of<br>
expert-led, hands-on workshops and two days of sessions from industry<br>
leaders in dedicated Performance &amp; Operations tracks. Use code vel09scf<br>
and Save an extra 15% before 5/3. <a href="http://p.sf.net/sfu/velocityconf" target="_blank">http://p.sf.net/sfu/velocityconf</a><br>
<div><div></div><div class="h5">_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">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><br><br clear="all"><br>-- <br>Thiago Sousa Santos<br><br>Embedded Systems and Pervasive Computing Lab (Embedded)<br>Center of Electrical Engineering and Informatics (CEEI)<br>Federal University of Campina Grande (UFCG)<br>