public class AudioMixer extends Object
The input audio streams are provided to the AudioMixer through
addInDataSource(DataSource) in the form of input
DataSources giving access to one or more input
SourceStreams.
The output audio stream representing the mix of the multiple input audio
streams is provided by the AudioMixer in the form of a
AudioMixingPushBufferDataSource giving access to a
AudioMixingPushBufferStream. Such an output is obtained through
createOutDataSource(). The AudioMixer is able to provide
multiple output audio streams at one and the same time, though, each of them
containing the mix of a subset of the input audio streams.
| Modifier and Type | Field and Description |
|---|---|
protected javax.media.protocol.CaptureDevice |
captureDevice
The CaptureDevice capabilities provided by the
AudioMixingPushBufferDataSources created by this
AudioMixer.
|
| Constructor and Description |
|---|
AudioMixer(javax.media.protocol.CaptureDevice captureDevice)
Initializes a new AudioMixer instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInDataSource(javax.media.protocol.DataSource inDataSource)
Adds a new input DataSource to the collection of input
DataSources from which this instance reads audio.
|
protected void |
connect(javax.media.protocol.DataSource dataSource,
javax.media.protocol.DataSource inDataSource)
Connects to a specific DataSource which this AudioMixer
will read audio from.
|
AudioMixingPushBufferDataSource |
createOutDataSource()
Creates a new AudioMixingPushBufferDataSource which gives
access to a single audio stream representing the mix of the audio streams
input into this AudioMixer through its input
DataSources.
|
AudioMixingPushBufferDataSource |
getLocalOutDataSource()
Gets the AudioMixingPushBufferDataSource containing the mix of
all input DataSources excluding the CaptureDevice of
this AudioMixer and is thus meant for playback on the local peer
in a call.
|
TranscodingDataSource |
getTranscodingDataSource(javax.media.protocol.DataSource inDataSource)
Searches this object's inDataSources for one that matches
inDataSource, and returns it's associated
TranscodingDataSource.
|
protected void |
read(javax.media.protocol.PushBufferStream stream,
javax.media.Buffer buffer,
javax.media.protocol.DataSource dataSource)
Reads media from a specific PushBufferStream which belongs to
a specific DataSource into a specific output Buffer.
|
void |
removeInDataSources(DataSourceFilter dataSourceFilter)
Removes DataSources accepted by a specific
DataSourceFilter from the list of input DataSources of
this AudioMixer from which it reads audio to be mixed.
|
protected final javax.media.protocol.CaptureDevice captureDevice
public AudioMixer(javax.media.protocol.CaptureDevice captureDevice)
captureDevice - the CaptureDevice capabilities to be
provided to the AudioMixingPushBufferDataSources created by the
new instance and its first input DataSourcepublic void addInDataSource(javax.media.protocol.DataSource inDataSource)
inDataSource - a new DataSource to input audio to this
instanceprotected void connect(javax.media.protocol.DataSource dataSource,
javax.media.protocol.DataSource inDataSource)
throws IOException
dataSource - the DataSource to connect toinDataSource - the DataSource which is the cause for
dataSource to exist in this AudioMixerIOException - if anything wrong happens while connecting to
dataSourcepublic AudioMixingPushBufferDataSource createOutDataSource()
public AudioMixingPushBufferDataSource getLocalOutDataSource()
public TranscodingDataSource getTranscodingDataSource(javax.media.protocol.DataSource inDataSource)
inDataSource - the DataSource to search for.protected void read(javax.media.protocol.PushBufferStream stream,
javax.media.Buffer buffer,
javax.media.protocol.DataSource dataSource)
throws IOException
stream - the PushBufferStream to read media from and known
to belong to the specified DataSOurcebuffer - the output Buffer in which the media read from the
specified stream is to be written so that it gets returned to
the callerdataSource - the DataSource from which stream
originatedIOException - if anything wrong happens while reading from the
specified streampublic void removeInDataSources(DataSourceFilter dataSourceFilter)
dataSourceFilter - the DataSourceFilter which selects the
DataSources to be removed from the list of input
DataSources of this AudioMixer from which it reads
audio to be mixedCopyright © 2021 jitsi.org. All rights reserved.