Comments (4)
Hi, @LeHerosInconnu
Are you using MIDI? I believe this issue is valid only for MIDI sound, while for external music I cannot reproduce this problem.
from fheroes2.
Hello @Branikolog,
Hi, @LeHerosInconnu Are you using MIDI? I believe this issue is valid only for MIDI sound, while for external music I cannot reproduce this problem.
Yes, MIDI is used when the problem is detected.
I did a test with .ogg files in the MUSIC folder and "Music Type" set to "External" and the problem is no longer present.
There must have been a change in MIDI management at some point.
from fheroes2.
There must have been a change in MIDI management at some point.
This was always the case. MIDI playback (more precisely, MIDI playback startup) is slow in SDL_mixer. Here is the video of fheroes2 1.0.0 released Dec 21 2022 (more than a year ago):
fheroes2.engine.version_.1.0.0.2024-02-10.20-57-11.mp4
As you can see, there is the same pause that caused by delay of playing the WAV musical effect for this Shrine caused by MIDI soundtrack change due to the change of terrain. This is the same place, but using the Windows built-in MIDI (not FluidSynth MIDI) - i removed the soundfont file to force SDL_mixer to switch to the Windows MIDI:
fheroes2.engine.version_.1.0.0.2024-02-10.20-58-03.mp4
The same delay (approximately +/-). We tried to mitigate this at the time by moving the background music playback to a separate thread, and it's just that when crossing the border of the terrain it's almost unnoticeable (except for some extra horse step sounds maybe), but in situations like this it will be noticeable with MIDI, because SDL_mixer cannot start MIDI music (which, again, is a rather slow operation) and play WAV file at the same time, because it's not thread-safe. There's not much we can do about it right now. Do not use MIDI :)
from fheroes2.
This delay is not observed with prehistoric 0.9.11, but the only reason is that in that version background music changes AFTER the object is visited, consider (turn the video sound on):
Free.Heroes.of.Might.and.Magic.II.version_.0.9.11.2024-02-10.21-19-18.mp4
And the MIDI playback itself was problematic even then, it was just a bit disguised in this particular case. Regarding horse steps, in this video (also with prehistoric 0.9.11) you can hear how the horse steps sounds continue a little even after the hero stops on the new terrain, because their playback has been delayed a bit during the MIDI music change due to change of terrain:
Free.Heroes.of.Might.and.Magic.II.version_.0.9.11.2024-02-10.21-29-49.mp4
And so far it can't be any other way.
from fheroes2.
Related Issues (20)
- Castle screen, upgraded and regular mausoleums have different alignment HOT 1
- AI heroes must be able to jump into uncovered fog while using Dimension Door HOT 2
- Battle screen, auto combat disabling dialog refers to "battle", not "combat HOT 8
- Archery skill, missing description for shooting without obstacle penalty
- Sorceress castle, Rainbow sprite enhancement HOT 1
- Sorceress town screen, fixing sky flaws HOT 3
- Combat, functioning of genie ability and damage display HOT 2
- Combat screen, the paladin troop corpse sprite is displayed over the bone dragon troop creature count indicator
- Crash when selecting Roland hero in final Roland campaign map and he has empty carry over army HOT 10
- Combat screen, phoenix troop number indicator is not updated before the phoenix troop attacks
- Innoextract needed for fheroes2-extract-resources script on macOS HOT 3
- Adventure map, the rapid change of focus on the heroes appears to be like a graphical flaw HOT 3
- Roland campaign mission 7, shipyard cant build ship HOT 1
- Improved ally behavior
- Adventure map, AI should not capture bottle objects on the ocean HOT 5
- Adventure map, AI behavior, red AI player's hero Luna zip zap on the adventure map with dimension door and town gate spells (1.0.12 8369)
- Combat, AI behavior, red AI player's hero Luna wastes spell points for nothing with the resurrect spell (1.0.12 8369)
- Meeting screen, hero's necromancy level is incorrectly displayed in the meeting screen with the Spade of Necromancy artifact HOT 1
- Kingdom Overview screen, type of creatures available for recruitment is not updated when a dwelling is built in the castle
- Assertion `isWater()' failed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fheroes2.