Re: [Vala] Gstream Capture audio from microphone



The GStreamer pipeline can be as simple as "autoaudiosrc ! audioconvert !
vorbisenc ! oggmux ! filesink location=dump.ogg".
And you can use something as simple as this code below to run a GStreamer
pipeline inside your app (adapted from another email I sent a few days ago):

   1. using Gst;
   2.
   3. void main (string[] args) {
   4.     Gst.init (ref args);
   5.
   6.         var pipeline = Gst.parse_launch("autoaudiosrc ! audioconvert
   ! vorbisenc ! oggmux ! filesink location=\"%s\"".printf(args[1]));
   7.     pipeline.set_state (State.PLAYING);
   8.     new MainLoop ().run ();
   9. }
   10.


If you need more control, then you need to learn a bit more of GStreamer
and then you can control the pipeline elements in your code.

*Alexandre Rosenfeld*

On Wed, Nov 16, 2011 at 15:03, Thijs Vermeir <thijsvermeir gmail com> wrote:

On Wed, Nov 16, 2011 at 3:36 PM, Edwin DLCA <edwinspire gmail com> wrote:
As I can capture audio from microphone.
Can you help me with a piece of sample code. I am new to vala.
Thank you.

A great to start would be the vala gstreamer examples:
http://live.gnome.org/Vala/GStreamerSample

Then adapt this to your gstreamer pipeline...

Gr,
Thijs
_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]