Package com.amazonaws.ivs.broadcast
Class MixedAudioDevice
java.lang.Object
com.amazonaws.ivs.broadcast.Device
com.amazonaws.ivs.broadcast.AudioDevice
com.amazonaws.ivs.broadcast.AudioSource
com.amazonaws.ivs.broadcast.CustomAudioSource
com.amazonaws.ivs.broadcast.MixedAudioDevice
- All Implemented Interfaces:
MixedDevice<MixedAudioDeviceSource>
,Releasable
public class MixedAudioDevice
extends CustomAudioSource
implements MixedDevice<MixedAudioDeviceSource>
A mixed audio device that can accept multiple audio sources to be mixed together to produce a final output.
A mixed audio device with no input sources will still produce output, but the output will be silent.
Note: Multiple audio sources will have their audio added together. If there are too many loud sources sending samples at
the same time, the output may be clipped. Turn down the gain on individual sources to compensate if necessary.
This can be created through DeviceDiscovery
.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.amazonaws.ivs.broadcast.AudioDevice
AudioDevice.Format, AudioDevice.StatsCallback
Nested classes/interfaces inherited from class com.amazonaws.ivs.broadcast.Device
Device.Descriptor
-
Field Summary
Fields inherited from class com.amazonaws.ivs.broadcast.AudioSource
descriptor, handle, tag
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSource
(MixedAudioDeviceSource source) Adds a source to this mixed device.int
appendBuffer
(ByteBuffer buffer, long count, long presentationTimeUs) This always throws aBroadcastException
on aMixedAudioDevice
.void
removeSource
(MixedAudioDeviceSource source) Removes a source from the mixed device.Methods inherited from class com.amazonaws.ivs.broadcast.CustomAudioSource
finalize, release
Methods inherited from class com.amazonaws.ivs.broadcast.AudioSource
appendBuffer, getDescriptor, getHandle, getTag, isValid, setConfiguration, setGain, setGain, setStatsCallback
-
Method Details
-
addSource
Description copied from interface:MixedDevice
Adds a source to this mixed device. If this source has already been added, this will be a no-op.- Specified by:
addSource
in interfaceMixedDevice<MixedAudioDeviceSource>
- Parameters:
source
- The source to add.
-
removeSource
Description copied from interface:MixedDevice
Removes a source from the mixed device. If this source isn't currently attached, this will be a no-op.- Specified by:
removeSource
in interfaceMixedDevice<MixedAudioDeviceSource>
- Parameters:
source
- The source to remove.
-
getSources
- Specified by:
getSources
in interfaceMixedDevice<MixedAudioDeviceSource>
- Returns:
- A list of the sources attached to this mixed device.
-
appendBuffer
This always throws aBroadcastException
on aMixedAudioDevice
. Do not call this.- Overrides:
appendBuffer
in classAudioSource
- Parameters:
buffer
- The buffer of audio data to append. This must be allocated as a Direct ByteBuffercount
- The number of bytes to usepresentationTimeUs
- The presentation time, in microseconds- Returns:
- The number of samples processed
-