Capture game/voice audio ussing phone?

I am developing my own phone for my phone (all from scratch), I was seeing that in other phones you can record your own voice and others (it asks for permissions from F8). I want to see a way to also capture the sound of the game, that is, if I have a person next to me and I’m on a video call or recording, you can hear their voice and the environment.
I used the javascript function:

await navigator.mediaDevices.getUserMedia({ audio: true })

And if it records the voice but not the environment or other voices.

Long story short, you can not. If you find a way to please let me know though.

I was checking other phones like LB-Phone, and in that one you can hear the sound of the game and the voices of other people when making video calls, recording videos or recording audios.
If other people’s voices are heard, it would be a great step forward.

lmk if it worked

var chunks = []
var videoStream = element.captureStream(24);
var newStream = new MediaStream();
await navigator.mediaDevices.getUserMedia({ audio: true })
.then( stream => {
      stream.getAudioTracks().forEach(function(track) {
            newStream.addTrack(track);
      })
})
  
videoStream.getVideoTracks().forEach(function(track) {
      newStream.addTrack(track)
});
        
var mediaRecorder = new MediaRecorder(newStream)
mediaRecorder.ondataavailable = function(e) {
      chunks.push(e.data);
}

mediaRecorder.onstop = function(e) {
      var blob = new Blob(chunks, { 'type' : 'video/mp4' })
      chunks = []
}

I checked but it’s kinda same, if it records my voice but not the others

1 Like

Were you able to record the game audio?