I am using the MediaRecorder
api to record audio. The user can trigger an event that will in turn call the MediaRecorder.requestData
method. The problem that I'm having is that only the first Blob is playable and I need all the Blobs to be playable.
I read in the W3 spec that this is the expected functionality:
The UA MUST record stream in such a way that the original Tracks can be retrieved at playback time. When multiple Blobs are returned (because of timeslice or requestData()), the individual Blobs need not be playable, but the combination of all the Blobs from a completed recording MUST be playable.
I was wondering what data is actually missing from the Blob object and can I manually append the missing data to make the Blob playable.
I cannot create a new MediaRecorder
instance since in the time it takes to create a new instance and start recording it may miss the user's recording and I need to be able to store a single audio file in the server.
So to summarize, I need to be able to split a single Audio Blob into multiple Blobs and manually insert the data necessary to make each blob playable and then recombine all the Blobs into a single Blob and reupload to the server.
Thanks