createEncoder

@NotNull
abstract fun createEncoder(@NotNull codecInfo: @NotNull CodecInfo, sampleRate: Int, stereo: Boolean, mtuSize: Int): @NotNull Encoder

Creates a new audio encoder with the specified 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.