I am working on integrating OpenAI’s Text-to-Speech (TTS) API with Unreal Engine to get audio responses in binary format. I am receiving the binary audio data in a TArray<uint8>
format from FHttpResponsePtr,
specifically after calling OpenAI’s API requesting audio in WAV format.
My goal is to take this binary data and convert it to a USoundWave
object so that I can play it back in Unreal Engine using PlaySound2D
. I want to avoid using any paid plugins and work with the built-in Unreal Engine functionality.
Here is what I currently have:
- I am able to receive the
TArray<uint8>
audio data from the API call. - I want to stream or convert this audio data into
USoundWave
in a way that allows it to be played directly within Unreal Engine.
Questions:
- How can I efficiently convert the
TArray<uint8>
audio data fromFHttpResponsePtr
into aUSoundWave
? - What would be the most suitable audio format (PCM, WAV, etc.) to request from the API that can easily be converted to
USoundWave
without needing external plugins?
Thanks in advance!