I’m using FMOD to create a custom voice chat system for UE4, and part of this is encoding and transfering the sound data over the network. So far, I’ve studied the low-level examples of FMOD and I’m successfully recording data into a stream.
I’m not too savvy when it comes to audio data and codecs, so I hope someone can point me in the right direction doing the following things:
Like in record.cpp, I’m recording the mic’s sound into a FMOD::Sound. I wish to encode this data using the Opus codec. UE4’s opus encoder initializes by passing it a sample rate and the number of channels, both of which are known from the recording device. For the encoding itself it needs:
const uint8* RawPCMData
Is this what I get from FMOD::readData? How do I know how many bytes to read from my FMOD::Sound? I want to read the latest added recording data. (So, recordDelta in record.cpp)
After I have my encoded data, do I have to decode it or can FMOD play encoded Opus data?
Thanks for the help!