Extracing data from samples
krrr
kosareka at gmail.com
Sat Dec 8 17:07:03 UTC 2018
Hello,
I have a playbin with an appsink, and my goal is to gain raw data out of
audio files. For this, I have a "new-sample" signal attached to the
appsink, and when a sample arrives, I use the gst_app_sink_pull_sample()
function to get it, then query the buffer that belongs to the sample,
finally I save sample info into a GstMapInfo object. According to the docs
<https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMemory.html#GstMapInfo>
, the GstMapInfo has a member called data, and I supposed that raw samples
are accessible through this member, but the content of info.data changes
every time I run my application. Also, they are unsigned 8-bit integers, and
when I tested reading the same mp3 file with a Python module, the data
points (or samples) had quite different values, some of them were more than
255 and some of them were negative numbers. Another thing I don't understand
that if the length of the input audio is 10 seconds, it produces only 382 or
383 samples, however the sample rate seems to be the usual 44 100 Hz,
according to this there should be about 441 000 samples per 10 seconds. What
am I doing wrong? Can someone make this clear?
Thank,
R
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list