Package-level declarations

Types

Link copied to clipboard
value class AudioFrame(val data: ByteArray)

A frame of 20ms Opus-encoded 48k stereo audio data.

Link copied to clipboard
fun interface AudioProvider

Implementations of AudioProvider should provide proper AudioFrames representing the audio which should be transmitted to Discord.

Link copied to clipboard
class DefaultFrameInterceptor(data: DefaultFrameInterceptorData = DefaultFrameInterceptorData()) : FrameInterceptor

The default implementation for FrameInterceptor. Any custom implementation should extend this and call the super intercept method, or else the speaking flags will not be sent!

Link copied to clipboard
data class DefaultFrameInterceptorData(val speakingState: SpeakingFlags = SpeakingFlags { +SpeakingFlag.Microphone })

Data that is used to configure for the lifetime of a DefaultFrameInterceptor.

Link copied to clipboard

An interceptor for audio frames before they are sent as packets.

Link copied to clipboard
data class FrameInterceptorConfiguration(val gateway: Gateway, val voiceGateway: VoiceGateway, val ssrc: UInt)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class VoiceConnection(val data: VoiceConnectionData, val gateway: Gateway, val voiceGateway: VoiceGateway, val socket: VoiceUdpSocket, var voiceGatewayConfiguration: VoiceGatewayConfiguration, val streams: Streams, val audioProvider: AudioProvider, val frameInterceptor: FrameInterceptor, val frameSender: AudioFrameSender, val nonceStrategy: NonceStrategy, connectionDetachDuration: Duration)

A VoiceConnection is an adapter that forms the concept of a voice connection, or a connection between you and Discord voice servers.

Link copied to clipboard
class VoiceConnectionBuilder(var gateway: Gateway, var selfId: Snowflake, var channelId: Snowflake, var guildId: Snowflake)
Link copied to clipboard
data class VoiceConnectionData(val selfId: Snowflake, val guildId: Snowflake, val sessionId: String)

Data that represents a VoiceConnection, these will never change during the lifetime of a VoiceConnection.

Functions

Link copied to clipboard
@JvmName(name = "SpeakingFlags0")
fun SpeakingFlags(flags: Iterable<SpeakingFlags>): SpeakingFlags

Returns an instance of SpeakingFlags that has all bits set that are set in any element of flags.

inline fun SpeakingFlags(builder: SpeakingFlags.Builder.() -> Unit = {}): SpeakingFlags

Returns an instance of SpeakingFlags built with SpeakingFlags.Builder.

Link copied to clipboard
inline suspend fun VoiceConnection(gateway: Gateway, selfId: Snowflake, channelId: Snowflake, guildId: Snowflake, builder: VoiceConnectionBuilder.() -> Unit = {}): VoiceConnection

Builds a VoiceConnection configured by the builder.