My question is more general and doesn't point to specific code segments. I would like to know is it possible to create a virtual microphone; for example when I connect my headset, my phone uses the microphone on the headset. Is there a way to create a virtual headset for which I specify a file to be read as it's input stream (or input from another device)? I've heard these sort of things are impossible due to hardware restrictions but I feel like there should be a way to create virtual devices which can pretend they are real external devices.
If the above is possible are there specific libraries or documentations which can help me since I did not find anything.