Reference getSources()

getSources()

Returns a list of available input sources. This is a wrapper for MediaDevices.enumerateDevices() - Web APIs | MDN and it returns a Promise.

Examples

Syntax

getSources([successCallback], [errorCallback])

Parameters

successCallback
Function:

This callback function handles the sources when they have been enumerated. The callback function receives the deviceList array as its only argument

errorCallback
Function:

This optional callback receives the error message as its argument.

Returns

Promise: Returns a Promise that can be used in place of the callbacks, similar to the enumerateDevices() method
Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References