Hi GStreamer folks,
I would like this: ---------- #include <gst/gst.h> #include <glib.h> #include <stdio.h> #include <unistd.h> int main (int argc, char *argv[]) { int iID; int iLoop; gst_init (&argc, &argv); printf ("Let's play some music.\n"); iID = gst_play_file_non_blocking ("ogg/song.ogg", GST_NO_LOOP); for (iLoop = 1; iLoop <= 100; iLoop++) { sleep (1); printf ("Music is playing while this" " increases: %i\n", iLoop); } gst_stop_by_id (iID); /*** Stop audio with ID iID. ***/ gst_stop_all(); /*** Or simply stop all audio. ***/ printf ("Done.\n"); return 0; } ---------- What is the absolute easiest way to accomplish this? I know it seems like I'm asking you to do my work. I am. :) The reason I use frameworks and libraries is to make things easy for myself. This hello world code is already pretty extensive: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html And I don't want to read about threads just to play some sounds effects https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-threads-status.html Is there, like, a super easy example how to just play sound effects or music in a non-blocking(!) way? Maybe GStreamer is not suitable for me? Awaiting your reply, Best regards, Norbert _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi,
What you want is the experimental GstPlayer API https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-b ad-libs/html/gst-plugins-bad-libs-gstplayer.html Example code at: https://github.com/sdroege/gst-player Olivier On Wed, 2016-08-17 at 10:41 +0200, popot.org wrote: > Hi GStreamer folks, > > I would like this: > > ---------- > #include <gst/gst.h> > #include <glib.h> > #include <stdio.h> > #include <unistd.h> > > int main (int argc, char *argv[]) > { > int iID; > int iLoop; > > gst_init (&argc, &argv); > > printf ("Let's play some music.\n"); > > iID = gst_play_file_non_blocking ("ogg/song.ogg", GST_NO_LOOP); > > for (iLoop = 1; iLoop <= 100; iLoop++) > { > sleep (1); > printf ("Music is playing while this" > " increases: %i\n", iLoop); > } > > gst_stop_by_id (iID); /*** Stop audio with ID iID. ***/ > gst_stop_all(); /*** Or simply stop all audio. ***/ > > printf ("Done.\n"); > > return 0; > } > ---------- > > What is the absolute easiest way to accomplish this? > > I know it seems like I'm asking you to do my work. I am. :) The > reason > I use frameworks and libraries is to make things easy for myself. > > This hello world code is already pretty extensive: > https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html > /chapter-helloworld.html > > And I don't want to read about threads just to play some sounds > effects > https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html > /section-threads-status.html > > Is there, like, a super easy example how to just play sound effects > or > music in a non-blocking(!) way? > > Maybe GStreamer is not suitable for me? > > Awaiting your reply, > > Best regards, > Norbert > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel Olivier Crête [hidden email] _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |