Ive been looking around and I haven't found any information about this...
Godot doesn't have a virtual audio sink that redirects output to input, but you can use third-party (OS-specific) programs to achieve this. I wouldn't know of any examples though.
I'm not sure it would work with all of Godot's platforms, and it's C#, but a library called NAudio looks like it can capture the system sounds and is open source under MIT.
thankyou all for the answers! ill try to look it up :sweat_smile: