is presently its sole maintainer,
You can support him:
Recap and set the stage for the day
handmade.h: Introduce playing_sound and add a pointer to it in game_state
handmade.cpp: Setup the PlayingSound loop
Blackboard: Working in a 32-bit depth mixing buffer
handmade.cpp: Introduce RealChannel0 and RealChannel1
handmade_asset.h: Introduce loaded_sound
handmade.cpp: Call loaded_sound and sum the Samples in our loop
handmade.cpp: Loop over the summed sounds, read out of them and write them to the SampleOut buffer
handmade.cpp: Introduce SamplesToMix and SamplesRemainingInSound to handle the finite nature of the audio
handmade.h: Add playing_sound *FirstFreePlayingSound to game_state
handmade.cpp: Use that FirstFreePlayingSound in the PlayingSound loop
handmade.cpp: Snap the Next pointer earlier in order to protect against the act of having it freed screw up our iteration
handmade.h: Introduce the concept of a MetaArena
handmade_asset.h: Add audio assets to asset_type_id
handmade_asset.cpp: Extend the asset loading to handle audio
handmade_asset.cpp: Introduce AddSoundAsset
handmade.cpp: Make the new system emulate what we had at the start of the stream
handmade_asset.cpp: Introduce GetFirstSlotID and various Get functions for Bitmaps and Sound
Debugger: Step through the asset loading code
handmade_asset.cpp: Set the SoundCount to be 256 * Asset_Count
Debugger: Inspect GameState->FirstPlayingSound
handmade_asset.cpp: Turn it up to full blast
Debugger: Step into LoadedSound
build.bat: Switch to -O2 and run the game
handmade.cpp: Introduce PlaySound
Run the game and hear our sound
handmade.cpp: Call PlaySound upon triggering the Sword
handmade.h: Add random_series GeneralEntropy to game_state
Run the game and find that it almost works
handmade.cpp: Investigate the bug
Blackboard: Linked list
handmade.cpp: Correctly construct this linked list
Debugger: Step through the playing_sound linked list
handmade.cpp: Reset SamplesPlayed to 0 in PlaySound
Run the game and hear our sound
robrobby Q:Is the sound buffer logarithmic or linear (decibel or linear values) and do we (have to) account for that in building the sums for the buffer?
allgamesnetworkvideo Q: Do you already have someone composing the soundtrack?
tfnw Q: A reminder about the parameter order in InterlockedIncrement and the bug it covers up
handmade_asset.cpp: Handle the case when BeginTaskWithMemory in LoadBitmap fails
flaturated Q: When mixing a mono sound to stereo, volume of each channel should be 50% for center panned
soysaucethekid Q: Will this audio code allow you to play the same sound simultaneously (i.e. if you start the same sound before it finishes the first time)?
tfnw Q: The second and third parameters in the compare and swap
handmade_intrinsics.h: Swap those parameters in AtomicCompareExchangeUInt32 and then swap them back and instead change the funtions where it's called
soysaucethekid Q: The audio seems to be frame rate dependent at the moment. Could putting it in a separate thread or using interrupts (if you can), make it not frame rate dependent?
tfnw Q: Would you mind adding a __sync_val_compare_and_swap(Value, Expected, New) for gcc / clang
handmade_intrinsics.h: Add tfnw's suggestion
handmade.cpp: Play the music instead of the bloop, to demonstrate playing the same sound simultaneously
robrobby Q: So why does it work?
Blackboard: Separating asset data from instance data
cubercaleb Q: Why use a linked list as opposed to another data structure like a vector?
waterlimon Q: But can you take the output of the sound summer mechanism and play that?
Go ahead and call it