noxworld-dev / opennox

OpenNox main repository.
GNU General Public License v3.0
446 stars 24 forks source link

NS4: Allow playing custom audio #620

Open dennwc opened 12 months ago

dennwc commented 12 months ago

Scripts should be able to load and play custom audio files for the map directory.

KILAH4716 commented 10 months ago

I've tried recording custom dialogue and renaming it appropriately with no success. I don't know what the game's looking for to determine if the sound is what it should be playing or not, but if we can simplify it to just identifying the file's name, then the process should be significantly simple, right?

dennwc commented 10 months ago

I think it's because there's a record in sound.bin. It probably sets a filename and maybe some kind of format or expected audio length.

As a first step, we should decode that file and see what's in there. Then we could make the replacement work (as we did with sprites).

And as a last step - allow loading arbitrary audio and exposing that to scripts.