AudioSender

class AudioSender(frameProvider: AudioFrameProvider, onFrame: (frame: ByteArray, sequenceNumber: Long) -> Boolean, onEnd: (sequenceNumber: Long) -> Boolean)

Class for sending audio frames provided by AudioFrameProvider to the source.

Constructors

Link copied to clipboard
constructor(frameProvider: AudioFrameProvider, onFrame: (frame: ByteArray, sequenceNumber: Long) -> Boolean, onEnd: (sequenceNumber: Long) -> Boolean)

Properties

Link copied to clipboard
var job: Job?

Gets a coroutine job started by start.

Functions

Link copied to clipboard
fun onStop(onStop: Runnable?)

Set the runnable that will be invoked when the sender coroutine job stops.

Link copied to clipboard
fun pause()

Pauses the audio sender.

Link copied to clipboard
fun resume()

Resumes the audio sender.

Link copied to clipboard
fun start()

Starts the coroutine job that sends the frames from the frameProvider each 20ms.

Link copied to clipboard
fun stop()

Stops the sender coroutine job if its active.