<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
GstPlayer can be used from python, and probably fits your use case
:)<br>
<pre> meh master ~ devel gst-build ipython3</pre>
<pre>Python 3.8.6 (default, Sep 25 2020, 00:00:00) </pre>
<pre>Type 'copyright', 'credits' or 'license' for more information</pre>
<pre>IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.</pre>
<pre>
In [1]: from gi.repository import Gst </pre>
<pre><ipython-input-1-4132414128eb>:1: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.</pre>
<pre> from gi.repository import Gst</pre>
<pre>
In [2]: Gst.init(None) </pre>
<pre>Out[2]: []</pre>
<pre>
In [3]: from gi.repository import GstPlayer </pre>
<pre><ipython-input-3-b10918504373>:1: PyGIWarning: GstPlayer was imported without specifying a version first. Use gi.require_version('GstPlayer', '1.0') before import to ensure that the right version gets loaded.</pre>
<pre> from gi.repository import GstPlayer</pre>
<pre>
In [4]: p = GstPlayer.Player() </pre>
<pre>
In [5]: p.set_uri('<a class="moz-txt-link-freetext" href="file:///home/meh/Music/chaplin.wav">file:///home/meh/Music/chaplin.wav</a>') </pre>
<pre>
In [6]: p.play() </pre>
<pre>
In [7]: p.set_uri('<a class="moz-txt-link-freetext" href="file:///home/meh/Music/biggie.wav">file:///home/meh/Music/biggie.wav</a>') </pre>
<pre>
In [8]: p.play() </pre>
<pre>
</pre>
<div class="moz-cite-prefix">On 1/22/21 7:27 PM, Patrick Shirkey
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:cmEM1WK7QAQK8Y2-nhtNJy0mdLjn4VWKXsyIsGkLUh1QpJWTxpe0Bs0bnbTmr1Ausfmjbija4U2Llc9omE35NrUHvWWVMfqG05un5-fXzz8=@protonmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br>
Yes, I am using python for this project and this script meets all
of my requirements except for the file descriptor leak. <br>
<br>
Is there a specific step required before/after loading a new audio
file with:<br>
self.player.get_by_name('urisrc').set_property('uri', '<a class="moz-txt-link-freetext" href="file://">file://</a>' +
filename)<br>
<br>
<br>
<br>
<br>
-------- Original Message --------<br>
On Jan 22, 2021, 7:04 PM, Mathieu Duponchelle <
<a class="moz-txt-link-abbreviated" href="mailto:mathieu@centricular.com">mathieu@centricular.com</a>> wrote:
<blockquote class="protonmail_quote"><br>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
Hey, are you aware of the existence of gst-player?<br>
<br>
<a class="moz-txt-link-freetext"
href="https://gstreamer.freedesktop.org/documentation/player/gstplayer.html?gi-language=c"
moz-do-not-send="true">https://gstreamer.freedesktop.org/documentation/player/gstplayer.html?gi-language=c</a><br>
<br>
Cheers,<br>
<br>
<div class="moz-signature">-- <br>
Mathieu Duponchelle · <a href="https://www.centricular.com"
moz-do-not-send="true">https://www.centricular.com</a></div>
<br>
<div class="moz-cite-prefix">On 1/22/21 5:01 PM, Patrick Shirkey
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:N052E1SuDM4mXTl9X-lagb0XGvyzJgavoSWX9OQIDkcczgAA3H9DuO6TZP-CzTBtopCwjWEh4ncwvJRY7ul8vvFtmNA6tJEwOYC2d0Gci90=@protonmail.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<div>Hi,<br>
</div>
<div><br>
</div>
<div>I am using this simple python script to play audio files:<br>
</div>
<div><br>
</div>
<div><a
href="https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py"
moz-do-not-send="true">https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py</a><br>
</div>
<div><br>
</div>
<div>specifically <br>
</div>
<div><br>
</div>
<div>85: get_player()<br>
</div>
<div>135: play()<br>
</div>
<div>172: stop()<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Any ideas on why I get 2 additional STREAM file
descriptors every time I play a new track eventually
resulting in "Too many open files" error and segfault?<br>
</div>
<div><br>
</div>
<div>ex. 44u unix 0x000000008179a133 0t0 100262669
type=STREAM<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>--<br>
</div>
<div>Patrick Shirkey<br>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org" moz-do-not-send="true">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
</body>
</html>