<div dir="ltr">For mp3 it works fine. <br><br>For wav and raw pcm files program never get signal handoff.<br>To play wav file I used dynamic pad and for pcm doesn't need pad.<br><br>Is it possible to play binary data using this approach? If so what would be the decoder elements. <br>
<br>I have looked into appsrc plugin . I ran the example given as part of the plugin. Audio is not coming.<br><br>Thanks,<br>Akbar<br><br><br><div class="gmail_quote">On Sat, Jul 12, 2008 at 3:33 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;">hi,<br>
Akbar Basha schrieb:<div class="Ih2E3d"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Stefan,<br>
<br>
Thanks for the response .<br>
</blockquote>
<br></div>
Would you please post to the list.<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;">
<br>
I tried the same. But could not produce the result.<br>
<br>
Please find the code.<br>
<br>
static void<br>
cb_handoff (GstElement *fakesrc,<br>
GstBuffer *buffer,<br>
gpointer user_data)<br>
{<br>
/* Clip start and end */<br>
<br>
data = (guint8 *) g_malloc (3000);<br>
GST_BUFFER_SIZE (buffer) = 3000;<br>
GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer) = data;<br>
FILE* fp = fopen("vertigo.mp3","rb");<br>
if(fp == NULL)<br>
{<br>
printf( " File is not opened \n");<br>
return;<br>
}<br>
fread(data,3000,1,fp);<br>
fclose(fp);<br>
}<br>
<br>
gint<br>
main (gint argc,<br>
gchar *argv[])<br>
{<br>
GstElement *pipeline, *fakesrc, *flt, *conv, *audiosink;<br>
GMainLoop *loop;<br>
<br>
/* init GStreamer */<br>
gst_init (&argc, &argv);<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
/* setup pipeline */<br>
pipeline = gst_pipeline_new ("pipeline");<br>
fakesrc = gst_element_factory_make ("fakesrc", "source");<br>
flt = gst_element_factory_make ("capsfilter", "flt");<br>
conv = gst_element_factory_make ("mad", "conv");<br>
audiosink = gst_element_factory_make ("alsasink", "audiosink");<br>
<br>
/* setup */<br>
g_object_set (G_OBJECT (flt), "caps",<br>
gst_caps_new_simple("audio/x-raw-int",<br>
"channels", G_TYPE_INT, 2,<br>
"rate", G_TYPE_INT, 32000,<br>
"depth", G_TYPE_INT, 16, NULL), NULL);<br>
</blockquote>
<br></div></div>
This is obviously wrong. You load an mp3 and not raw audio data. The capsfilter needs to tell that. But in your case you would not even need one.<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
gst_bin_add_many (GST_BIN (pipeline), fakesrc, flt,conv, audiosink, NULL);<br>
gst_element_link_many (fakesrc, flt,conv, audiosink, NULL);<br>
<br>
/* setup fake source */<br>
g_object_set (G_OBJECT (fakesrc),"signal-handoffs", TRUE,NULL);<br>
<br>
g_signal_connect (fakesrc, "handoff", G_CALLBACK (cb_handoff), NULL);<br>
<br>
/* play */<br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
g_main_loop_run (loop);<br>
<br>
/* clean up */<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
gst_object_unref (GST_OBJECT (pipeline));<br>
<br>
return 0;<br>
}<br>
<br>
Even if I set using memset . Audio is not coming.<br>
</blockquote>
<br></div>
What happens?<br>
<br>
Stefan<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
<br>
how to proceed in the case pad is required i.e for wav files.<br>
<br>
Regards,<br>
Akbar<br>
<br></div><div><div></div><div class="Wj3C7c">
On Wed, Jul 9, 2008 at 11:53 PM, Stefan Kost <<a href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a> <mailto:<a href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a>>> wrote:<br>
<br>
Akbar Basha schrieb:<br>
<br>
Hi,<br>
<br>
I would like to play the buffer , which is filled with any audio<br>
file data.<br>
Does gstreamer provides any mechanism to play.<br>
<br>
<br>
if you have the whole bufer in memory, use a fakesrc with<br>
signal-handoffs=TRUE and connect to handoff signal. In the handoff<br>
signal you put the pointer to your data into the GST_BUFFER_DATA,<br>
set the correct GST_BUFFER_SIZE and clear GST_BUFFER_MALLOC_DATA (if<br>
it was previously set g_free() the previous content).<br>
<br>
You should used a capsfilter after fakesrc and set the format of<br>
your sample on the capsfilter caps.<br>
<br>
Its sort of a hack, but works fine.<br>
<br>
Stefan<br>
<br>
<br>
Thanks in advance.<br>
<br>
Regards,<br>
Akbar<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<br>
project,<br>
along with a healthy diet, reduces your potential for chronic<br>
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>
<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br></div></div>
<mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a>><div class="Ih2E3d"><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div>