PcmAudioUtil
@UnstableApi
class PcmAudioUtil
Utility methods for PCM audio data.
Summary
Public functions |
|
|---|---|
java-static ByteBuffer! |
rampUpVolume(Returns a new |
java-static Int |
readAs32BitIntPcm(buffer: ByteBuffer!, @C.Encoding pcmEncoding: Int)Reads a single-channel PCM value from the buffer and returns it as a 32-bit integer PCM value. |
java-static Unit |
write32BitIntPcm(Writes a 32-bit integer PCM value to a buffer in the given target PCM encoding. |
Public functions
rampUpVolume
java-static fun rampUpVolume(
buffer: ByteBuffer!,
@C.Encoding pcmEncoding: Int,
pcmFrameSize: Int,
startFrameIndex: Int,
rampFrameCount: Int
): ByteBuffer!
Returns a new ByteBuffer with linear volume ramping applied.
| Parameters | |
|---|---|
buffer: ByteBuffer! |
The input buffer containing PCM frames. The buffer will be fully consumed by this method. |
@C.Encoding pcmEncoding: Int |
The |
pcmFrameSize: Int |
The overall frame size of one PCM frame (including all channels). |
startFrameIndex: Int |
The index of the first frame within the audio ramp duration (as specified by |
rampFrameCount: Int |
The overall ramp duration in number of frames. |
| Returns | |
|---|---|
ByteBuffer! |
The |
readAs32BitIntPcm
java-static fun readAs32BitIntPcm(buffer: ByteBuffer!, @C.Encoding pcmEncoding: Int): Int
Reads a single-channel PCM value from the buffer and returns it as a 32-bit integer PCM value.
| Parameters | |
|---|---|
buffer: ByteBuffer! |
The |
@C.Encoding pcmEncoding: Int |
The |
| Returns | |
|---|---|
Int |
The 32-bit PCM value of the read buffer. |
write32BitIntPcm
java-static fun write32BitIntPcm(
buffer: ByteBuffer!,
pcm32bit: Int,
@C.Encoding pcmEncoding: Int
): Unit
Writes a 32-bit integer PCM value to a buffer in the given target PCM encoding.
| Parameters | |
|---|---|
buffer: ByteBuffer! |
The |
pcm32bit: Int |
The 32-bit PCM value. |
@C.Encoding pcmEncoding: Int |
The target |