Day 25: No zero days November – 2023

Again 1 day late ^^” But here is the report!

Audio still not working

So after my short morning of trying to fix audio importing, I reached no real conclusion of why the audio wasn’t working, no more allien voices, only malloc errors.

This could be because swr_convert is not working correctly, maybe PackedByteArray is not resizing correctly, maybe the conversion to 8 bit is causing problems, … I have no idea what the problem is right now.

Possible solutions

Whilst cleaning the air conditioners yesterday I tried to think of possible solutions (took a lot longer than I thought and I wanted to use my head whilst cleaning :p). Possible solutions are:

  • Don’t convert the data, but convert the frame; (This will give a small performance decrease, but this is only when importing the audio. We could have an argument which only loads the video frames, or video + audio. We would just keep audio in memory as it is not as big as frames.)
  • Use a Vector instead to see if the PackedByteArray is causing the issues; (Would also decrease performance slightly as we are not directly putting the data in the PackedByteArray, but this would be more as a test to see if the PackedByteArray is at fault here.)
  • Just write the audio to an audio file, put that file in cache and we are done; (Easiest solution, but will cause for more storage needed + more writes to disk making performance slower compared to the above mentioned)

Conclusion

Some things to test out came up in me, I’ll go through my list which I made yesterday and hopefully I can get this working by the end of today, or at least by the end of this month hahah. When this part is done all further progress for version 1 will be done inside of Godot with GDScript. I may make wrappers around certain FFmpeg functions/structs to move more of the code over to GDScript instead as I noticed that there is no noticeable delay in function call time. But Looking forward to a GDExtension break. :p

I think I am still sleepy

What just happened first blew my mind and then I figured out I am an idiot. Suddenly the video and audio was playing correctly at the correct speed and everything. I was surprised and asking myself HOW. I had not even implemented to play the frames at the correct frame rate … Turned out I opened the video file instead of the project hahaha ^-^”

I made my plans for today on how I plan on fighting this audio issue which I’ve been having. But I do have a lot of other work to do as well today so it will have to wait for the evening. Because of No zero days November I have been postponing a lot of other work which is starting to become an issue. ^^”

I’ll be glad when November is done but that isn’t to say that I have any regrets of doing this challenge and I’m happy with the progress made so far. I have enjoyed writing the daily logs as well as it helps me to reflect more on what I achieved, what needs work, and how the overal day went 🙂