Closed Psayker closed 5 months ago
The root of the problem is a directsound element from GStreamer that produce sound artifacts by itself. It can be reproduce by audio recodring and playback (num-buffers=2000
- is about 20 seconds):
$ gst-launch-1.0 -e directsoundsrc num-buffers=2000 ! audioconvert ! audioresample ! opusenc ! oggmux ! filesink location=out.ogg
$ gst-launch-1.0 filesrc location=out.ogg ! decodebin ! audioconvert ! audioresample ! autoaudiosink
Currently DirectSound is depretected. It seems no one is interested to fix this problem in gstreamer.
The successor of directsound element is wasapi - wasapisrc and wasapisink. The pipeline to test wasapisrc audio recording:
$ gst-launch-1.0 -e wasapisrc num-buffers=2000 ! audioconvert ! audioresample ! opusenc ! oggmux ! filesink location=out.ogg
There is no sound issues with this element. But capabilities are very limited. Also it is impossible to change volume level of the microphone directly from gstreamer.
The more advanced successor is a wasapi2src element. But it is not available in mingw environment and I don't know all characteristics. It is available starting from Windows 10.
The comparison of different audio recording elements from gstreamer: | characteristic | directsoundsrc | wasapisrc | wasapi2src |
---|---|---|---|---|
format caps | S16LE | only F32LE | both F32LE and S16LE | |
rate caps | any | only 44100 | any | |
channels caps | 1 or 2 | only 2 | any | |
can gstreamer change microphone volume level | yes | no | yes | |
sound artifacts | yes | no | unknown |
When make calls from windows outgoing audio steam can have sound artifact.