I'm trying to play an mp3 file using python VLC but it seems like nothing is happening and there is no error message. Below is the code:
import vlc
p = vlc.MediaPlayer(r"C:\Users\user\Desktop\python\projects\etc\lady_maria.mp3")
p.play()
I tried below code as I've read from another post:
import vlc
mp3 = "C:/Users/user/Desktop/python/projects/etc/lady_maria.mp3"
instance = vlc.get_default_instance()
media = instance.media_new(mp3)
media_list = instance.media_list_new([mp3])
player = instance.media_player_new()
player.set_media(media)
list_player = instance.media_list_player_new()
list_player.set_media_player(player)
list_player.set_media_list(media_list)
I also tried to use pygame mixer but same reason, no sounds, and no error message.
from pygame import mixer
mixer.init()
mixer.music.load(r'C:\Users\user\Desktop\python\projects\etc\lady_maria.mp3')
mixer.music.play()
All of these do not give an error message so I'm not sure what is going on.. Any advice will be greatly appreciated!