SUGGESTION: Music and Sound Rework

Started by Shane 'ProgZmax' Stevens, Tue 23/09/2008 07:39:59

Previous topic - Next topic

Shane 'ProgZmax' Stevens

I remember reading back to threads as old as 3 years ago where CJ acknowledged that the music and sound system is rather kludgy and could do with a redesign, and lately it's become more obvious to me that this is true, particularly when I designed an options menu with sound/music control. 

For one thing, you cannot, as far as I can tell, completely disable music with a setting as of now, which means that even if you have SetMusicMasterVolume at 0 (which barely affects the music, anyway) music will play when you switch rooms unless you create a custom variable that tracks whether the music should be on or not and then manually turning it on in the room's before fade in function.  Likewise, there's no Game.Sound=true/false setting, though sound is much easier to adjust the natural volume of (and it stays the same each time you change rooms).

The main suggestions I have are:

A)  There should be a way to completely disable music and sound via a single variable that is checked prior to entering a room for the purposes of custom audio settings (Game.Music, Game.Sound).

B)  SetMusicMasterVolume is, quite honestly, almost useless because each room has its own much more prevalent sound setting.  If you have a room at anything above normal volume, for instance, setting the MasterVolume to 0 will not eliminate the music entirely, and that just makes no sense.  The MasterVolume, in my view, should be able to override the room settings enough that there is a smooth transition from loud to silent for each of the room settings.  I realize the individual room volume settings are necessary and useful for ambience, but isn't there a better way these two settings could work together?


These two are probably the most important points for improving how music works but I'm sure other people have different things they'd like to see improved.  Thanks!

Pumaman

Quote from: ProgZmax on Tue 23/09/2008 07:39:59
I remember reading back to threads as old as 3 years ago where CJ acknowledged that the music and sound system is rather kludgy and could do with a redesign

I did indeed, and I still do.

As always, it's a matter of priorities. Now that 3.1 is dealing with hi-res co-ordinates and the dialog system, hopefully there should be some time to look into these other things in the next version.

Dualnames

Can't agree with you more, but how about allowing to bundle music vox and speech vox along with the exe. If we want to? Like sound files are compiled along with it.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Adamski

I'd say getting rid of the 'each room has it's own music volume' thing would be a good move, as it's a very odd feature. It never really makes sense to change the music in that way, as it can totally unbalance a mix. I've got a simple ENTER_ROOM thing in the global script that automatically sets the volume to 'very high', as that seems to be the only setting that plays the music back at the 'correct' volume of my oggs without any needless attenuation!

Shane 'ProgZmax' Stevens

Well, as I mentioned in my post, individual room volumes are very useful for ambience settings.  For instance, if you want a room that's off to the side from the main room where some music is blasting from a radio, it's trivial to set the volume down as of now.  Without individual room volumes you'd have to tweak the main volume when you entered the room and again when you left (or master your audio at different volume levels).  Unless there was a PlayAmbientMusic setting, of course, but I find that PlayAmbientSound isn't terribly reliable because of the way it uses the room numbers as a way to establish 'distance' from the source.

Thanks for giving this a look, CJ!

Shane 'ProgZmax' Stevens

#5
Oh, one other thing I forgot to mention:  it's probably time that the sound number you choose to play on a specific frame in the view editor worked for all supported sound files and not just wav :).  Also, it would make me love you more than I already do!

Pumaman

Quote from: ProgZmax on Thu 09/10/2008 03:19:35
it's probably time that the sound number you choose to play on a specific frame in the view editor worked for all supported sound files and not just wav :)

There's no such restriction on frame sounds, so I'm not sure what you're referring to here?

Shane 'ProgZmax' Stevens

Some of my oggs don't play when set in a view, though if I convert it to a wav it does.

Pumaman

Do they play if used as a normal PlaySound sound effect? Can you post an example?

Shane 'ProgZmax' Stevens

#9
Sure, here are some examples:

http://www.mediafire.com/?55gr1smbysk

Both sound11 and sound12.ogg play fine in everything I have (media player, winamp, even the audio manager in ags) but not in the game.  Many of the other files I converted to ogg do, though (I just use batch conversion in dbpowerconverter).  It seems to especially affect small samples.  The waves I've included play fine as they are in ags, but when I convert them to ogg they do not.

Also, I realize these are small enough that I don't really need to worry about conversion, but when you have as many sounds as I do it's mainly a matter of just wanting to select a group and convert them all, and since they play fine in everything else I use I don't see why it should be a problem :(.

I've had this happen several times in the past as well, both with converting waves to mp3 and ogg.

I've included the wav and ogg versions of sound0-6 because none of these seem to want to work when converted (they work fine in wav form).  I've also included sound7-10 in ogg as an example of some that work fine.

I'm thinking it could be some kind of length issue, though.  Ogg has a tendency to prune a bit when it converts, eliminating 0-volume space at the end of a sample.  I'm not sure how that would impact PlaySound, but it's all I can think of right now.

Pumaman

Thanks for uploading those. I tried them out, and do get the same problem. However, most of them won't even play for me in Winamp, so it's not necessarily just an AGS thing.

I think it is related to the sheer length of the sounds; I think it might be to do with if the sound effect isn't long enough to fill up the 16 KB sound buffer it just doesn't play at all. I'll continue to investigate, but yes adding a small bit of silence either side of the sound should sort it out.

naltimari

What about music stuttering? Is it still an issue, or has it been sorted out? At least in my game, it still happens when entering rooms, especially the first (at game start).

Shane 'ProgZmax' Stevens


Did you have winamp set on repeat, CJ?  I admit some of the sounds are just simple beeps or booms, but winamp plays everything in that rar just fine for me.  At any rate, I've added some space to the end of two of the offending oggs via Goldwave and I've noticed something:

A stretch of silence as short as .1 second is enough to make them work in AGS.

Is it possible that the lack of silence at the end of some of these is the cause rather than their overall length?  I've had some larger sounds fail to work in PlaySound before as well, and once converted to ogg they have a tendency to be stripped of any silence at the end of the sample.  Does PlaySound check for silence at the end of samples to determine if they have ended, for instance?  If so, it might explain why some of these converted samples won't play while the originals do, and why these oggs will suddenly play again when given a very brief silence at the end.  It could  still be length related I suppose, but .1 second hardly adds anything to sound11's play length (although it practically doubles the play length of sound12).

Pumaman

QuoteWhat about music stuttering? Is it still an issue, or has it been sorted out? At least in my game, it still happens when entering rooms, especially the first (at game start).

I'm never sure about this, because I keep thinking it's fixed because nobody complains about it for a while, and then discover that actually it's not fixed.

But as far as I'm aware there should be no stuttering in 3.1 RC 1 (I did some work on it in a recent beta).

QuoteDid you have winamp set on repeat, CJ?  I admit some of the sounds are just simple beeps or booms, but winamp plays everything in that rar just fine for me.  At any rate, I've added some space to the end of two of the offending oggs via Goldwave and I've noticed something:

Hmm, if I set it on repeat it does seem to play the sound; but if I turn off repeat it won't play anything. Looks like it's too short even for Winamp!!

QuoteIs it possible that the lack of silence at the end of some of these is the cause rather than their overall length?

It's possible, I'm not totally sure. AGS uses an external OGG playing library which I haven't studied in depth, but it could be either the length, the silence or possibly the file size (ie. bitrate) of the file.

Shane 'ProgZmax' Stevens

Thanks for giving it a look, anyway!  Adding silence to the ones that don't work is an acceptable solution for me. 

SMF spam blocked by CleanTalk