My app should work both on Windows and Linux(Ubuntu). So I have to reimplement my notification sounds, because QSound does not work under Ubuntu. I am trying with QAudioOutput.
I can't get it to run with this code, and I don't understand what I have to do. Do you have any tips? Or perhaps another idea that works on both OS?
from PyQt4.QtGui import QApplication
import sys
from PyQt4.QtMultimedia import QAudioOutput, QAudioFormat
from PyQt4.QtCore import QFile, QIODevice
app=QApplication(sys.argv) #1st Edit
output=QAudioOutput()
soundFile=QFile()
soundFile.setFileName("C:\\Users\\delete_2.wav")
soundFile.open(QIODevice.ReadOnly)
output.start(soundFile)
app.exec_() #1st Edit
app.addLibraryPath(r"C:/Users/Χρήστος/AppData/Local/Programs/Python/Python38/Lib/site-packages/pyqt5_tools/Qt/plugins") app.addLibraryPath(r"C:/Users/Χρήστος/AppData/Local/Programs/Python/Python38/lib/site-packages/PyQt5/Qt/plugins")
– Chris P