Package com.amazonaws.ivs.broadcast
Class AudioDevice
- java.lang.Object
- 
- com.amazonaws.ivs.broadcast.Device
- 
- com.amazonaws.ivs.broadcast.AudioDevice
 
 
- 
- Direct Known Subclasses:
- AudioSource
 
 public abstract class AudioDevice extends Device Audio input sources must conform to this interface
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAudioDevice.FormatAudio data representationsstatic interfaceAudioDevice.StatsCallback- 
Nested classes/interfaces inherited from class com.amazonaws.ivs.broadcast.DeviceDevice.Descriptor
 
- 
 - 
Constructor SummaryConstructors Constructor Description AudioDevice()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract intappendBuffer(java.nio.ByteBuffer buffer, long count, long presentationTimeUs)Append an audio buffer.abstract voidsetGain(java.lang.Float gain)Set the input gainabstract voidsetStatsCallback(AudioDevice.StatsCallback callback)Set a callback to receive audio stats for this device.- 
Methods inherited from class com.amazonaws.ivs.broadcast.DevicegetDescriptor, getTag, isValid
 
- 
 
- 
- 
- 
Method Detail- 
setGainpublic abstract void setGain(java.lang.Float gain) Set the input gain- Parameters:
- gain- Generally between 0 and 1, but values up to 2 are accepted. Any value over 1 amplifies the signal and may cause clipping.
 
 - 
appendBufferpublic abstract int appendBuffer(java.nio.ByteBuffer buffer, long count, long presentationTimeUs)Append an audio buffer. This can only be used withDevice.Descriptor.DeviceType.USER_AUDIO- Parameters:
- buffer- The buffer of audio data to append. This must be allocated as a Direct ByteBuffer
- count- The number of bytes to use
- presentationTimeUs- The presentation time, in microseconds
- Returns:
- The number of samples processed
 
 - 
setStatsCallbackpublic abstract void setStatsCallback(AudioDevice.StatsCallback callback) Set a callback to receive audio stats for this device. This will be called on the main thread.- Parameters:
- callback- A callback lambda that takes two floats: peak and rms.
 
 
- 
 
-