multifilesrc looping 24bit corrupted data on loop

Nick_law nicholas at umantec.net
Thu Feb 25 06:26:33 UTC 2021


I will post my workaround for 24bit file looping.

multifilesrc Reads buffers from sequentially named files. So the idea is to
add a 32bit silent(zero) data wav file that is very short with the same name
(with an index appended) as the actual file you want to loop.
This will then mean the intended file will be played out, a few zero samples
will be appended from the 2nd file that will byte align the data and then
the intended file will loop again. BUT there will be glitches in audio
between each file but unsure if I can get around that.

First I generate a 24bit .wav file. But obviously a previously generated
file can be used.

gst-launch-1.0 interleave name=i \
audiotestsrc num-buffers=2 wave=0 freq=100 volume=0.4 ! \
audio/x-raw,channels=1 ! tee name=t1 \
audiotestsrc num-buffers=2 wave=2 freq=100 volume=0.4 ! \
audio/x-raw,channels=1 ! tee name=t2 \
t1. ! queue ! i. \
t2. ! queue ! i. \
i.src ! audioconvert ! audio/x-raw,format=S24BE ! audioconvert ! wavenc !
filesink location=testin.0.wav

Then a silent 32bit wav is generated with the same name(index appended) and
with samplesperbuffer=1 num-buffers=1.

gst-launch-1.0 interleave name=i \
audiotestsrc samplesperbuffer=1 num-buffers=1 wave=4 freq=100 volume=0.4 ! \
audio/x-raw,channels=1 ! tee name=t1 \
audiotestsrc samplesperbuffer=1 num-buffers=1 wave=4 freq=100 volume=0.4 ! \
audio/x-raw,channels=1 ! tee name=t2 \
t1. ! queue ! i. \
t2. ! queue ! i. \
i.src ! audioconvert ! audio/x-raw,format=S32BE ! audioconvert ! wavenc !
filesink location=testin.1.wav

Then finally the file playout with looping:

gst-launch-1.0 interleave name=i ! \
audioconvert ! wavenc ! filesink location=testout.wav \
multifilesrc num-buffers=60 location=testin.%01d.wav index=0 loop=true ! \
wavparse ignore-length=1 ! deinterleave name=d0 \
d0.src_0 ! audioconvert ! volume volume=1 ! queue ! i.sink_0 \
d0.src_1 ! audioconvert ! volume volume=1 ! queue ! i.sink_1


Not sure if this will help anyone but me. Or if anyone has a better
solution?

kind regards
Nick 


Nick_law wrote
> I have found a potential solution that I will post in another reply. But
> there are still data glitches between loops but it at least still
> recovers.  





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list