Package com.opentok.android
Class BaseAudioDevice.AudioBus
- java.lang.Object
-
- com.opentok.android.BaseAudioDevice.AudioBus
-
- Enclosing class:
- BaseAudioDevice
public static class BaseAudioDevice.AudioBus extends java.lang.Object
The audio bus marshals audio data between the network and the audio device. Call theBaseAudioDevice.getAudioBus()
method to get the AudioBus object for the audio device. The audio device pushes captured audio samples to and fetches unrendered audio samples from the audio bus.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
readRenderData(java.nio.ByteBuffer data, int numberOfSamples)
Retrieves unrendered audio samples from the session.int
readRenderData(java.nio.ShortBuffer data, int numberOfSamples)
Retrieves unrendered audio samples from the session.void
writeCaptureData(java.nio.ByteBuffer data, int numberOfSamples)
Passes audio data to transmit to a session.void
writeCaptureData(java.nio.ShortBuffer data, int numberOfSamples)
Passes audio data to transmit to a session.
-
-
-
Method Detail
-
writeCaptureData
public void writeCaptureData(java.nio.ByteBuffer data, int numberOfSamples)
Passes audio data to transmit to a session.- Parameters:
data
- The byte buffer containing audio data.numberOfSamples
- The number of samples available for copying.
-
writeCaptureData
public void writeCaptureData(java.nio.ShortBuffer data, int numberOfSamples)
Passes audio data to transmit to a session.- Parameters:
data
- The byte buffer containing audio data.numberOfSamples
- The number of samples available for copying.
-
readRenderData
public int readRenderData(java.nio.ByteBuffer data, int numberOfSamples)
Retrieves unrendered audio samples from the session. This is most commonly used to send audio to the speakers, but is also an entry point for further audio processing.- Parameters:
data
- The byte buffer containing audio data.numberOfSamples
- The number of samples requested.- Returns:
- uint32_t The number of samples copied out of the audio buffer.
-
readRenderData
public int readRenderData(java.nio.ShortBuffer data, int numberOfSamples)
Retrieves unrendered audio samples from the session. This is most commonly used to send audio to the speakers, but is also an entry point for further audio processing.- Parameters:
data
- The byte buffer containing audio data.numberOfSamples
- The number of samples requested.- Returns:
- uint32_t The number of samples copied out of the audio buffer.
-
-