diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-11-04 17:13:52 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-11-04 17:13:52 +0300 |
| commit | 9939637dda8cf09fc4e1620378fc5ac5de8885f6 (patch) | |
| tree | 6d4e23784746721216cd9ae6a0c1eeb48c82cd9e /src/aosfxplayer.cpp | |
| parent | d40292125710e2e6698ffad7f4a7d7dcc41eace6 (diff) | |
Fix the sound bonanza so they actually play
sfx player and blip player now both account for extension-less sound paths and also correctly handle paths that do provide the extension.
Diffstat (limited to 'src/aosfxplayer.cpp')
| -rw-r--r-- | src/aosfxplayer.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/aosfxplayer.cpp b/src/aosfxplayer.cpp index 98496eaa..9fa3026f 100644 --- a/src/aosfxplayer.cpp +++ b/src/aosfxplayer.cpp @@ -40,12 +40,12 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout, int channel QString misc_path = ""; QString char_path = ""; - QString sound_path = ao_app->get_sounds_path(p_sfx); + QString sound_path = ao_app->get_sfx_suffix(ao_app->get_sounds_path(p_sfx)); if (shout != "") - misc_path = ao_app->get_base_path() + "misc/" + shout + "/" + p_sfx; + misc_path = ao_app->get_sfx_suffix(ao_app->get_base_path() + "misc/" + shout + "/" + p_sfx); if (p_char != "") - char_path = ao_app->get_character_path(p_char, p_sfx); + char_path = ao_app->get_sfx_suffix(ao_app->get_character_path(p_char, p_sfx)); QString f_path; @@ -56,9 +56,6 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout, int channel else f_path = sound_path; - if (!file_exists(f_path)) - f_path = ao_app->get_sfx_suffix(f_path); //If we're not given a sound file with .wav/.ogg/.opus already there, let's do this thing - if (f_path.endsWith(".opus")) m_stream_list[channel] = BASS_OPUS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); else |
