Well, the file exists indeed. I tried using the following:
PlaySound("/C:/test.mp3");
PlaySound("/C:/test.mp3");
To copy to clipboard, switch view to plain text mode
And the following:
PlaySound("/test.mp3");
PlaySound("/test.mp3");
To copy to clipboard, switch view to plain text mode
Without any success. Then I tried doing the same with the resource file
PlaySound("/qrc:/snd/prueba.mp3");
PlaySound("/qrc:/snd/prueba.mp3");
To copy to clipboard, switch view to plain text mode
and
PlaySound("/:/snd/prueba.mp3");
PlaySound("/:/snd/prueba.mp3");
To copy to clipboard, switch view to plain text mode
With the same result. I also made a small modification to my playsound function:
myfile.makeAbsolute();
if(!myfile.exists()){
msgBox.setText("File does not exist.");
msgBox.exec();
msgBox.setText(myfile.filePath());
msgBox.exec();
}
QFileInfo myfile(file);
myfile.makeAbsolute();
if(!myfile.exists()){
QMessageBox msgBox;
msgBox.setText("File does not exist.");
msgBox.exec();
msgBox.setText(myfile.filePath());
msgBox.exec();
}
To copy to clipboard, switch view to plain text mode
And it happens that when I call it like this:
PlaySound("qrc:/snd/prueba.mp3");
PlaySound("qrc:/snd/prueba.mp3");
To copy to clipboard, switch view to plain text mode
The filepath returns something like 'C:/Private/e0d9aabc/qrc:/snd/prueba.mp3'. However, the folder 'Private' does not exist in that directory. If I put any other path, it returns the same path I just wrote regardless of how I write it.
Bookmarks