0

I have tried many libraries,they didn't work for me:(

import pyglet
url=https://api.telegram.org/file/TOKEN/GENERATED_FILE_PATH
pyglet.resource.path = [r'url']
pyglet.resource.reindex()
music = pyglet.resource.media(r'filename.mp3/oga')
player.queue(music)
player.play()
  • Possible duplicate of [How to play mp3 from URL](http://stackoverflow.com/questions/38171169/how-to-play-mp3-from-url) – Maak Oct 30 '16 at 16:44

1 Answers1

0

This question is already answered here: How to play mp3 from URL

If you happen to have VLC installed (or are willing to install it), then this should work:

import vlc p = vlc.MediaPlayer("http://your_mp3_url") p.play()

This has the advantage that it works with everything VLC works with, not just MP3. It can also be paused if you want to.

(Oops... Looks like the formatting failed)

Community
  • 1
  • 1
YpsilonZett
  • 100
  • 1
  • 7