'Convert Array of Base64 Strings to Audio file

I am using a ESP32 with a inmp441 device to send audio via bluetooth. The esp is sending float values converted to std::strings so they can be read as Base64 over bluetooth. I am able to receive the Base64 values and I store them in an array like so

base64Array = ['LTMwMi4xMjUwMDA=','MzkyLjM3NTAwMA==','MTY3My4zNzUwMDA=', ...]

Here is my questions, to create an audio file like mp3 or wav, do I need to encode all of the Base64 string in the array back to ASCII then concatenate them together and then decode them back to Base64 to get one long Base64 string. Or can I write every Base64 value in the array to a file (creating a new line for each value) and save that as an audio file?

I am using react native to create an app and need the bluetooth device recording functionality.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source