I have an Electron application with React plugged for my view layer.
I want to be able to access audio input to my laptop. Audio input will be more than a microphone, I am wanting to input music into my laptop via USB as it doesn't have any audio input ports and ideally I want this to work on any laptop.
I have played around with the getUserMedia()
api like so:
window.navigator.mediaDevices.getUserMedia(constraints)
.then(stream => this.handleStream(stream))
.catch(err => this.handleError(err))
but believe this is for accessing microphone? Is there a way you can select audio input and if so, will I be able to get an audio input from a USB device or is the getUserMedia
API limited to microphones?