-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capture (loopback) desktop audio #380
Comments
it looks like this could be done with https://github.com/gen2brain/malgo (used in the microphone driver) I was doing my own research on this and this gen2brain/malgo#34 lead me to https://github.com/mackron/miniaudio/blob/master/examples/simple_loopback.c I am not competent enough in c to understand any of that. But anyone else looking into this feature, this might save you some time. |
miniaudio supports the pulse audio backend so this should be possible |
Did you ever get desktop audio working? |
I have not, I need to give it another shot. But have been unable to dedicate the time to figuring it out. |
Hi @nurdism @ZeoWorks , I have managed to make capture the speaker sound working on Windows, func getAudioTrack() (*mediadevices.AudioTrack, error) {
// Currently I use the default speaker from the system, so the device filter will not work!
// var deviceID = ""
devices := mediadevices.EnumerateDevices()
for _, device := range devices {
if device.Kind == mediadevices.AudioOutput {
log.Printf("Found Speaker: %s", device.Name)
//deviceID = device.DeviceID
//break
}
}
s, err := mediadevices.GetUserMedia(mediadevices.MediaStreamConstraints{
Audio: func(c *mediadevices.MediaTrackConstraints) {
//c.DeviceID = prop.String(deviceID)
},
Codec: element.audioCodecSelector,
})
if err != nil {
log.Println("Audio track create failed", err)
return nil, err
} else {
audioTrack := s.GetAudioTracks()[0].(*mediadevices.AudioTrack)
return audioTrack, err
}
} Notice: I also made some changes of the |
Summary
I'd like to be able to capture desktop audio (or an output device)
Motivation
The idea (for me) would to be able to record and stream the desktops audio/video and do a screen cast with that.
Describe alternatives you've considered
The other solution would to find (or create) another lib to capture desktop audio
The text was updated successfully, but these errors were encountered: