View Single Post
Old 23-04-14, 11:50   #510
Lwmte
Explorer
 
Join Date: Aug 2010
Posts: 935
Default

Ok, it seems it was harder than I thought... Although SDL/OpenAL supports ADPCM wave files, they support them only by means of buffering ALL file at once; i. e., I can load whole wav file into memory, but can't stream it... Also I couldn't find ADPCM streaming examples on the Web (it's hard for me to get into uncompressing ADPCM data into PCM on the fly, as it involves some complicated algorhitms).

So, I decided NOT to implement WAD/WAV streaming soundtracks for now. Everything will be in OGG (whatever, if we already converted TR1/2 audio to OGG, why not for all other games? ).

Finally, I have ruled out complicated TR2 soundtrack management. As I thought, there was internal routine that converted CD trigger index into internal CD audio track index and played it. Why Core did this in the first place? I suppose it happened because level designers worked seperately from Nathan McCree, so they left placeholder CD triggers, which was later linked to actual CD track indexes via this index conversion routine.

Anyway... Now ALL soundtracks are manageable via Lua script. There, you will be able to define file name for each track and track type (background, one-shot or voice). And of course, these three types could be intermixed and overlayed with fancy crossfades - here is the demonstration!


I'll update code on SF when I rule out error handling and finish audio scripts for TR3-5.
Lwmte is offline   Reply With Quote