Interface ShadowAudioRecord.AudioRecordSource

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default int readInByteArray​(byte[] audioData, int offsetInBytes, int sizeInBytes, boolean isBlocking)
      Provides backing data for AudioRecord.read(byte[], int, int) and AudioRecord.read(byte[], int, int, int).
      default int readInDirectBuffer​(java.nio.ByteBuffer buffer, int sizeInBytes, boolean isBlocking)
      Provides backing data for AudioRecord.read(byte[], int, int) and AudioRecord.read(byte[], int, int, int).
      default int readInFloatArray​(float[] audioData, int offsetInFloats, int sizeInFloats, boolean isBlocking)
      Provides backing data for AudioRecord.read(float[], int, int, int).
      default int readInShortArray​(short[] audioData, int offsetInShorts, int sizeInShorts, boolean isBlocking)
      Provides backing data for AudioRecord.read(short[], int, int) and AudioRecord.read(short[], int, int, int).
    • Method Detail

      • readInByteArray

        default int readInByteArray​(byte[] audioData,
                                    int offsetInBytes,
                                    int sizeInBytes,
                                    boolean isBlocking)
        Provides backing data for AudioRecord.read(byte[], int, int) and AudioRecord.read(byte[], 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.
      • readInShortArray

        default int readInShortArray​(short[] audioData,
                                     int offsetInShorts,
                                     int sizeInShorts,
                                     boolean isBlocking)
        Provides backing data for AudioRecord.read(short[], int, int) and AudioRecord.read(short[], 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.
      • 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​(java.nio.ByteBuffer buffer,
                                       int sizeInBytes,
                                       boolean isBlocking)
        Provides backing data for AudioRecord.read(byte[], int, int) and AudioRecord.read(byte[], 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. Note any position/limit changes to the buffer will not be visible to the caller of the AudioRecord methods.