Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import sys
from PyQt5 import QtWidgets
from PyQt5.QtMultimedia import QMediaPlayer, QMediaContent
from PyQt5 import QtCore
class Window(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
self.setGeometry(50, 50, 500, 500)
self.setWindowTitle("RolevPlayer")
self.player = QMediaPlayer()
self.player.setMedia(QMediaContent(QtCore.QUrl.fromLocalFile("So Far Away.mp3")))
self.player.setVolume(50)
self.player.play()
self.show()
app = QtWidgets.QApplication(sys.argv)
GUI = Window()
sys.exit(app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.