createEncoder

@NotNull
abstract fun <T : AudioEncoder?> createEncoder(@NotNull codecInfo: @NotNull CodecInfo, sampleRate: Int, stereo: Boolean, mtuSize: Int): @NotNull T

Creates a new audio encoder with the specified codec information and configuration parameters.

Return

An instance of the audio encoder with the specified parameters.

Parameters

codecInfo

The codec information specifying the codec to be used.

sampleRate

The sample rate of the audio data.

stereo

true if the audio is in stereo format, false for mono.

mtuSize

The maximum transmission unit (MTU) size for network communication.