Interface: MediaStreamAudioSupplier

MediaStreamAudioSupplier

Any audio source of MediaStream is required to implement MediaStreamAudioSupplier interface. The interface defines two methods: addAudioConsumer and removeAudioConsumer. MediaStream uses them to register and unregister itself as a consumer of audio from the supplier. The supplier should use onAudioTrack method of MediaStream class to supply its audio to every registered media stream. The supplier is expected to supply its audio or null value (if the audio isn't available yet) to every newly registering media stream, and the null value to every unregistering media stream.

Methods

addAudioConsumer(consumer)

Registers the specified MediaStream as a consumer of audio from the supplier. It is expected that during the registration the supplier will use onAudioTrack method of MediaStream class to supply its audio or null value (if the audio isn't available yet) to the registering media stream.

Parameters:
Name Type Description
consumer MediaStream

The media stream which should be registered as a consumer of audio from the supplier.

removeAudioConsumer(consumer)

Unregisters the specified MediaStream as a consumer of audio from the supplier. It is expected that during the unregistration the supplier will use onAudioTrack method of MediaStream class to supply the null value to the unregistering media stream.

Parameters:
Name Type Description
consumer MediaStream

The media stream which should be unregistered as a consumer of audio from the supplier.