Skip to content

Instantly share code, notes, and snippets.

Created May 23, 2016 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2295813f2ca442659ba1d3969487c25c to your computer and use it in GitHub Desktop.
Save anonymous/2295813f2ca442659ba1d3969487c25c to your computer and use it in GitHub Desktop.
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