Skip to content

Commit

Permalink
Do not reuse QSoundEffect object for next sound event
Browse files Browse the repository at this point in the history
This prevents the same sound from being played again and fixes #2220
  • Loading branch information
bear101 committed Apr 16, 2024
1 parent 81430dd commit 26107e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Client/qtTeamTalk/utilsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ void PlaySoundEvent::playDefaultSoundEvent(const QString& filename)
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QSound::play(filename);
#else
static QSoundEffect* effect = new QSoundEffect(ttSettings);
static QSoundEffect* effect = nullptr;
delete effect;
effect = new QSoundEffect(ttSettings);
effect->setSource(QUrl::fromLocalFile(filename));
effect->setVolume(ttSettings->value(SETTINGS_SOUNDEVENT_VOLUME, SETTINGS_SOUNDEVENT_VOLUME_DEFAULT).toInt()/100.0);
effect->play();
Expand Down

0 comments on commit 26107e6

Please sign in to comment.