Commit graph

922 commits

Author SHA1 Message Date
Christoph Oelckers
164a9640b9 - added the option to look for music by using a truncated 8-character variant of the given name.
This workaround is needed because there's known old mods depending on this legacy behavior.
2020-12-11 19:15:28 +01:00
Chris Robinson
21271d8815 Simplify manual sound rolloff handling 2020-11-25 17:00:09 +01:00
Nikolay Ambartsumov
4b529914ae Raise SNDSEQ limit to 4096 sequences
# Conflicts:
#	src/maploader/polyobjects.cpp
2020-11-01 10:24:32 +01:00
Christoph Oelckers
4fd9765a18 - removed the limiter flags again and addressed the underlying problem properly.
The real issue is that the number of unattenuated sounds was unchecked and the near limit never kicked in.
To do this properly it is necessary to adjust the limit distance by the attenuation - zero attenuation must mean infinite distance and for high attenuations the distance must be lowered for limiting to work as intended.
The limit for the Doom boss sounds was increased to 4 to compensate for this change.

# Conflicts:
#	src/common/audio/sound/oalsound.cpp
2020-10-29 12:10:49 +01:00
alexey.lysiuk
dc2d5d7d36 - removed duplicated line of code 2020-10-28 10:39:06 +01:00
Christoph Oelckers
bef153d3b6 - enable OpenAL's sound volume normalizer. 2020-10-28 01:02:09 +01:00
Christoph Oelckers
bbbbc6885f - ensure that sfxinfo_t is always fully initialized, regardless how the setup is performed.
The recent pitch additions did not do this on all possible paths.

# Conflicts:
#	src/sound/s_advsound.cpp
2020-10-17 18:44:03 +02:00
Christoph Oelckers
7a5c34730b - moved game specific data out of the sound backend.
In Raze I already had a user data array for that so this gets used here, too, now.
Also copied a few other fixes.

# Conflicts:
#	src/sound/s_soundinternal.h
2020-10-17 18:44:00 +02:00
Christoph Oelckers
79140f3c7c - minor sound code cleanup
# Conflicts:
#	src/sound/backend/oalsound.cpp

# Conflicts:
#	src/sound/s_environment.cpp
#	src/sound/s_sound.cpp
2020-10-17 18:43:58 +02:00
Wohlstand
b07330c428 libADLMIDI: Fixed a mistake with Volume Model setup
Don't set a bank number instead of a volume model!
2020-10-04 12:50:38 +02:00
Christoph Oelckers
85a3cef7fd - fixed sounds not stopping in sound sequences.
The sound sequence code used S_GetSoundPlayingInfo incorrectly, so let it check for a valid sound ID first to restore the old behavior.
2020-09-28 19:36:43 +02:00
Christoph Oelckers
0ae0bffa58 - added a proper 'sound finished' callback to the sound engine.
Backported from Raze - without this there is no way to implement sounds that can unload themselves, because the existing ChannelEnded function is called when the sound is still active.
2020-09-27 20:53:20 +02:00
Christoph Oelckers
f766e9a326 - New reverb container. 2020-09-27 20:53:18 +02:00
Kyle Johnson
4915758586 Disallow sound to be played on destroyed actors
It's possible for an actor to call Destroy() in a ZScript method (such
as Tick()) and then subsequently call A_StartSound() to play a sound.
Generally speaking this doesn't happen within a given class, but with a
class hierarchy, Destroy() may be called unbeknownst to a mod developer.
Even though checking bDestroyed is likely good practice, this ensures
that sounds won't be started on actors flagged for cleanup.

# Conflicts:
#	src/sound/s_doomsound.cpp
2020-09-13 02:31:21 +02:00
alexey.lysiuk
6b16b6a0c1 - fixed compilation warnings reported by MSVC
src\common\audio\sound\s_sound.cpp(556,27): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
src\scripting\vmthunks.cpp(2678,13): warning C4244: 'return': conversion from 'time_t' to 'int', possible loss of data
2020-08-29 15:43:21 +02:00
MajorCooke
62f3a1cf08 Added an optional extra float parameter to $pitchshift. (#1150)
- This allows for setting a randomized range for the pitch each time the sound is initialized.
# Conflicts:
#	src/sound/s_sound.cpp
2020-08-28 13:47:09 +02:00
Major Cooke
09f5d1b666 Added $PitchSet <logical name> <float> for SNDINFO.
- Sets the direct pitch of the sound to the specific float. Default is 0.0, meaning do not set a specific pitch. Regular pitch is 1.0.
- Only works for direct sound definitions.
- Overrides $PitchShift unless value is <= 0.0
- Overridden by A_StartSound's pitch parameter if the value > 0.0.
2020-07-24 12:42:17 +02:00
Christoph Oelckers
555dea3c8a - do not allow playing sounds during PlayerFinishLevel.
This gets called right before the level ends, any sound in here would play during the intermission or at the start of the next level.

# Conflicts:
#	src/sound/s_soundinternal.h
2020-06-09 23:29:26 +02:00
Christoph Oelckers
17add7f47f - don't let CHANF_AUTO hijack other channels.
With CHANF_OVERLAP this isn't needed anymore - any sound started on CHAN_AUTO can actually play on this channel with overlap implicitly allowed.
This has the added advantage that these sounds can be reliably accessed with other function by using CHAN_AUTO.

# Conflicts:
#	src/v_2ddrawer.cpp
2020-06-07 13:27:02 +02:00
Edoardo Prezioso
09fbbfb1c6 - Fixed OpenAL regression with looping sounds with playing length 0.
If such case occurs, the starttime parameter passed to the sound functions is ignored and truncated to 0.
2020-06-03 17:08:47 +02:00
alexey.lysiuk
c386a71c3c - added #include to fix compilation with MSVC 16.6.0
https://forum.zdoom.org/viewtopic.php?t=68641

# Conflicts:
#	src/files_decompress.cpp
#	src/sound/s_music.cpp
2020-05-22 21:35:55 +02:00
alexey.lysiuk
6622801ad5 - added line break to 'No GENMIDI lump' message
'ST_Init: Init startup screen.' is no longer concatenated with the given line
2020-03-14 19:11:43 +01:00
Rachael Alexanderson
673e52f02f - fix debug assertion, cleanup vestigial A_PlaySound addition 2020-03-04 09:46:09 +01:00
Rachael Alexanderson
19233e6a82 - add checking in S_StartSound for startTime length 2020-03-03 10:58:48 +01:00
Rachael Alexanderson
4625925a69 - ported over Nash's startTime for A_StartSound 2020-03-03 10:58:46 +01:00
Major Cooke
45c80916bc Added A_StopSounds(int chanmin, int chanmax).
- If both channels are 0, completely silences the actor.
- Adapted A_StopAllSounds to call A_StopSounds(0,0);
2020-03-01 20:27:03 +01:00
Major Cooke
3e77f9a6bd Added A_StopAllSounds. 2020-02-29 20:02:17 +01:00
drfrag
6fd642ed48 Revert "Revert "Stop sources immediately when the sound is forced to stop""
This reverts commit 82c4750710.
2020-02-29 19:35:22 +01:00
Rachael Alexanderson
dfcd5d1dd5 - use GAMENAMELOWERCASE macro for music config defaults
# Conflicts:
#	src/sound/music/music_config.cpp
2020-02-23 11:59:04 +01:00
alexey.lysiuk
d1786bc0c0 - fixed arguments order for ZMusic_Start() function 2020-02-23 11:59:02 +01:00
drfrag
82c4750710 Revert "Stop sources immediately when the sound is forced to stop"
This reverts commit 6b8cebe979.
2020-02-18 15:35:03 +01:00
Christoph Oelckers
87875a52ba - backported a few sound code fixes from Raze. 2020-02-15 17:55:42 +01:00
Christoph Oelckers
16d9da97eb - backported fix for loading VOC files.
In NAM there is one that needed a bit of extra treatment.
2020-02-01 20:34:42 +01:00
Chris Robinson
350d57e8db Remove FSoundLoadBuffer since it wasn't doing anything 2020-02-01 20:34:40 +01:00
Chris Robinson
c37caf4498 Remove LoadSoundBuffered since its no longer called 2020-02-01 20:34:37 +01:00
Chris Robinson
435a3885ca Get rid of the LoadSound3D method
It no longer does anything since there's no separate buffer for 3D sfx.
2020-02-01 20:34:35 +01:00
Chris Robinson
1065d18bc4 Update a couple comments about monoized sounds 2020-02-01 20:34:33 +01:00
Chris Robinson
6b8cebe979 Stop sources immediately when the sound is forced to stop
The reason for the previous delay was to allow OpenAL Soft to fade the sound to
silence and avoid a sudden amplitude change, which can cause a "click" or "pop"
noise. However, with OpenAL Soft 1.20, this is a built-in feature of the mixer
so the extra complexity is unnecessary.
2020-02-01 20:34:30 +01:00
Chris Robinson
e7c035ff81 Remove the 'monoize' option from sound loading
Unnecessary with the AL_SOFT_source_spatialize extension, which has been
available for over a year.
2020-02-01 20:34:28 +01:00
Chris Robinson
427b6a0d14 Remove the fallback for lack of AL_EXT_SOURCE_RADIUS
It's been available in OpenAL Soft for years and the fallback method wasn't very good.
2020-02-01 20:34:25 +01:00
alexey.lysiuk
068f0420a8 - restored old values for CHAN_... constants
https://forum.zdoom.org/viewtopic.php?t=66929
2020-01-12 00:49:20 +01:00
alexey.lysiuk
fd5889e200 - fixed resolving of music aliases with full filenames
https://forum.zdoom.org/viewtopic.php?t=66815
2020-01-07 19:55:59 +01:00
Petr Mrázek
848438839b - Run the Alsa MIDI thread every 40ms or so, use non-blocking sequencer 2020-01-07 19:55:55 +01:00
Chronos Ouroboros
24a11f7a9a Fixed some incorrect parentheses in S_PlaySoundPitch. 2020-01-07 19:55:54 +01:00
Christoph Oelckers
ce1f4427cc - cleaned up the parameters of A_StartSound.
There were two booleans that could be merged into the flag word.
This also fixes a bug with CHAN_NOSTOP not working for local sounds because it checked the wrong sound source for the playing sound.
2020-01-07 19:36:52 +01:00
Christoph Oelckers
ff3606e44e - refactored the MIDI list code.
Let's hope nothing got broken on the Linux side, the recent submission's code was not usable.

# Conflicts:
#	libraries/zmusic/zmusic/configuration.cpp
#	src/sound/music/i_music.cpp
#	src/sound/music/music_midi_base.cpp
2020-01-07 18:36:55 +01:00
Christoph Oelckers
dee8af1902 - made the sound decoding interface DLL friendly and added compile switches to the MIDI players so that different licenses can be uses as compile target.
# Conflicts:
#	src/sound/backend/i_sound.h

# Conflicts:
#	libraries/zmusic/mididevices/music_timiditypp_mididevice.cpp
2020-01-07 18:22:15 +01:00
Christoph Oelckers
e89cc73f80 - rewrote the ZMusic interface so that it is free of C++ constructs.
Now it is ready to put in a DLL.

# Conflicts:
#	libraries/zmusic/zmusic/mididefs.h
#	libraries/zmusic/zmusic/zmusic.h
2020-01-07 18:07:26 +01:00
Christoph Oelckers
f2a3a70aec - replaced the C++ based file access wrapper in ZMusic with a C compatible version. 2020-01-07 18:07:23 +01:00
Christoph Oelckers
7e01b19753 - there's no need to let the XM Vorbis decoder run through the client - all related functionality is part of ZMusic itself. 2020-01-07 18:07:21 +01:00