The demo near the end with the Sonic “Chemical Plant” theme is definitely worth checking out. I wasn’t aware that this was how games dynamically change the background music in response to an event in the game.
It can be interesting to compare "game rip" versions of game soundtracks with the official CD releases. An official release of a track from Remember Me might be 2-3 minutes long, but the game rip is 10-20 minutes long, filled with stems and loop segments that transition back and forth based on a few things like the length of the player's current combo chain and their HP.
AFAIK, Splinter Cell: Chaos Theory is another example of this - there's an official release of the soundtrack but the game rip versions of the tracks are typically all 5-10x as long because they are extremely dynamic.
Aside from loop point adjustment, a common technique is to split a track into layers and fade layers in/out dynamically depending on world state.
Nintendo are particularly good at this, where each phase though a menu towards starting a game will add layers to the music. Makes me wonder if they're still using some form of sample-based music tracker.
Portal 2 makes heavy use of the "fading layers in dynamically" as the music will change when you fly through the air, hold various objects, or change parts of a puzzle.
Decoding whole tracks in memory seems pretty wasteful (and then getting entire waveforms on top, though this part can probably be limited). I guess it's okay if you're looping a thirty-second track but not so much if it's twenty minutes, like mentioned in another comment. Makes me wonder if compressed audio can be used directly in such cases.
(Figured I might as well put in a plug while Web Audio is on page 1)