Here some review. I don't see major issue, though some things you could consider/check/improve (always welcomed!) :
- g_bFileExists is not used in others functions. I guess it's safe to remove it.
- file_exists is redundant as you can check it with fopen after.
- Which means you should always create your variables after the conditions when possible.
- About config parsing:
- It would be a good idea to check for comments (// ; #)
- Checking if line is empty will avoid unnecessary calls
- I guess you could replace trim + remove_quote by parse, it should remove space and quotes.
- You should remove "sound/" when precaching WAV, something like: szBuffer[6]
- Technically precache_* could fail, even if unliky. I would do: bSuccess = !!precache_*(...)
- It seems more appropriate to check last x characters rather using contain as you could have file wrongly named but still valid.
- You should avoid duplicated code for several reasons like maintenablity or readability ; the parsing code could be extracted in another function. the calling this function with current path.
- A detail but check with bSuccess should be done above (inside else condition).
- When you check iSize you could also destroy dynamic array.
- it doesn't hurt to cache g_aSounds array size before.
- spk command doesn't need 'sound/'.
- You may want to know WAV/MP3 file length using this lib. You could also check if file is valid with it it seems. Something to check. Something to check.
- I'm not sure to like you use 'stopsound' as generally WAV are often used and several sounds can be played at the time for different purposes. I think you should try to use another method. Maybe emitting a sound with some flags to be heard from everwhere (entity? emit_sound?). I thing I have done that once, and then you would not interfere with others WAV and could control more easily.
- Caching duration length would be a good idea, though considering context, it's not that a big deal.
That's all for now.
__________________