AGS Support > Advanced Technical Forum
Music and sound in AGS
Pumaman:
Ok, so these days the sound and music system in AGS stands out as being the last main part of AGS that you can tell was written back in the dark ages and hasn't really changed much since then.
You have to access all sounds and music by numbers (though the Media Manager Plugin does help with this), setting the volume correctly is a bit of a mystical art form, and relating sound channels to the sounds playing on them is not easy.
But rather than me just diving in and changing it all, I'd like to hear from you guys who work with it on a daily basis, how you think it should work.
Please don't suggest extra file formats. AGS will continue to support OGG/MP3/WAV/MIDI/MOD/XM/etc as it does at the moment, and I'm not planning to change that.
What I do want to change is the way that the sound and music is controlled from the script. Here are a couple of ideas:
1. Channel-based audio system
You'd do commands like:
channel[1].PlaySound(sExplosion);
channel[1].Stop();
channel[1].SetVolume(60);
2. Sound-based audio system
You'd do commands like:
sExplosion.Play(optional channelID);
sExplosion.Stop();
sExplosion.SetVolume(60);
Those are just two possible options I'm considering. While they eventually lead back to the same thing, which approach is most useful depends on how you like to script and control the audio. Other suggestions on how it should work are welcome.
Should you even have to worry about channels at all? Maybe you would give each sound a priority from 1-100, and AGS would automatically cut off a lower priority sound if all the channels were full?
Wonkyth:
I only fiddle around with this sort of thing irregularly , so my opinion might not mean much, but the channel based audio system seems the best for what I like to do.
Ryan Timothy:
Hmm.. at the moment I don't have any real suggestions, but I really like the ability to assign a name to a number. Would be very user friendly.
I imagine you're going to be adding a sound manager, from the sounds of it anyway.
The only problem I see from having a sound manager (if it were at least similar to the sprite manager) is that once you edit or switch the sound you'll have to re-import it just to have it in the game. Could be frustrating for the programmer when the sound guy gives his updated/edited sound files. Just something I was curious about.
Unless you plan on making it so that you assign which file number the 'sExplosion' will have in the sound manager, and hitting play will just play it from the sound folder, without any importing.
Anyway, I'll definitely think about any audio ideas I may have.
Matti:
Giving the sound and music files a name is not only an imrovement, it's everything I'd ask for really..
I think I's prefer the sound-based audio commands to the channel ones... but it doesn't really matter to me. I guess I just would like to have the name of the sound at the beginning of the command..
SSH:
Important to me is the ability to play speech sounds from custom scripting, and not just from the Say command, as its something I come across alot when writing modules. Also, the whole task of creating a voice pack for a game is very onerous, simply in the admin of matching huge numbers of speech files to text in the game. Perhaps another option is some kind of matching system that uses MP3 tags or filenames to match against speech lines semi-automatically. Or even word-based speech files.
Navigation
[0] Message Index
[#] Next page
Go to full version