Раздели PCM-сессии и исправь частоту и перемотку звука

This commit is contained in:
evgeny committed 2026-10-02 02:00:50 +03:00
1 parent 40b974b29c
commit 217e5795bf
13 files changed
+226 -134

No files matched your search

+5 -5
View File
@@ -947,7 +947,7 @@ void MainWindow::autoPlayCheckNewMessage(const QString& channelId) {
qPrintable(channelId), (long long)msg.id, qPrintable(fullPath));
if (!m_autoPlayTimer->isActive())
m_autoPlayTimer->start(200);
if (!SoundManager::instance()->isCurrentPcmPlaying())
if (!VoicePlayer::isPlaying())
autoPlayTimerTick();
return;
}
@@ -972,7 +972,7 @@ void MainWindow::autoPlayCheckNewMessage(const QString& channelId) {
}
void MainWindow::autoPlayTimerTick() {
if (VoicePlayer::isPreparing() || SoundManager::instance()->isCurrentPcmPlaying())
if (VoicePlayer::isPreparing() || VoicePlayer::isPlaying())
return;
while (!m_autoPlayQueue.isEmpty()) {
@@ -1000,8 +1000,8 @@ void MainWindow::autoPlayTimerTick() {
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "auto-play: playing ch=%s msg=%lld file=%s dur=%.1fs",
qPrintable(chId), (long long)msgId, qPrintable(fullPath), (double)dur);
MessageDelegate::stopAllAutoPlay();
VoicePlayer::playOpusFile(fullPath, this, [fullPath](float actualDur) {
MessageDelegate::startAutoPlay(fullPath, actualDur);
VoicePlayer::playOpusFile(fullPath, this, [fullPath](float actualDur, uint64_t playbackId) {
MessageDelegate::startAutoPlay(fullPath, actualDur, playbackId);
});
return;
}
@@ -1033,6 +1033,6 @@ void MainWindow::onAttachmentDownloadedForAutoPlay(const QString& chId, int64_t
return;
if (!m_autoPlayTimer->isActive())
m_autoPlayTimer->start(200);
if (!SoundManager::instance()->isCurrentPcmPlaying())
if (!VoicePlayer::isPlaying())
autoPlayTimerTick();
}