2020-05-09 20:59:36 +00:00
[video output=day138 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Loading WAV Files" vod_platform=youtube id=RSxUBaoomy0 annotator=Miblo annotator=debiatan]
2017-12-06 22:26:13 +00:00
[1:06][Assets: handmade_hero_test_assets_003.zip is released]
[2:57][handmade_asset.cpp: Correct a mistype in WAVE_fmt]
[4:27][handmade.cpp: Do a DEBUGLoadWAV call in GameUpdateAndRender]
[5:20][Debugger: Step in to DEBUGLoadWAV]
[6:09][Fall foul of Microsoft Visual Studio][quote 120]
[7:33][handmade_asset.cpp: Introduce riff_iterator to use in DEBUGLoadWAV]
[10:28][handmade_asset.cpp: Add WAVE_ChunkID_data to RIFF_CODE]
[11:59][handmade_asset.cpp: Continue on writing the usage code for DEBUGLoadWAV]
[13:07][handmade_asset.cpp: Introduce ParseChunkAt]
[13:54][handmade_asset.cpp: Introduce NextChunk]
[15:49][handmade_asset.cpp: Introduce IsValid]
[16:38][handmade_asset.cpp: Continue on writing DEBUGLoadWAV]
[17:25][handmade_asset.cpp: Introduce GetChunkData]
[18:44][Debugger: Step in to DEBUGLoadWAV]
[21:56][handmade_asset.cpp: Remove Chunk from riff_iterator and ParseChunkAt, and instead use it in NextChunk and GetType]
[22:41][Debugger: Continue on stepping through DEBUGLoadWAV]
[23:28][Internet: Try and determine whether the RIFF file should end in zeros]
[26:50][handmade_asset.cpp: Pad the Chunk->Size if it is odd]
[27:45][handmade_asset.cpp: Subtract 4 from the Header->Size]
[28:41][Debugger: Step through DEBUGLoadWAV and find that we're correctly iterating over the chunks]
[29:09][handmade_asset.cpp: Assert certain data to be valid]
[30:08][Internet: Find out what nBlockAlign means]
[31:17][handmade_asset.cpp: Assert nBlockAlign to be 2 * nChannels]
[31:48][handmade_asset.cpp: Set the ChannelCount and SampleData]
[32:49][handmade_asset.cpp: Assert ChannelCount and SampleData to be valid]
[33:41][handmade_asset.h: Add ChannelCount to loaded_sound]
[34:27][Internet: Try to establish how to determine the sample count minus any rounding]
[34:59][handmade_asset.cpp: Compute that SampleCount]
[35:45][handmade_asset.cpp: Introduce GetChunkDataSize]
[36:32][handmade_asset.cpp: Create arrays for our SampleData]
[37:57][Blackboard: Deinterleaving audio channels in place]
[44:15][handmade_asset.cpp: Write out the swizzling algorithm for the left channel]
[46:39][handmade_asset.cpp: Spam in some test data]
[49:01][Debugger: Check out the values in the right channel]
[50:47][handmade.cpp and handmade.h: Reenable tSine]
[52:08][handmade.h: Introduce loaded_sound TestSound]
[53:11][handmade.cpp: Comment out GameOutputSound and use TestSound]
[55:22][Run the game and hear that it doesn't sound very good]
[56:02][Debugger: Step through the SampleIndex loop]
[56:48][handmade.cpp: Make the Sample data be int16]
[57:27][Run the game and still hear the clicking]
[57:50][Listen to the sound]
[58:41][handmade.cpp: Read through the SampleIndex loop]
[59:37][Debugger: Step in and inspect the SampleData]
[1:01:04][Internet: Take a look at PCM Data]
[1:01:58][handmade_asset.cpp: Remove the test code]
[1:02:29][Run the game and hear it more correctly]
[1:02:42][build.bat: Switch to -O2]
[1:03:09][win32_handmade.cpp: Set GameUpdateHz to MonitorRefreshHz / 2.0f]
[1:03:21][Run the game and hear it all playing correctly]
[1:03:59][handmade.cpp: Play music_test.wav]
2018-03-07 21:48:09 +00:00
[1:04:16][Q&A][:speech]
2017-12-06 22:26:13 +00:00
[1:04:45][@robotchocolatedino][You could try uninterleaving the channels in place like this: http://imgur.com/ZcDu4Tb]
[1:05:50][@pseudonym73][Probably the second-easiest way to deinterleave is multi-pass. Swap R0/L1, R2/L3, L4/L5 etc. Then do the same with two-sample blocks, four-sample blocks, etc. Easiest way is to deinterleave directly into mix/output buffer.]
[1:06:18][@desuused][Why do you need to un-interleave sound? When you play it, you still have to read both left and right values]
[1:06:39][@abnercoimbre][People are asking about the benefits of extern C? What issues does it address?]
[1:08:43][@constantinopol][Casey, can you please explain: (Chunk->Size + 1) & -1 ?]
[1:14:14][@popcorn0x90][Why are the samples interleaved and not flat?]
[1:15:18][@marumoto][If you think of your interleaved data as an Nx2 matrix, then transposition can be viewed as interleaving. Here is an in-place way to do it: https://goo.gl/fgPmrg]
[1:16:08][@rpg_ignis][Thank you]
[1:18:05][@pragmascrypt][Why do you want to change the PCM data in place instead of compacting it to just the information you need and allocating extra space?]
2018-03-07 21:48:09 +00:00
[1:19:09][Wrap it up][:speech]
2017-12-06 22:26:13 +00:00
[/video]