This PR fixes a bug with os.beginAudioRecording when set to stream: true and a mimeType of anything other than audio/x-raw.
Previously MediaAudioRecorder was providing empty Blob data to @onAudioChunk when running the MediaAudioRecorder with stream: true and an audio encoding format (ie mimeType: 'audio/webm'). The fix is to provide the buffer rate to the recorder's start() function which accepts a timeslice argument. When timeslice is provided, the recorder's dataavailable event gets triggered properly and @onAudioChunk gets the Blob chunks as originally intended.
Another alteration included in this PR is to await the finalBlobPromise before invoking dataAvailable.complete(). This gives the recorder time to stop and call its final dataavailable event with the remaining Blob data before finalizing and cleaning up.
This PR fixes a bug with
os.beginAudioRecording
when set tostream: true
and amimeType
of anything other thanaudio/x-raw
.Previously
MediaAudioRecorder
was providing emptyBlob
data to@onAudioChunk
when running theMediaAudioRecorder
withstream: true
and an audio encoding format (iemimeType: 'audio/webm'
). The fix is to provide the buffer rate to the recorder'sstart()
function which accepts atimeslice
argument. Whentimeslice
is provided, the recorder'sdataavailable
event gets triggered properly and@onAudioChunk
gets theBlob
chunks as originally intended.Another alteration included in this PR is to await the
finalBlobPromise
before invokingdataAvailable.complete()
. This gives the recorder time to stop and call its finaldataavailable
event with the remainingBlob
data before finalizing and cleaning up.