Audio Bug Found?


Today I spent the first little bit of my time really making sure that I understood audio processing on computers.

From what I gather, you basically legit (even thought I kinda mentioned this before but am now more confident in saying this) have 48,000 samples per second that you NEED to write. Per game frame, you'll need to dice that up into the 60 or 30  chunks that you need to submit to the OS you're running on (or actual hardware depending on what you're working on (could do this on the Raspberry PI bare metal)).
In my case, 800 audio samples per frame.

Another thing to relate this to is how you're running at 60 frames per second because you want to give the illusion of motion. So you submit 1 image that's produced within 16.6 milliseconds and if always met on time, will give that illusion of motion.

So 60 hz 1 per frame = good illusion of motion.

48000 hz 800 per frame = good / perfect(?) replication of audio so the human brain can't tell anything is off or wrong.

Anyways, to get onto why I discovered the bug is maybe solved is that I figured out that the Windows side of things said it had no latency issues and I also found out that I seem to be providing it with more than enough audio samples per frame (it seemed to want 10 miliseconds worth per frame where i'm giving it 16.6 milliseconds worth so the 800 packets which would also explain why sometimes when getting a new buffer from the WASAPI audio engine, I would only be able to fill 700 or so packets due to me technically overfilling which actually isn't that bad of a thing from what I can tell atm).

The problem is, that since I need to blend all 2-5 audio clips in the same frame, this is too much of a load it would seem for just one thread to handle. So i'm going to use my multithread code I wrote for the graphics here to see if I can get it so that each new audio sfx actually submits on time and sounds perfect! So i'm glad I actually got to some conclusion today because I thought I was going to continue being lost for a little longer lol. Here's a video to sum all this up: https://twitter.com/AndrewNReinke/status/1456317633628819458

Anyways, please tell me your thoughts on the game thus far! Thank you for reading and have a nice day :]

PS I did upload a gameplay video on the homepage as I needed to make one to see if the epic games store would take me or not so check that out if you're hesitant about playing the game to see how it roughly plays!

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.