Interface ShadowAudioRecord.AudioRecordSource

Enclosing class:
ShadowAudioRecord

public static interface ShadowAudioRecord.AudioRecordSource
Provides underlying data for the ShadowAudioRecord.
  • Method Details

    • readInByteArray

      default int readInByteArray(byte[] audioData, int offsetInBytes, int sizeInBytes, boolean isBlocking)
      Returns:
      Either a non-negative value representing number of bytes that have been written from the offset or a negative error code.
    • readInShortArray

      default int readInShortArray(short[] audioData, int offsetInShorts, int sizeInShorts, boolean isBlocking)
      Returns:
      Either a non-negative value representing number of bytes that have been written from the offset or a negative error code.
    • readInFloatArray

      default int readInFloatArray(float[] audioData, int offsetInFloats, int sizeInFloats, boolean isBlocking)
      Provides backing data for AudioRecord.read(float[], int, int, int).
      Returns:
      Either a non-negative value representing number of bytes that have been written from the offset or a negative error code.
    • readInDirectBuffer

      default int readInDirectBuffer(ByteBuffer buffer, int sizeInBytes, boolean isBlocking)
      Returns:
      Either a non-negative value representing number of bytes that have been written from the offset or a negative error code. Note any position/limit changes to the buffer will not be visible to the caller of the AudioRecord methods.