java.lang.Object | |||
↳ | com.amazonaws.ivs.broadcast.Device | ||
↳ | com.amazonaws.ivs.broadcast.AudioDevice | ||
↳ | com.amazonaws.ivs.broadcast.AudioSource |
Use AudioSource as a generic source to send app-generated audio to the SDK in LPCM format. See also BroadcastSession#createAudioInputSource(int, int, AudioDevice.Format)
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected TypedLambda<Boolean> | checkThread | ||||||||||
protected Device.Descriptor | descriptor | ||||||||||
protected long | handle | ||||||||||
protected AudioDevice.StatsCallback | statsCallback | ||||||||||
protected String | tag | ||||||||||
protected boolean | valid |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
appendBuffer(ByteBuffer buffer, long count, long presentationTimeUs)
Append an audio buffer.
| ||||||||||
Device.Descriptor |
getDescriptor()
From Device
| ||||||||||
String | getTag() | ||||||||||
boolean | isValid() | ||||||||||
void |
setGain(Float gain)
Set the input gain
| ||||||||||
void |
setStatsCallback(AudioDevice.StatsCallback callback)
Set a callback to receive audio stats for this device.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | appendBuffer(long handle, ByteBuffer buffer, long count, long presentationTimeUs) | ||||||||||
void | setConfiguration(long handle, int channels, int sampleRate, int format) | ||||||||||
void | setGain(long handle, float gain) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.amazonaws.ivs.broadcast.AudioDevice
| |||||||||||
From class
com.amazonaws.ivs.broadcast.Device
| |||||||||||
From class
java.lang.Object
|
Append an audio buffer. This can only be used with USER_AUDIO
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 |
Set the input gain
gain | Generally between 0 and 1, but values up to 2 are accepted. Any value over 1 amplifies the signal and may cause clipping. |
---|
Set a callback to receive audio stats for this device. This will be called on the main thread.
callback | A callback lambda that takes two floats: peak and rms. |
---|