Problems playing stereo and 32-bit float samples using appsrc

Albert Tomanek electron826 at gmail.com
Wed Dec 13 21:27:40 UTC 2017


Hello Tim, thank you for your guidance!
I indeed didn't account for the number of channels or samples when
calculating num_samples and the duration.I also wasn't totally clear with
myself about whether I was counting samples or frames (ie. one sample for
each channel), which may have also been causing me problems.

The program can now successfully play mono 32-bit float samples ( this is my
updated code
<http://gstreamer-devel.966125.n4.nabble.com/file/t378119/basic-tutorial-8s.bak> 
), however when I give it a stereo sample, it seems to be played at half the
speed and seems to be drawn twice on the wavescope, despite me setting the
number of channels to 2 in the code:
  <http://gstreamer-devel.966125.n4.nabble.com/file/t378119/03.png> 
I imagine that a possible cause for this could be that multiple channels are
stored differently in the file than GStreamer expects. I think that the
sample data is stored in the file with the channels alternating every sample
-- is this how GStreamer expects the samples to be stored?

The program now also sends an EOS event once the end of the sample is
reached to prevent a seg-fault:
  if (data->playback_offset >= data->size)  {	  gst_app_src_end_of_stream
((GstAppSrc *) data->app_source);  }
This works, however the program plays silence for once more the sample's
length after the end is reached.
Do you have any idea about what may be causing these problems?
Thanks --  Albert




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20171213/f26d18a6/attachment.html>


More information about the gstreamer-devel mailing list