Problems playing stereo and 32-bit float samples using appsrc

Albert Tomanek electron826 at gmail.com
Mon Dec 11 17:37:09 UTC 2017


Hello,I am trying to get GStreamer to play raw sample data (32-bit float
stereo) which I have loaded from a file using the appsrc element.(I know
that I could use filesrc for this, but the program will evolve to play
output samples from a non-gstreamer library stored in memory)I have adapted
code taken from  this example <https://goo.gl/8onDu4>  , and have had
success getting it to play an 8-bit mono sample. code
<http://gstreamer-devel.966125.n4.nabble.com/file/t378119/basic-tutorial-8b.c> 
However I am having problems getting it to play float samples and getting it
to use more than 1 channel.When I try to play an 8-bit *stereo* sample (by
changing the number of samples which in the end gets passed to
gst_audio_info_set_format at line 190),the audio playback keeps stopping and
starting and playing twice the speed.
159c159<   load_raw(&data, "./wicked dub_8.raw", 44100, 1);--->  
load_raw(&data, "./wicked dub_8s.raw", 44100, 2);
Meanwhile, when I try to play a mono 32-bit float sample, it sounds
distorted for some reason.
11c11< #define SAMPLE uint8_t---> #define SAMPLE float159c159<  
load_raw(&data, "./wicked dub_8.raw", 44100, 1);--->   load_raw(&data,
"./wicked dub_f32.raw", 44100, 1);190c190<   gst_audio_info_set_format
(&info, GST_AUDIO_FORMAT_U8, (gint) data.samplerate, (gint) data.channels,
NULL);--->   gst_audio_info_set_format (&info, GST_AUDIO_FORMAT_F32LE,
(gint) data.samplerate, (gint) data.channels, NULL);
Does anyone have any idea as to what I am missing or doing wrong?Thanks in
advanceAlbertPS:  Here
<http://gstreamer-devel.966125.n4.nabble.com/file/t378119/samples.7z>   are
the samples I've been using.



--
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/20171211/7cdf54a4/attachment.html>


More information about the gstreamer-devel mailing list