I'm uploading the file in Fire Storage as an Float32Array, but in order to play it, I have to have it converted either before storing it to firebase to mp3, wav or ogg or after i get the download url. I chose the 1 option, using Lame.
let mp3Encoder = new lamejs.Mp3Encoder(1, 44100, 128);
let in16Array = Int16Array.from(audioData); //audioData is a Float32Array containing the recorded audio buffer
var mp3Tmp = mp3Encoder.encodeBuffer(in16Array); //encode mp3
//Push encode buffer to mp3Data variable
this.mp3Data.push(mp3Tmp);
//Get end part of mp3
//mp3Tmp = mp3Encoder.flush();
//Write last data to the output data, mp3Data contains now the complete mp3Data
this.mp3Data.push(mp3Tmp);
const blob = new Blob([this.mp3Data], { type: 'audio/mp3' });
However in firebase it is not uploaded as an mp3
const id = this.i + Math.random().toString(36).substring(2) + ".mp3" ;
this.ref = this.afStorage.ref(id);
this.task = this.ref.put(blob); //code for uploading
Any advice what should i try next?