&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>Hi,<br>&nbsp; Is it possible to have the callbacks while playing the audio stream by using &quot;playbin&quot; element with uri propery?<br><br>/Ganesh<br><br><br>/Ganesh<br><div class="gmail_quote">On Sun, Jul 6, 2008 at 4:48 PM, Stefan Kost &lt;<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ganesh Kundapur schrieb:<div><div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
 &nbsp;I&#39;m playing mp3 file and the code snippet for that is as fallows<br>
<br>
...<br>
loop = g_main_loop_new ( NULL, FALSE );<br>
<br>
pipeline = gst_pipeline_new ( &quot;mp3-player&quot; );<br>
source = gst_element_factory_make ( &quot;filesrc&quot;, &quot;file-source&quot; );<br>
decoder = gst_element_factory_make ( &quot;mad&quot;, &quot;mp3-decoder&quot; );<br>
conv = gst_element_factory_make ( &quot;audioconvert&quot;, &quot;converter&quot; );<br>
sink = gst_element_factory_make ( &quot;alsasink&quot;, &quot;sink&quot; );<br>
<br>
g_object_set ( G_OBJECT(source), &quot;location&quot;, &quot;x.mp3&quot;, NULL );<br>
<br>
gst_bin_add_many ( GST_BIN(pipeline), souce, decoder, conv, sink, NULL );<br>
gst_element_link_many ( souce, decoder, conv, sink, NULL );<br>
<br>
gst_element_set_state ( pipeline, GST_STATE_PLAYING );<br>
g_main_loop_run ( loop );<br>
<br>
Here after, it starts playing. Once its playing, control is not coming out till the stream ended.<br>
If i want to pause after certain time interval say 10 sec, i cant do it while playing the stream. Even i set alarm signal and signal handler, but &nbsp;alarm signal is not delivered while playing the stream.<br>
<br>
Is there any way to play the audio files asynchronously?<br>
<br>
</blockquote></div></div>
They are play&#39;ed async already. You need to register some callback to get control back. E.g.:<br>
g_timeout_add_seconds()<br>
<br>
or without a mainloop:<br>
clock = gst_pipeline_get_clock (GST_PIPELINE (bin));<br>
clock_id = gst_clock_new_single_shot_id (clock,<br>
 &nbsp; &nbsp;gst_clock_get_time (clock) + (10 * GST_SECOND));<br>
gst_clock_id_wait (clock_id, NULL);<br>
<br>
Stefan<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
/Ganesh<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
-------------------------------------------------------------------------<br>
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!<br>
Studies have shown that voting for your favorite open source project,<br>
along with a healthy diet, reduces your potential for chronic lameness<br>
and boredom. Vote Now at <a href="http://www.sourceforge.net/community/cca08" target="_blank">http://www.sourceforge.net/community/cca08</a><br>
<br>
<br>
------------------------------------------------------------------------<br>
<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>
</blockquote>
<br>
</blockquote></div><br>