Unable to stream 16bit wav file to speaker

Stefan Sauer ensonic at hora-obscura.de
Thu Dec 8 14:50:01 UTC 2016


On 12/08/2016 03:48 PM, Stefan Sauer wrote:
> On 12/08/2016 03:12 PM, Stefan Sauer wrote:
>> On 12/05/2016 05:26 PM, Walter Lucetti wrote:
>>> Hi Stefan,
>>>
>>> the file is generated by a text-to-speech application and on VLC the
>>> properties are correct:
>>> PCM S16LE
>>> Mono
>>> 22050Hz
>>> 16 bit
>>>
>>> You can check it downloading from here:
>>> https://www.dropbox.com/s/j68n82e04j4ljjy/00000002.wav?dl=0
>>>
>>> Thank you for your help
>>> Walter
>>>
>> I can confirm, that the file is not handled porperly and sounds
>> distorted. Will fix it.
>>
>> Stefan
> Actually the file is broken. These are the header parameters:
> blockalign = 1
> width      = 8
> depth      = 16
> av_bps     = 22050
> frequency  = 22050
> channels   = 1
> bytes_per_sample = 1
> bps        = 22050
> caps = audio/x-raw, format=(string)U8, layout=(string)interleaved,
> channels=(int)1, rate=(int)22050

Oh, and also the avg_bps is wrong. Needs to be 44100 for 16bit.

Stefan

>
> From various places you can check the wav format spec:
> http://soundfile.sapp.org/doc/WaveFormat/
> BlockAlign       == NumChannels * BitsPerSample/8
>                                The number of bytes for one sample
> including
>                                all channels.
>
> The issue is that blockalign=1, but for 16bit, it must be >= 2. We can
> probably add a workaround, not sure what others think. If you can
> please also report to the software that created the file.
>
> Stefan
>
>>
>>>
>>> 2016-12-05 16:58 GMT+01:00 Stefan Sauer <ensonic at hora-obscura.de
>>> <mailto:ensonic at hora-obscura.de>>:
>>>
>>>     On 12/05/2016 02:53 PM, Walter Lucetti wrote:
>>>>     Hi all,
>>>>
>>>>     I have a problem with GStreamer 1.9.90 and a 16bit PCM mono
>>>>     channel wave file to be played.
>>>>
>>>>     I'm using this very simple pipeline that works very well with
>>>>     8bit file:
>>>>
>>>>     gst-launch-1.0.exe filesrc
>>>>     location="C:/Users/walter/Desktop/00000002.wav" ! decodebin !
>>>>     audioresample ! audioconvert ! autoaudiosink -v -e
>>>>
>>>>     With 16 bit file (S16LE to be precise) the output is a long noise.
>>>>
>>>>     this is the output I obtain with "-v" option... I notice that
>>>>     recognized format il "8U", but I'm not able to force it to
>>>>     16bit anyway:
>>>>
>>>>     Pipeline is PREROLLING ...
>>>>     /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:
>>>>     caps = audio/x-wav
>>>>     /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:
>>>>     caps = NULL
>>>>     /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstWavParse:wavparse0.GstPad:src:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>
>>>     Are you sure the 16bit wav file is well formed? According to the
>>>     output gstreamer plays it as 8bit, which explains the noise. Can
>>>     you share this file?
>>>
>>>     Stefan
>>>
>>>>     /GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     /GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink.GstProxyPad:proxypad1:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     Redistribute latency...
>>>>     /GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0/GstDirectSoundSink:autoaudiosink0-actual-sink-directsound.GstPad:sink:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     /GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     /GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:sink:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad2:
>>>>     caps = audio/x-raw, format=(string)U8,
>>>>     layout=(string)interleaved, channels=(int)1, rate=(int)22050
>>>>     Pipeline is PREROLLED ...
>>>>     Setting pipeline to PLAYING ...
>>>>     New clock: GstAudioSinkClock
>>>>     handling interrupt.
>>>>     Interrupt: Stopping pipeline ...
>>>>     EOS on shutdown enabled -- Forcing EOS on the pipeline
>>>>     Waiting for EOS...
>>>>     Got EOS from element "pipeline0".
>>>>     EOS received - stopping pipeline...
>>>>     Execution ended after 0:00:03.745515003
>>>>     Setting pipeline to PAUSED ...
>>>>     Setting pipeline to READY ...
>>>>     Setting pipeline to NULL ...
>>>>     Freeing pipeline ...
>>>>
>>>>
>>>>     Thank you for help
>>>>     Walter
>>>>
>>>>     -- 
>>>>     *Walter Lucetti*
>>>>
>>>>     email: myzhar at gmail.com <mailto:myzhar at gmail.com>
>>>>     web: /www.robot-home.it <http://www.robot-home.it/>/
>>>>     project:  http://myzharbot.robot-home.it
>>>>     <http://myzharbot.robot-home.it>
>>>>
>>>>
>>>>
>>>>     _______________________________________________
>>>>     gstreamer-devel mailing list
>>>>     gstreamer-devel at lists.freedesktop.org
>>>>     <mailto:gstreamer-devel at lists.freedesktop.org>
>>>>     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>>     <https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel>
>>>
>>>     _______________________________________________ gstreamer-devel
>>>     mailing list gstreamer-devel at lists.freedesktop.org
>>>     <mailto:gstreamer-devel at lists.freedesktop.org>
>>>     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>     <https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel> 
>>>
>>> -- 
>>> *Walter Lucetti* email: myzhar at gmail.com <mailto:myzhar at gmail.com>
>>> web: /www.robot-home.it <http://www.robot-home.it/>/
>>> project:  http://myzharbot.robot-home.it
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161208/56779f0b/attachment-0001.html>


More information about the gstreamer-devel mailing list