Results of extracting and loading data from samples

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Results of extracting and loading data from samples


I have a pipeline with an appsink for S16LE audio input where the sample
rate is 44 100 Hz and there is only one channel. I use the following code to
gain data from the audio files:

            GstBuffer *buffer = gst_sample_get_buffer(sample);
            GstMapInfo mem;
            if (gst_buffer_map(buffer, &mem, GST_MAP_READ))
                for ( guint i = 0; i < mem.size; i+=2)
                    guint lo =[i];
                    guint hi =[i+1];
                    gint16 hilo = (hi << 8) | lo;

            gst_buffer_unmap (buffer, &mem);

However, the output I get always starts with at about 1300 zeros (the number
of zeros are different for two different files), despite the input files are
cut from the middle of another audio tracks, so we cannot say that by the
time these samples arrive the song hasn't started playing yet. Does anyone
know what can be the reason for this?

I attached one of the input songs and the beginning of its ouput.


Sent from:
gstreamer-devel mailing list
[hidden email]