Package com.amazonaws.ivs.broadcast
Class AudioSource
- java.lang.Object
- 
- com.amazonaws.ivs.broadcast.Device
- 
- com.amazonaws.ivs.broadcast.AudioDevice
- 
- com.amazonaws.ivs.broadcast.AudioSource
 
 
 
- 
- Direct Known Subclasses:
- CustomAudioSource
 
 public class AudioSource extends AudioDevice Use AudioSource as a generic source to send app-generated audio to the SDK in LPCM format. See alsoSession.createAudioInputSource(int, BroadcastConfiguration.AudioSampleRate, Format)
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.amazonaws.ivs.broadcast.AudioDeviceAudioDevice.Format, AudioDevice.StatsCallback
 - 
Nested classes/interfaces inherited from class com.amazonaws.ivs.broadcast.DeviceDevice.Descriptor
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected Device.Descriptordescriptorprotected longhandleprotected AudioDevice.StatsCallbackstatsCallbackprotected java.lang.Stringtag
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intappendBuffer(long handle, java.nio.ByteBuffer buffer, long count, long presentationTimeUs)intappendBuffer(java.nio.ByteBuffer buffer, long count, long presentationTimeUs)Append an audio buffer.Device.DescriptorgetDescriptor()From DevicelonggetHandle()java.lang.StringgetTag()booleanisValid()protected voidsetConfiguration(long handle, int channels, int sampleRate, int format)protected voidsetGain(long handle, float gain)voidsetGain(java.lang.Float gain)Set the input gainvoidsetStatsCallback(AudioDevice.StatsCallback callback)Set a callback to receive audio stats for this device.
 
- 
- 
- 
Field Detail- 
descriptorprotected final Device.Descriptor descriptor 
 - 
handleprotected long handle 
 - 
tagprotected final java.lang.String tag 
 - 
statsCallbackprotected AudioDevice.StatsCallback statsCallback 
 
- 
 - 
Method Detail- 
setGainpublic void setGain(java.lang.Float gain) Description copied from class:AudioDeviceSet the input gain- Specified by:
- setGainin class- AudioDevice
- 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 int appendBuffer(java.nio.ByteBuffer buffer, long count, long presentationTimeUs)Description copied from class:AudioDeviceAppend an audio buffer. This can only be used withDevice.Descriptor.DeviceType.USER_AUDIO- Specified by:
- appendBufferin class- AudioDevice
- 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
 
 - 
getDescriptorpublic Device.Descriptor getDescriptor() From Device- Specified by:
- getDescriptorin class- Device
 
 - 
setStatsCallbackpublic void setStatsCallback(AudioDevice.StatsCallback callback) Description copied from class:AudioDeviceSet a callback to receive audio stats for this device. This will be called on the main thread.- Specified by:
- setStatsCallbackin class- AudioDevice
- Parameters:
- callback- A callback lambda that takes two floats: peak and rms.
 
 - 
getHandlepublic long getHandle() 
 - 
setGainprotected void setGain(long handle, float gain)
 - 
setConfigurationprotected void setConfiguration(long handle, int channels, int sampleRate, int format)
 - 
appendBufferprotected int appendBuffer(long handle, java.nio.ByteBuffer buffer, long count, long presentationTimeUs)
 
- 
 
-