Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

system audio recording is not available #2

Open
tusharojha opened this issue May 3, 2020 · 6 comments
Open

system audio recording is not available #2

tusharojha opened this issue May 3, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@tusharojha
Copy link

Hi there
I find this project interesting and helpful but at one point it's lagging i.e. system audio recording. This means if I am playing some video, song, alerts then they should be recorded with it.
Currently, the output is not having any audio.

Can you please help me with this issue.
Thanks

@daltonmenezes
Copy link
Owner

Hi @tusharojha , this is expected. Audio isn't supported yet, PR welcome.

@daltonmenezes daltonmenezes added the enhancement New feature or request label May 4, 2020
@alectrocute
Copy link

Not possible currently on macOS or Windows without third party software for audio patching.

@aliafshany
Copy link

Not possible currently on macOS or Windows without third party software for audio patching.

https://github.com/ExistentialAudio/BlackHole

@proxybee
Copy link

I have added audio to this, will like to know if you're open to contributions. Thanks

@daltonmenezes
Copy link
Owner

@proxybee Sure, contributions are always welcome. I have no more plans to electron screen recorder as it is, it will be replaced in a near future to Astro, but I can take your contribution here to make the audio possible also to Astro. When Astro is released, this repository will be archived.

@ldenoue
Copy link

ldenoue commented Nov 21, 2021

@daltonmenezes to add audio, I ask for getUserMedia again and add the audio track to the desktopCapturer stream.

let stream = await navigator.mediaDevices.getUserMedia({
    audio: false,
    video: {
      mandatory: {
        chromeMediaSource: 'desktop',
        chromeMediaSourceId: mediaSourceId,
      }
    }
})
try {
    audioStream = await navigator.mediaDevices.getUserMedia({audio:true})
    audioTrack = audioStream.getAudioTracks()[0];
} catch (eaudio) {
  console.log('no audio allowed')
}
if (audioTrack)
  stream.addTrack(audioTrack);

and then to stop grabbing the audio:
stream.getAudioTracks().forEach((t) => t.stop());

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants