Could not update timestamps for skipped samples.
-
When I use QMediaPlayer() and QAudioOutput() modules to play mp3, I got this warning, why this one happen? The test code is like below:
from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QMenu, QAction from PyQt6.QtGui import QPixmap from PyQt6.QtCore import QUrl from PyQt6.QtMultimedia import QMediaPlayer, QAudioOutput class DesktopPet(QWidget): def __init__(self): super().__init__() self.label = QLabel(self) self.pixmap = QPixmap("pet.png") self.label.setPixmap(self.pixmap) self.label.resize(self.pixmap.size()) self.media_player = QMediaPlayer(self) self.audio_output = QAudioOutput(self) self.media_player.setAudioOutput(self.audio_output) self.media_player.setSource(QUrl.fromLocalFile("music.mp3")) self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.customContextMenuRequested.connect(self.show_context_menu) def show_context_menu(self, pos): menu = QMenu(self) play_music_action = QAction("Play sound", self) play_music_action.triggered.connect(self.play_music) menu.addAction(play_music_action) menu.exec(self.mapToGlobal(pos)) def play_music(self): if self.media_player.isPlaying(): self.media_player.pause() else: self.media_player.play() if __name__ == "__main__": app = QApplication(sys.argv) pet = DesktopPet() pet.show() sys.exit(app.exec())
How to forbid this?
-
Hi,
This stack overflow answer has a well explained answer.
Currently I don't think you can do anything from the user side.
-
Hope won't help without a bug report.
You should check the bug report system to see if there's something related and if not open a ticket about this issue. -
You don't need to be an expert :-)
You can simply go to the bug reporting system and check there if there's already something about it.If not, open a new ticket providing your example and full system information so it is easier to reproduce. Provide the findings you made about the error message and how it can be dealt with.
If a report already exist, you can check whether it contains all the information required. If not, add yours. You can also vote for it.
That would already be a good help to improve Qt.
You are not required to implement a solution, but if you want to take a shot at it, then just try. It's one way to learn and get better at the subject.
We all started and tried at some point, that's also how you learn :-)