<div class="gmail_quote">I suppose you're finishing your application by pressing ctrl-c, I don'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"><<a href="mailto:grlongo.ireland@gmail.com">grlongo.ireland@gmail.com</a>></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<gst/gst.h><br>
#include<glib.h><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(&argc, &argv);<br>
<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
/*creating elements*/<br>
pipeline = gst_pipeline_new ("audio-player");<br>
source = gst_element_factory_make ("audiotestsrc",<br>
"file-source");<br>
//audioconvert = gst_element_factory_make ("audioconvert",<br>
"audio-conversor");<br>
wavenc = gst_element_factory_make ("wavenc", "wave-enc");<br>
filesink = gst_element_factory_make ("filesink",<br>
"audio-output");<br>
<br>
if (!pipeline || !source || !audioconvert|| !wavenc || !filesink) {<br>
g_printerr ("One element could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
<br>
* g_object_set (G_OBJECT (filesink), "location", "foo.wav", 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, "pad-added", G_CALLBACK (on_pad_added),<br>
decoder);<br>
<br>
/* set pipeline playing status */<br>
g_print ("Running...\n");<br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<div class="im"><br>
/*iterate*/<br>
g_print ("Recording\n");<br>
g_main_loop_run (loop);<br>
<br>
/* Out of the main loop, clean up nicely */<br>
g_print ("Returned, stopping playback\n");<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
</div><div class="im"> g_print ("Deleting pipeline\n");<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 & Save for Velocity, the Web Performance & Operations<br>
Conference from O'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 & 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>