ArrayAudioFrameProvider

Represents an audio frame provider using an array implementation.

Use this audio frame provider when you need to provide a fixed set of frames.

If frames are not looped using loop, when the end of the list is reached, the provider will return AudioFrameResult.Finished.

Constructors

Link copied to clipboard
constructor(voiceServer: PlasmoBaseVoiceServer, stereo: Boolean)

Properties

Link copied to clipboard

Set whether the frames in the array should loop.

Functions

Link copied to clipboard

Adds an Opus encoded audio samples to the queue.

Link copied to clipboard
fun addEnd()

Adds an end of the stream marker to the queue.

Link copied to clipboard
fun addSamples(samples: ShortArray)

Adds an 48kHz 16-bit PCM audio samples to the queue.

Link copied to clipboard
fun clear()

Removes all frames.

Link copied to clipboard
override fun close()

Closes the encoder and frame provider.

Link copied to clipboard
open override fun provide20ms(): AudioFrameResult

Provides the 20ms encoded & encrypted audio frame.