mixing uridecodebin and audiotestsrc with shou2send issue

jack_rybn jack at rybn.org
Fri Apr 7 16:42:47 UTC 2023


Hello,

I tried this nice project that uses Google Translate :
https://github.com/irsbugs/GStreaming/blob/master/time_google_tts.py

But I would like to use a text enter by a user for TTS ans send the 
result on Icecast server. During the life of the pipeline, the user can 
send several sentences.


Here my pipeline (i hope it stays readable on your email client with a 
monospace font):

audiotestsrc ! ----------------------------------\
                                                   audiomixer ! tee ! 
queue ! opusenc ! oggmux ! shout2send
uridecodebin ! audioconvert ! audioresample ! ---/


First, i have to say if i replace "opusenc ! oggmux ! shout2send" with 
"audioconvert ! audioresample ! autoaudiosink" in the pipeline, the 
pipeline works as expected : i can listen on my speakers the sentence 
entered by the user since the beginning.

But, this is not the case on the Icecast server (with shout2send), the 
sentence is truncated at the beginning, sometimes not.

In my Python script, i tried to set is_live to False on audiotestsrc and 
seek flush at 0 the pipeline after changing uri on uridecodebin but it 
doesn't work too :

def speech(self, uri: str) -> None:
     logger.info(f'Now saying: {uri}')
     self.pipeline.set_state(Gst.State.READY)
     self.pipeline.seek_simple(Gst.Format.TIME, Gst.SeekFlags., 0)
     self.uridecodebin.set_property("uri", urllib.parse.unquote(uri))
     self.pipeline.set_state(Gst.State.PLAYING)

Is there anyone who can explain the problem between using autoaudiosink 
live output and shout2send on this sound cut and give me clues to solve 
this problem ?
Thanks !
++

Jack


-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xEBA5B9E723C3C194.asc
Type: application/pgp-keys
Size: 1688 bytes
Desc: OpenPGP public key
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230407/86822726/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230407/86822726/attachment.sig>


More information about the gstreamer-devel mailing list