How can I play audio stream without saving it into the file with pyglet?

人盡茶涼 提交于 2019-11-29 12:18:25

If you just want to play a file (audio/video) from a url without saving, you can use vlc as below.
Details on vlc are here

You can install vlc (on windows) as

pip install python-vlc

Source Code

import vlc

url = 'http://ic7.101.ru:8000/c15_3'
#define VLC instance
instance = vlc.Instance('--input-repeat=-1', '--fullscreen')

#Define VLC player
player=instance.media_player_new()

#Define VLC media
media=instance.media_new(url)

#Set player media
player.set_media(media)

#Play the media
player.play()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!