Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app = QApplication(sys.argv)
- window = MainWindow()
- window.show()
- url = QUrl.fromLocalFile("./sound2.mp3")
- content = QMediaContent(url)
- player = QMediaPlayer()
- player.setMedia(content)
- player.play()
- player.stateChanged.connect(app.quit)
- app.exec_()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement