Proposal of new feature to wavparse

Sebastian Dröge sebastian at centricular.com
Sun Oct 26 03:12:42 PDT 2014


On Sa, 2014-10-25 at 21:45 -0200, Tiago Katcipis wrote:
> Hi,
> 
> First I will describe my problem:
> 
> I have an IMA ADPCM WAV file being recorded, as the file is recorded I need
> to:
> 
> 1 - Open it, get the duration from the wav header and seek to near the end
> (the client wants to hear what is being said on the audio with the minimum
> latency possible).
> 
> 2 - Start to stream the audio to a client while it is still being recorded
> (with care to not send it faster then it is being recorded).
> 
> 3 - Just stop to send the audio when the file stops being recorded
> (basically I hit EOF).
> 
> I was able to use wavparse ignore-length property to bypass the duration
> found on the header file. But still I was getting EOS while the recording
> was still going on.
> 
> Checking out wavparse closer it uses a field dataleft to define when to
> EOS. Disabling EOS from dataleft I was able to do everything I wanted
> (seek, get duration and stream audio until the source indicates that there
> is no more data left).
> 
> It worked perfectly fine, but I did some nasty stuff on the wavparse and
> basically forked it as another plugin. I can think on a way to make this
> work using wavparse, through a property (like ignore-length), but I don't
> know if the use case is good enough to justify the addition of this feature.
> 
> Adding this kind of feature on wavparse makes sense ?

When ignore-length is used, wavparse should probably not keep track of
how much data is left itself but continue reading until upstream returns
EOS. That should solve your problem, right?


Apart from that, what you're describing here is never going to work
reliable in the general situation. It can happen because of various
reasons that wavparse reads faster than the writer writes, and the you
will get an EOS too early. But you probably know that already :)

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141026/690392eb/attachment-0001.sig>


More information about the gstreamer-devel mailing list