Sounds in EXE vs separate VOX

Started by Laura Hunt, Tue 31/03/2020 15:07:31

Previous topic - Next topic

Laura Hunt

I've just realized that part of my sounds and music are in the exe file and some in a vox file, and I don't remember ever having consciously made the decision of placing some in one file and some in another, so I'm looking to do a bit of tidying up by placing all my sounds inside the executable. If my game doesn't use speech/voiceover, is there any advantage to having the sounds and music of your game in a separate VOX file rather than compiling them directly into the exe file?


morganw

The answer should be that there isn't any difference if you don't plan on making the audio an optional component. But... if you are modifying the source audio files and relying on the editor to pickup changes and re-import them into the game on your behalf (which is an advertised feature of the audio import mechanism), I believe there is a bug where the source file timestamps are only checked when building the VOX file. I've not had a chance to test this fully yet, but there is an open ticket.

https://github.com/adventuregamestudio/ags/issues/778

Laura Hunt

Quote from: morganw on Tue 31/03/2020 15:40:22
The answer should be that there isn't any difference if you don't plan on making the audio an optional component. But... if you are modifying the source audio files and relying on the editor to pickup changes and re-import them into the game on your behalf (which is an advertised feature of the audio import mechanism) I believe there is a bug where the source file timestamps are only checked when building the VOX file. I've not had a chance to test this fully yet, but there is an open ticket.

https://github.com/adventuregamestudio/ags/issues/778

Interesting, thanks! I do use this feature regularly (modifying the source audio files), but out of caution/paranoia, when I do this I always hit rebuild all files just to make sure the changes get picked up. So the bug should not be an issue in this case because I'm always forcing the update/re-import manually, right?

morganw

Quote from: Laura Hunt on Tue 31/03/2020 15:58:02
So the bug should not be an issue in this case because I'm always forcing the update/re-import manually, right?
This is part of what still needs to be checked. When I was searching for the timestamp checks of the source files I could only find them in one place which was specifically related to building the VOX files, so I'm not sure that choosing to rebuild everything would actually pickup the source changes if not using VOX files. There is also the added complication that running the games from  the editor can shortcut the building of VOX/EXE files for audio changes and use the audio cache directly, which was done to allow faster testing, but this likely introduces its own sync problems.

So based on what I've seen (and what I don't know), I think I would recommend sticking with building the VOX file for the moment and then, if you don't want it, change the build preference to not use it as the last thing that you do before releasing the game (with a full rebuild).

Laura Hunt

#4
Quote from: morganw on Tue 31/03/2020 16:42:33
So based on what I've seen (and what I don't know), I think I would recommend sticking with building the VOX file for the moment and then, if you don't want it, change the build preference to not use it as the last thing that you do before releasing the game (with a full rebuild).

Yeah but the problem is that like 90% of my audio files are in the exe, and only like 10% in the vox (like I said, I have no idea why this happened, but whatever).

So if I wanted to switch all my audio files to be bundled in the VOX instead of the exe, I would need to switch a ton of files manually, using the BundlingType property in the editor and going one by one. Or is there a way to override each audio file's individual BundlingType and just pack all of them together into one format or the other in one go?

morganw

I thought that there was a global build option to turn the VOX files on and off, but I cannot find one and it does seem  to be set per AudioClip, with the default setting coming from the audio folder that you first import into. So potentially you have a mix because one of your audio folders has the bundle type set to InSeparateVOX. But unfortunately, yes I think you are correct, in order to switch the build type of all AudioClips you would have to set them all manually as the folder setting looks to be just a default value rather than providing inheritance.

If you take a backup of your Game.agf file, you can probably just do find and replace to switch between the two types, by replacing all instances of '<BundlingType>InGameEXE</BundlingType>' with '<BundlingType>InSeparateVOX</BundlingType>', or vice versa.

Laura Hunt

Quote from: morganw on Tue 31/03/2020 19:33:52
I thought that there was a global build option to turn the VOX files on and off, but I cannot find one and it does seem  to be set per AudioClip, with the default setting coming from the audio folder that you first import into. So potentially you have a mix because one of your audio folders has the bundle type set to InSeparateVOX. But unfortunately, yes I think you are correct, in order to switch the build type of all AudioClips you would have to set them all manually as the folder setting looks to be just a default value rather than providing inheritance.

Yeah, thought so. Thanks for checking!

Quote from: morganw on Tue 31/03/2020 19:33:52
If you take a backup of your Game.agf file, you can probably just do find and replace to switch between the two types, by replacing all instances of '<BundlingType>InGameEXE</BundlingType>' with '<BundlingType>InSeparateVOX</BundlingType>', or vice versa.

Ohhh good idea :)

TheManInBoots

#7
Sorry, I realized that it already had been mentioned what I wrote.

Laura Hunt

Hey morgan, just wanted to let you know that I tried manually editing the .agf game file and replacing all instances of <BundlingType>InGameEXE</BundlingType> with <BundlingType>InSeparateVOX</BundlingType> and everything seems to be working just fine, so I'll do the same thing in reverse right before the final build. Thanks for the tip :)

morganw

Thanks for confirming that it worked out. I did test some things out today and it seems that audio can only get out of sync if you distribute the Linux or standalone data file build, after you have changed some 'InGameExe' audio by updating the file at the source path, and you didn't choose to do a full rebuild. I did (eventually) find the timestamp check. So to summarise, as long as your clock is OK and timestamps don't do anything strange, and you always do a full rebuild at some point before distributing the game, everything should stay in sync.

SMF spam blocked by CleanTalk