◀ Back
Specialization
https://felipefleming.itch.io/rockin-rodents
Goal
The Goal was to create a voice chat using winsock. If the time allowed it I would then make it proximity based, and maybe even use a raytracer to take walls into consideration.
Process
I started with trying to find a a good library to record, and playback, audio. I settled with FMod since that's a Library that I have some experience with. It would also simplify the proximity part. The goal with FMod was to then extract raw data, in form of a char pointer, and then send it to another client for playback.
I started by looking at FMod's example for recording. It was pretty simple to understand the code for recording. I created my own version of it  and played around with it. I quickly noticed that the size of the data I extracted was quite big with the microphone I was using, since I wanted to avoid my packages being bigger than 512 bytes, That was to go around the need to send Acknowledgements. A simple solution to this was to just limited the recording frequency to 16000 Hz and the channel count to one. Doing this did decrease the audio quality a bit, but not to a degree that it would be jarring to the ears.
 
For the playback I experimented with using the unlocking of a sound to feed in new data, but i never got it to work. I settled with just releasing the current sound and then creating a new one with the data i recieved.
Result
The result was, sadly enough, way too subpar. While I am able to get the data of the sound and send it through winsock for playback, the sound that plays back, even if I skip the network part and just play it on the same device, is not right. From what I can hear, the sound that plays seems to be slower and more robotic, and since the audio is slower, it also means it gets cut-off before the whole sound is played.
I tried increasing the frequency of the sound, but that only made it so that my voice became more high pitched, which was a expected biproduct.
The code I wrote can be downloaded here, it is not finished but if someone who is better than FMod had a look at it, they might be able to solve it. That's why I'm letting this code be "open-source", meaning that anyone can use and edit it however they want without crediting me.
Link To Download
Reflection
While the result was up to the standard of voice chat, I'm still not quite sure what I would do if I ha more time. The only theory I have is that FMod does something with the sound when it's exported or imported. Aside from that I would say that the logic that I used was quite sound.