Audio Delay Bug Might Be Windows?


https://twitter.com/AndrewNReinke/status/1455232134658945032 here's a video to understand what i'm talking about.

Basically, I am unsure if it's really my end on audio mixing anymore or not. See, I added code today that does the audio mixing in a realtively smart fashion when compared to the system I did yesterday. That is that I now just accumulate the clips that should play for a given frame and then add them all up in a 32 bit floating point buffer (so converting from signed 16 bit integers) which will actually create the proper effect of two audio effects overlapping.

I still haven't tried to consider that some clips maybe should go later in the 32 bit floating point buffer before converting back to the signed 16 bit Windows destination buffer (so like if a clip should be played later in the frame, start at some offset in the output audio buffer so if output buffer size is 800, start at index 400 if later or something like that) but am unsure if this will solve the problem. Really would only know if I tested it but by "logical reasoning" I don't think this makes sense as I don't see how maybe being like 2-3 miliseconds delayed would really make much of a difference for the frame's 16 miliseconds of output audio.

I guess the next step is to look at other audio apis on Windows / look into the current one i'm using and really diagnose if it's the problem or if i'm still somehow the problem despite mixing the audio correct to my current knowledge (again, doing the audio mixing by adding multiple waves to the dest buffer where dest starts from its start each time as the N clips do, only other thing is that delay thingy but stilllll).

Anyways, this has been more of a "me writing my issue" out so I guess if anything, this describes the my current solution to getting audio mixing but also the way i'm going about solving this current bug. It's not very effective unfortunately :]

Thank you for reading and please let me know your thoughts on the current build like does the audio play fine on your PC? Have an awesome day!

Files

Funmi_Zip.7z 3 MB
Nov 01, 2021

Get Funmi

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.