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.StatsCallbackNested 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 TypeMethodDescriptionvoidaddSource(MixedAudioDeviceSource source) Adds a source to this mixed device.intappendBuffer(ByteBuffer buffer, long count, long presentationTimeUs) This always throws aBroadcastExceptionon aMixedAudioDevice.voidremoveSource(MixedAudioDeviceSource source) Removes a source from the mixed device.Methods inherited from class com.amazonaws.ivs.broadcast.CustomAudioSource
finalize, releaseMethods inherited from class com.amazonaws.ivs.broadcast.AudioSource
appendBuffer, getDescriptor, getHandle, getTag, isValid, setConfiguration, setGain, setGain, setStatsCallback
-
Method Details
-
addSource
Description copied from interface:MixedDeviceAdds a source to this mixed device. If this source has already been added, this will be a no-op.- Specified by:
addSourcein interfaceMixedDevice<MixedAudioDeviceSource>- Parameters:
source- The source to add.
-
removeSource
Description copied from interface:MixedDeviceRemoves a source from the mixed device. If this source isn't currently attached, this will be a no-op.- Specified by:
removeSourcein interfaceMixedDevice<MixedAudioDeviceSource>- Parameters:
source- The source to remove.
-
getSources
- Specified by:
getSourcesin interfaceMixedDevice<MixedAudioDeviceSource>- Returns:
- A list of the sources attached to this mixed device.
-
appendBuffer
This always throws aBroadcastExceptionon aMixedAudioDevice. Do not call this.- Overrides:
appendBufferin 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
-