import AudioNodeSubgraph from './AudioNodeSubgraph' ; import Device from './Device' ; /**
 * A device that applies some transform to another device, returning a device and optional
 * `AudioNode` for use by the device controller.
 *
 * The results are applied by the device controller in two stages:
 *
 * 1. The transform device is used to retrieve the constraints that identify an inner media stream.
 *    This will be managed by the controller.
 * 2. The transform device provides a Web Audio node that will be connected between the input and
 *    the output of the device controller's audio graph. This is returned as a pair, `(start, end)`,
 *    to allow an arbitrary subgraph of nodes to be returned.
 *
 * The application should call `stop` when the device will no longer be used. This method is
 * defined on this interface to establish that convention.
 */ export default interface AudioTransformDevice { /**
     * Called when `realtimeMuteLocalAudio` is called on the `RealtimeController`. Implement this
     * callback to avoid doing expensive processing when the audio output is disabled.
     */ mute ( muted ) : Promise < void > ; /**
     * `stop` should be called by the application to free any resources associated
     * with the device (e.g., workers).
     *
     * After this is called, the device should be discarded.
     */ stop ( ) : Promise < void > ; /**
     * Return the inner  Device that the device controller should select as part
     * of the application of this `AudioTransformDevice`.
      intrinsicDevice ( ) : Promise < Device > ; param context createAudioNode ? ( context ) : Promise < AudioNodeSubgraph | undefined > ; } /**
 * `isAudioTransformDevice` is a type guard for  AudioTransformDevice .
 *
 *  param device export function isAudioTransformDevice ( device ) { return ( ! ! device && typeof device === 'object' && 'mute' in device && 'stop' in device && 'intrinsicDevice' in device ) ; }