aboutsummaryrefslogtreecommitdiff
path: root/aosfxplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aosfxplayer.cpp')
-rw-r--r--aosfxplayer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/aosfxplayer.cpp b/aosfxplayer.cpp
index c8e15937..69c1171e 100644
--- a/aosfxplayer.cpp
+++ b/aosfxplayer.cpp
@@ -5,7 +5,7 @@ AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app)
{
m_parent = parent;
ao_app = p_ao_app;
- m_sfxplayer = new QMediaPlayer(m_parent, QMediaPlayer::Flag::LowLatency);
+ m_sfxplayer = new QSoundEffect();
}
AOSfxPlayer::~AOSfxPlayer()
@@ -38,7 +38,7 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout)
else
f_path = sound_path;
- m_sfxplayer->setMedia(QUrl::fromLocalFile(f_path));
+ m_sfxplayer->setSource(QUrl::fromLocalFile(f_path));
set_volume(m_volume);
m_sfxplayer->play();
@@ -52,5 +52,5 @@ void AOSfxPlayer::stop()
void AOSfxPlayer::set_volume(int p_value)
{
m_volume = p_value;
- m_sfxplayer->setVolume(p_value);
+ m_sfxplayer->setVolume(p_value / 100.0);
}