Hello, I’m making voice chat for a game. It’s ready and working, but the size of the transmitted audio is very large: when testing audio with 3 simultaneous players, it is about 300 kilobytes per second, and the audio is already compressed in half using a third-party library.
Are there any tips or tricks to reduce the size of the transferred data? I transmit raw sound, as soon as the recording position of the microphone changes, the number of transmitted samples depends on fps (the lower the fps, the larger the size of the transmitted frame with samples).
In the Unity audio system, the transmitted frame with samples was always fixed, for example 1024 samples, but I have no idea how to achieve the same using fmod.
Reducing the sampling rate causes significant audio deterioration. For example, my microphone has a frequency of 48,000 hertz, and if you reduce it to 16,000 hertz, the sound will deteriorate very much, which is unacceptable for me. In this case, a microphone that has a frequency of 16,000 hertz will have a better sound than another, but reduced from 48,000 hertz to 16,000 hertz.
Can I get you to elaborate on your exact setup here? How are you extracting the audio from (presumably) your FMOD System? I recall from a previous post of yours that you were using sound.lock and sound.unlock - are you calling these in MonoBehaviour.Update(), MonoBehaviour.FixedUpdate(), or somewhere else?
What format is the recorded audio in when it’s (presumably) retrieved from your FMOD System? i.e. sample rate, bit depth, number of channels, etc.? If you’re not using lossy compression, I would recommend using it instead of lossless. Also, if the microphone audio is attenuated in game (e.g. by spatialization, or some other means), I would recommend optimizing it out of your network stream if you’re not doing so already. If it’s not spatialized, you may be able to sum the individual audio streams.
Is this an issue with FMOD specifically, or an issue with the 3rd part library you’re using to compress the recorded audio?