Google text to speech returns the output audio as base64 string. I want to save that string into firebase storage. The following code saves the sting as base text not as binary and so not playable. This could is written in a Firebase cloud function.
let buffer = Buffer.from(audioRespose.data.audioContent);
let file = storage.bucket("bucketname").file("audio7.mp3");
await file.save(buffer, {
metadata: { contentType: "audio/mpeg" },
public: true,
}).catch((errSave) => {
response.status(500).send(errSave);
return;
});