Playing an audio by URL

167 views
Skip to first unread message

Antonio Peña

unread,
Feb 27, 2022, 8:21:05 AM2/27/22
to kivy-...@googlegroups.com
Hello Kivy,

I've been around your Audio API and there is not how to play a sound given a URL, instead of a path. If I can suggest so, it would be great to have that option, since the inhability to do it affects some of us.

Is there any Python module, like "playsound" or even requests somehow that is compatible using different platforms, such as Android, iOS, OS X, Linux and Windows?

Thanks.

Elliot Garbus

unread,
Feb 27, 2022, 9:11:28 AM2/27/22
to kivy-...@googlegroups.com

Are you playing an MP3 or streaming media?  Where are you accessing the audio from?

If you are downloading an mp3, see: https://kivy.org/doc/master/api-kivy.network.urlrequest.html?highlight=url#module-kivy.network.urlrequest

You can use this to download from the URL.

 

If you want to make suggestions for enhancements, enter your request into the issues section of the kivy GitHub repo.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CACnT7V7F_s%3DJ%2Bxu2%2BL2nmVa%2BV2SDhSm6zjAcxLhZzCRrkKyXEg%40mail.gmail.com.

 

Antonio Peña

unread,
Feb 27, 2022, 11:40:13 AM2/27/22
to Kivy users support
I figured out a form to do it with requests (see it in GitHub here). Is it pythonic and... kivyonic? It works fine when you call it inside a Thread, but I now know that is not very good to work within Kivy (hehe).

I will take a look at the UrlRequest Kivy's module. Looks more complicated, though.

Thanks!

Reply all
Reply to author
Forward
0 new messages