<br>Hi,<br> Is it possible to have the callbacks while playing the audio stream by using "playbin" 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 <<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</a>> 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>
I'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 ( "mp3-player" );<br>
source = gst_element_factory_make ( "filesrc", "file-source" );<br>
decoder = gst_element_factory_make ( "mad", "mp3-decoder" );<br>
conv = gst_element_factory_make ( "audioconvert", "converter" );<br>
sink = gst_element_factory_make ( "alsasink", "sink" );<br>
<br>
g_object_set ( G_OBJECT(source), "location", "x.mp3", 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 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'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>
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>