cinera_handmade.network/cmuratori/hero/code/code142.hmml

33 lines
3.0 KiB
Plaintext

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Per-sample Volume Interpolation" vod_platform=youtube id=XxReVrByBYw annotator=ZedZull annotator=Miblo annotator=debiatan]
[00:00:46][Plan for today]
[00:02:07][Dynamic asset streaming and audio mixing didn't take that much code]
[00:03:37][Public service announcement: Sometimes, writing your own code is faster than reusing other people's code]
[00:05:56][Some differences between audio and video animation and their effects on sound mixing architecture]
[00:09:55][We want to change volume over time, while avoiding discontinuities]
[00:12:53][Definition of the interface to ChangeVolume]
[00:14:03][Two ways of specifying speed of volume change: time it takes to reach target volume vs rate of change]
[00:21:20][Using dimensional analysis to figure out dVolume]
[00:30:50][Changing resolution back to 960x540 to remain in debug mode at a reasonable framerate]
[00:34:30][Avoiding overshooting the target volume]
[00:44:28][Problem of current approach: repeated imprecise floating-point addition may lead to errors]
[00:45:25][Alternative approach: linear interpolation between beginning and end volumes]
[00:46:42][Alternative approach: backsolving to hit the target volume at the end of the loop]
[00:48:11][Testing ChangeVolume interactively]
[00:53:08][Q&A]
[00:53:49][@constantinopol][Can you show again how you skipped a failed assertion, by going to disassembly?]
[01:00:10][@swampy_butt][Would there be any case where you would like to increase volume non-linearly?]
[01:02:01][@flyingsand][So far you can just change the volume of individual sounds. Should we be able to change the volume of the master output as well?]
[01:03:26][@chronaldragon][Will Handmade Hero support spatialization? e.g. sound mostly in left channel if on left side of the screen, sound mostly in right channel if on right side, etc.]
[01:04:03][@rpg_ignis][How hard would it be to do a fade-out/fade-in for the music when the window loses focus/gets focus back?]
[01:05:09][@gasto5][So what did you end up doing to dVolume if it wasn't linear interpolation?]
[01:05:28][@waterlimon][If you implemented Assert using ?: instead of if, you could use it as part of expressions or other such places where you can't have an if statement]
[01:06:15][@gasto5][Did you already implement audio clipping?]
[01:07:34][@gasto5][(clarification) Managing audio dynamic range. Yes]
[01:08:04][@waterlimon][With respect to Assert, I don't know why you would want to put one in an expression, but apparently that's how it's usually implemented... It can't hurt, right?]
[01:09:45][@flyingsand][You can't just hard-clip audio, though. If you don't use a compressor/limiter you would have to at least use soft-clipping with tanh or something]
[01:10:12][@gasto5][Will you implement audio file compression?]
[01:11:35][@abnercoimbre][What would an audio compressor do?]
[01:13:45][@gasto5][How much optimization would the mixer require?]
[01:14:21][@javajax][What is the difference between a limiter and a compressor?]
[/video]