Package org.robolectric.shadows
Interface ShadowAudioRecord.AudioRecordSource
- Enclosing class:
- ShadowAudioRecord
public static interface ShadowAudioRecord.AudioRecordSource
Provides underlying data for the
ShadowAudioRecord
.-
Method Summary
Modifier and Type Method Description default int
readInByteArray(byte[] audioData, int offsetInBytes, int sizeInBytes, boolean isBlocking)
Provides backing data forAudioRecord.read(byte[], int, int)
andAudioRecord.read(byte[], int, int, int)
.default int
readInDirectBuffer(ByteBuffer buffer, int sizeInBytes, boolean isBlocking)
Provides backing data forAudioRecord.read(byte[], int, int)
andAudioRecord.read(byte[], int, int, int)
.default int
readInFloatArray(float[] audioData, int offsetInFloats, int sizeInFloats, boolean isBlocking)
Provides backing data forAudioRecord.read(float[], int, int, int)
.default int
readInShortArray(short[] audioData, int offsetInShorts, int sizeInShorts, boolean isBlocking)
Provides backing data forAudioRecord.read(short[], int, int)
andAudioRecord.read(short[], int, int, int)
.
-
Method Details
-
readInByteArray
default int readInByteArray(byte[] audioData, int offsetInBytes, int sizeInBytes, boolean isBlocking)Provides backing data forAudioRecord.read(byte[], int, int)
andAudioRecord.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 forAudioRecord.read(short[], int, int)
andAudioRecord.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 forAudioRecord.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
Provides backing data forAudioRecord.read(byte[], int, int)
andAudioRecord.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.
-