Audio recording preview not working
Hi,
I'm trying to create a preview for both audio and video recordings. The video preview works fine but the audio preview doesn't enable the autoplay property, so you've no feedback for the audio recording. I assume that this might be because the MediaStream object is not active (it has the property active: false) even though the recording seems to be active as when I stop the recording the blob is available.
Any hints? Have you ever implemented the audio preview does it work for you?
Regards, Bogdan
Created a PR - #54 to preview audio, the previewStream currently only gets the video tracks, so added a previewAudioStream that does the same thing as previewStream but just for audio.
@HBM08 that is by design. It's mentioned in the docs too
Please note that this is a muted stream. This is by design to get rid of internal microphone feedback on machines like laptop.
I just wanted to avoid an unexpected feedback from the internal mic. It would create such a mess 😁
@gezquinndesign thanks for the PR, it does just what it says. Awesome! but having two APIs for the stream is will lead to confusion I guess previewStream and previewAudioStream.
What do you guys think?
If we only want one way to access the stream in its entirety, then we will have to remove the limitation that is brought about by only returning only the VideoTracks, perhaps we can make it a function with defaults?
getPreviewStream({audio: boolean = false, video: boolean = true})
and return the appropriate altered MediaStream based on the options provided.
Or just return the MediaStream without altering it and warn users to ensure that the audio needs to be muted if using it for a video preview.
As it stands, I don't think it causes too much confusion having 2 separate APIs (previewStream and previewAudioStream) for the stream. It's just an opt-in addition and will ensure there are no breaking changes if people choose to upgrade.
Maybe there's a case for renaming previewStream to previewVideoStream to avoid confusion.
@0x006F I can alter the PR depending on what you think is best.