Convertion of GstBuffer to PCM audio data

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Convertion of GstBuffer to PCM audio data

Sagar
This post was updated on .
Hi,

   Is it possible programmatically to convert GstBuffer object into PCM audio data object ?
Reply | Threaded
Open this post in threaded view
|

Re: Convertion of GstBuffer to PCM audio data

Sebastian Dröge-3
On Do, 2016-03-24 at 22:19 -0700, Sagar wrote:
> Hi,
>
>    I sit possible programmatically to convert GstBuffer object into
> PCM audio data object ?

What do you mean with "PCM audio data object"? A GstBuffer that
conforms to the audio/x-raw caps will contain PCM audio data. You can
get access to the data e.g. by mapping the buffer with
gst_buffer_map().
You can get the number of channels, sample rate, sample format from the
caps.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Convertion of GstBuffer to PCM audio data

Sagar
okay, thanks for the information..
Reply | Threaded
Open this post in threaded view
|

Re: Convertion of GstBuffer to PCM audio data

Sagar
In reply to this post by Sebastian Dröge-3

I am trying to create voice buffer when user is talking and I intend to send this voice buffer raw audio to a web service, so when ever there is a voice activity I append the buffers and when there is silence I intend to send to a webservice.

I looked into gst_memory_map(), based on it I was trying to append GstBuffer obejcts but its failing somehow after appending 2 times. there might be an issue in append or setting voice_buf


This is my code snippet:
...
GstBuffer *voice_buf;
...
if(voicedetected)
{
if (incoming_buf) {
      voice_buf = gst_buffer_append (voice_buf, incoming_buf);
    } else {
      voice_buf = incoming_buf;
}

}
else{
...
voice_buf=NULL;
...
}
...


but I am getting assertion failed message in kurento server error logs file.
GST_IS_BUFFER failed.


is there anything wrong which you think I am doing ?