AGS has it's own audio location thing which you can use by setting the location of each audio in room coordinates and I think the volume changes regarding the player character position - you can set them using AudioClip.SetLocation.
Anyway, I recommend you don't use any of it and instead script your own thing.
Supposedly you have two (or more) audio you want to play in different places in the room, depending on where the player is. You can simply play all audioclips in repeat at the room load, and set their volumes to zero. It's a good idea to think about your game audio logic, say you have music, and ambient sound, or a radio, anyway, I would set these audios as having different types - it makes some other things easier, remember you need an audio channel to play a sound and you can allocate different audio channels for each type. Or you have three audio channels for music, idnk, it depends.
Anyway, once everything is playing at zero volume, you can just adjust the volume of each audio channel that is playing each audio clip in the room RepExec or in repeatedly_execute_always in the room script according to whatever logic you want.
My "I am lazy to think equations today" approach would be to load the background image in gimp and add a layer for each audio source and color them black and add white as much as I want for where the sound should be and throw some gaussian blur. Save each layer as one PNG image, import in the game project and use (GetPixel*100)/65535 to get the volume for the position.
Other drawing approach can be you use an extra float to store the volume for each audio and then you use regions for the sound volume but instead of setting the sound it approximates to it using a lerp or something else that smooths the volume setting (like a moving window or whatever).
Spoiler
This is done in very simple ways - considering we have access to an openAL API in the engine, we could have a more realistical implementation, but someone would need to come up with some design for the API. But openAL is this monster: https://www.openal.org/documentation/OpenAL_Programmers_Guide.pdf
[close]
Anyway, I recommend you don't use any of it and instead script your own thing.
Supposedly you have two (or more) audio you want to play in different places in the room, depending on where the player is. You can simply play all audioclips in repeat at the room load, and set their volumes to zero. It's a good idea to think about your game audio logic, say you have music, and ambient sound, or a radio, anyway, I would set these audios as having different types - it makes some other things easier, remember you need an audio channel to play a sound and you can allocate different audio channels for each type. Or you have three audio channels for music, idnk, it depends.
Anyway, once everything is playing at zero volume, you can just adjust the volume of each audio channel that is playing each audio clip in the room RepExec or in repeatedly_execute_always in the room script according to whatever logic you want.
My "I am lazy to think equations today" approach would be to load the background image in gimp and add a layer for each audio source and color them black and add white as much as I want for where the sound should be and throw some gaussian blur. Save each layer as one PNG image, import in the game project and use (GetPixel*100)/65535 to get the volume for the position.
Other drawing approach can be you use an extra float to store the volume for each audio and then you use regions for the sound volume but instead of setting the sound it approximates to it using a lerp or something else that smooths the volume setting (like a moving window or whatever).