katspaugh / wavesurfer.js

Audio waveform player
https://wavesurfer.xyz
BSD 3-Clause "New" or "Revised" License
8.85k stars 1.64k forks source link

Poor audio recording quality when there is another audio playing simultaneously. #3852

Closed Gsouzabd closed 2 months ago

Gsouzabd commented 2 months ago

Hi everyone! So, im working on a project with wavesurfer and record plugin.

We render an wavesurfer to a video and the record plugin works on mic wave.

During our recording tests, we've noticed that the audio was not building or recognizing voice, and sometimes recognizing like a robotic voice. So, I setted the video container as:
wsVideo.setVolume(0); And It worked perfectly.

But this system is focused on dubbing training. So, the user needs to hear the video audio. We need to:
wsVideo.setVolume(1);.

Does anyone have any idea on how could we solve it?

-- thanks

katspaugh commented 2 months ago

I don’t think anything can be done here from wavesurfer’s perspective. Ultimately it’s the browser’s APIs that do the playback and recording. Wavesurfer only renders a waveform.

You could try playing the video via Web Audio as a workaround. This might or might not help. Like in this example but with backend: 'WebAudio': https://wavesurfer.xyz/examples/?video.js