kapoorlakshya/screen-recorder

Trying to record the output audio along with video

Rajagopalan-M opened this issue · 0 comments

I want to record the output audio which comes out of the speaker, but I don't know how to do it. There are the recorders are available in my machine.

I ran this comment ffmpeg -list_devices true -f dshow -i dummy and found the following devices

[dshow @ 000001b4f22a92c0] DirectShow video devices (some may be both video and audio devices)
[dshow @ 000001b4f22a92c0] "Integrated Camera"
[dshow @ 000001b4f22a92c0] Alternative name "@device_pnp_\?\usb#vid_04f2&pid_b449&mi_00#6&293a28f6&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 000001b4f22a92c0] "screen-capture-recorder"
[dshow @ 000001b4f22a92c0] Alternative name "@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}{4EA69364-2C8A-4AE6-A561-56E4B5044439}"
[dshow @ 000001b4f22a92c0] DirectShow audio devices
[dshow @ 000001b4f22a92c0] "Microphone Array (Realtek High Definition Audio)"
[dshow @ 000001b4f22a92c0] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{A934E8B8-8964-43B4-9F78-2743DEE6DB09}"
[dshow @ 000001b4f22a92c0] "virtual-audio-capturer"
[dshow @ 000001b4f22a92c0] Alternative name "@device_sw_{33D9A762-90C8-11D0-BD43-00A0C911CE86}{8E146464-DB61-4309-AFA1-3578E927E935}"
[dshow @ 000001b4f22a92c0] "Headset Microphone (Jabra UC VOICE 150a MS)"
[dshow @ 000001b4f22a92c0] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{F5273A14-3E0B-49B2-85FD-0310E87EFD44}"
dummy: Immediate exit requested

I have tried for microphone first, but it is saying file format is wrong, I used for MP4 AND WMV but both are throwing the same error. Here is the code I have written

advanced = { f: 'dshow', i: 'audio="Headset Microphone (Jabra UC VOICE 150a MS)"' }
if noOfThreads.eql? 1
ScreenRecorder.ffmpeg_binary = File.expand_path("VideoRecorder/ffmpeg.exe")
recorder = ScreenRecorder::Window.new(title: ScreenRecorder::Titles.fetch('chrome').last, output: File.expand_path("Output/Video/#{scenario}/#{testCase.first + '_' + testCase[2]}.wmv"), advanced: advanced)
recorder.start
end

What should I do to record the audio which comes out of the speaker? it would be very useful If I have achieved this.