Several questions regarding the Python bindings for GStreamer (Asyncio compat, mixing of streams, reading directly from BytesIO)
Olivier CrĂȘte
olivier.crete at collabora.com
Mon Aug 27 18:26:15 UTC 2018
Hello,
On Fri, 2018-08-24 at 19:37 +0200, Hadrien Titeux wrote:
> So, here are what I'd like to know:
> - Is it possible to play a .wav file without saving it to disk first?
> Like, directly from the byte file stored in the python memory (as
> portaudio can do it)
Totally possible, you can use "appsrc" instead of a filesrc and then
just give it buffers.
> - The websocket receives sounds asynchronously with the asyncio
> module. I've seen that Gbulb permits the use of the Gtk event loop
> with asyncio. I'll be thus receiving sound bites that i'll have to
> play right at the moment I receive them through my websocket client,
> sometimes overlapping each other when they're being played. This
> requires asynchronously mixing several audio files. Do you think this
> is feasible with the gst bindings?
Yes, you would do that with multiple appsrcs, you want to make it a
livesrc and set "do-timestamp" to true on them. Then mix them with the
new "audiomixer", but make sure there is a "live" source connected when
it starts. You should probably set all of your appsrc instances to be
live.
> To give you an idea of what i'd expect, here's the portaudio
> implementation of what I need:
> https://github.com/loult-elte-fwere/termiloult/blob/master/tools/audiosink.py
>
>
> I can't find any documentation on this kind of usage of gstreamer,
> apart from the cold PyGObject API reference.
Your usecase is indeed a bit special, so I don't think you'll find any
written documentation.
Olivierhttps://twitter.com/Bodegacats_/status/1034042708074135553
> Thanks in advance for your help,
> Hadrien
> _______________________________________________gstreamer-devel
> mailing listgstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
--
Olivier CrĂȘte
olivier.crete at collabora.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180827/a103e739/attachment.html>
More information about the gstreamer-devel
mailing list