Streaming Audio Update
The latest PegPuzzle versions for D3D11 and D3D12 feature streaming background music as well as some other updates to reduce memory. The approach I took for audio streaming was to have two buffers that can contain one seconds worth of audio data. I move through the background music file reading one seconds worth of data on a separate thread and ping pong between the two buffers. One buffer is being read by XAudio2 and the other is having file data written to it. It was pretty cool to get it working; however, I also spent a lot of time testing and fixing various edge cases. In particular, I needed to make sure that what I implemented was tolerant of failed file reads, short file reads (less data was returned than was requested), and longer than expected file reads. If you're interested in learning more about streaming audio, you can check out:
- https://docs.microsoft.com/en-us/windows/win32/xaudio2/how-to--stream-a-sound-from-disk
- https://bell0bytes.eu/streaming-music-with-xaudio2/
If you have any questions, feel free to leave a comment.
Get Peg Puzzle
Peg Puzzle
A casual puzzle game
More posts
- Peg Puzzle AvailableOct 12, 2019
- Unity VersionOct 03, 2019
- Brief Update 2Oct 03, 2019
- Brief UpdateAug 31, 2019
- First Pass: SkyboxAug 10, 2019
- Physically Based RenderingAug 08, 2019
- First Pass: ShadowsAug 04, 2019
- First Pass: Planar ReflectionsJul 20, 2019
- First PassJul 18, 2019
Leave a comment
Log in with itch.io to leave a comment.