Gleb Mazovetskiy
0e0cc9d1b0
Reduce to just `STREAM_ALL_AUDIO_MIN_FILE_SIZE`
...
This does result in a bit more code and RAM usage for soundsample when
`STREAM_ALL_AUDIO` is on, but not by much.
3 years ago
Gleb Mazovetskiy
0dd95adcd1
Add a minimum threshold for STREAM_ALL_AUDIO
3 years ago
Gleb Mazovetskiy
3ab2f49a92
Audio: Avoid creating same-rate resamplers
...
Each resampler allocates an input buffer and an output buffer.
Since we create ~100 audio stream objects (1 per `sfx_MISC` effect),
the memory cost of these buffers adds up.
Avoids creating a resampler when the audio sampler rate matches the
output sample rate. This is mostly the case when the output sample
rate is 22050.
3 years ago
Gleb Mazovetskiy
f20c58c8a0
SoundSample::SetChunkStream: Log filename on error
3 years ago
Gleb Mazovetskiy
9db80ef5d7
Assets: Load files directly for UNPACKED_MPQS
...
When using `UNPACKED_MPQS`, avoid all the SDL machinery for reading
files.
This is beneficial not only due to reduced indirection but also because
we can test for the file's existence and get the file size without
opening it, which is much faster.
3 years ago
Gleb Mazovetskiy
4cdbd358dd
Audio: Use SDL resampler where available
4 years ago
Gleb Mazovetskiy
7f695c2835
Use SoundSample for music
...
Unifies audio handling between sound effects and music.
4 years ago
Gleb Mazovetskiy
5645456537
Support MP3 playback
4 years ago
obligaron
8a4d4b6375
Add OptionEntries for Audio
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
Gleb Mazovetskiy
fa90679416
game_assets.* -> assets.*
4 years ago
Gleb Mazovetskiy
3d308983a8
Migrate to libmpq
...
libmpq is a much simpler alternative to StormLib for reading MPQ archives.
We use our own fork of libmpq: https://github.com/diasurgical/libmpq
Impact:
* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
4 years ago
Anders Jenbo
8df5912dc6
Always use SDL wrapper for file access
4 years ago
obligaron
837ddc0396
Fix a warning in soundsample.cpp
5 years ago
Anders Jenbo
9ebdb6db69
General clean up
5 years ago
ephphatha
3520dc4201
Update numeric literals to use appropriate suffix
...
Mainly things like .F for floats instead of doubles in float context.
5 years ago
Anders Jenbo
8e07ef8fe5
Clang-tidy: misc-unused-parameters
5 years ago
Anders Jenbo
fa54499aeb
Clang-tidy: readability-uppercase-literal-suffix
...
Strip suffixes
5 years ago
Anders Jenbo
51d5c8bcab
Clang-tidy: performance-unnecessary-value-param
5 years ago
Anders Jenbo
f167bd4dfb
Clang-tidy: llvm-include-order
5 years ago
Anders Jenbo
ec8d7bebe2
Clang-tidy: modernize-use-auto
5 years ago
Gleb Mazovetskiy
e72def02e6
🔨 Add `STREAM_ALL_AUDIO` build setting
...
For extremely memory-constrained devices. Gets into town on RG99 (18 FPS -> 14 FPS).
5 years ago
Anders Jenbo
4a7ba94702
🎨 Run clang-format
5 years ago
thebigMuh
24f32a1d53
Fix sound volume/panning attenuation ( #1789 )
...
* Fixing volume adjustment and scaling
5 years ago
Gleb Mazovetskiy
5820948761
♻️ Make `SFileRw` own the Storm file handle
...
All of our use-cases for `SDL_RWops` Storm file require closing the file
when closing the `SDL_RWops` -- doing this automatically simplifies the
code.
5 years ago
Gleb Mazovetskiy
7bdfb0655c
🐞 Support multiple playback of the same sound
5 years ago
Anders Jenbo
f884ba5340
🔥 Remove more miniwin dependencies
5 years ago
Anders Jenbo
916a12ff3d
🐛 Fix missing sounds
...
When playing the same sound twice with in a short duration then the
sound it self, the secound request would go unfulfilled. The solution is
to simply rewind the stream pointer before requesting a playback.
5 years ago
Gleb Mazovetskiy
0dd9aeea69
♻️ Cleanup DISABLE_STREAMING_MUSIC handling
...
Extracts `LoadMusic` and `CleanupMusic` functions.
5 years ago
Gleb Mazovetskiy
acee2ef14c
🎉 Switch from SDL_mixer to SDL_audiolib
...
SDL_mixer can only stream a single music track
SDL_audiolib has unlimited streams.
With this change, we finally have streaming sounds (respecting
sfx_STREAM).
Audio options can now also be set via diablo.ini, which should help us
better diagnose the static noise issues.
5 years ago
Jmgr
1b7e0d2cb3
Migrate existing log entries
5 years ago
Anders Jenbo
7912e510f0
🎨 Clean up overuse of SDL types
5 years ago
thebigMuh
281533e82d
This fixes exclusively the panning bug, where after a certain distance is exceeded, sound samples get played without panning.
5 years ago
Anders Jenbo
cc164985a3
🎨 Correct type checks in src sub-folder
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
433edc63ea
♻️ Consistently use pragma once to guard the headers
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
a2656637e4
🎨 Format source
5 years ago
Gleb Mazovetskiy
0c2284a091
Respect sfx_STREAM in PlaySFX
...
Changes audio playback of sounds with the `sfx_STREAM` flag, such as towner lines, to stream.
5 years ago
qndel
c45295463c
fix text scroll speed ( #1057 )
5 years ago
Anders Jenbo
88a715cdcc
Clean up narator sound logic
...
Also this provides a helper function for calculating the length of a
sound
5 years ago
Anders Jenbo
014308ef01
Explicit casting
6 years ago
Anders Jenbo
08aa6a860a
Move generic helpers out of miniwin
6 years ago
Anders Jenbo
6e9987cc93
Rename dsound and it nolonger reflects DirectSound
6 years ago
Christopher M. Hobbs
436e25207a
Add preliminary command line options to main.cpp
...
- Add -h, --help and --version
- Address most of Issue #219 .
6 years ago
Anders Jenbo
16d3fa69c6
Fix checking if sound is playing
...
Fixes #392
6 years ago
Anders Jenbo
a8e4db538f
Display SDL error messages in UI dialog
...
This will also end the application in most cases
7 years ago
Anders Jenbo
18532e7c9b
Format SourceX and SourceS
...
Fixes #262
7 years ago