Discord Elixir v1.1.4 DiscordEx.Voice.Buffer

Buffer Module for holding and reading audio.

Summary

Functions

Drain the buffer based off the bit size and apply the result to the function - you don’t actually have to use time to make use of this

Drain the buffer which is assumed to contain just a DCA file with opus packets which have a header that dictate the size of a frame and the packets passed to the function

Dump everything out of the buffer

Read off of the buffer based on a set bit size

Read off of the buffer based on a set bit size and return the integer format

Get the size of the buffer

Create a new queue

Write to the buffer/queue binary data

Functions

drain(queue, size_in_bits, function, time \\ 0)

Drain the buffer based off the bit size and apply the result to the function - you don’t actually have to use time to make use of this

drain_dca(queue, function, time \\ 0)

Specs

drain_dca(pid, function, integer) :: binary

Drain the buffer which is assumed to contain just a DCA file with opus packets which have a header that dictate the size of a frame and the packets passed to the function

dump(queue)

Specs

dump(pid) :: atom

Dump everything out of the buffer

read(queue, size_in_bits)

Specs

read(pid, integer) :: binary

Read off of the buffer based on a set bit size

read(queue, size_in_bits, atom)

Specs

read(pid, integer, atom) :: binary

Read off of the buffer based on a set bit size and return the integer format

size(queue)

Specs

size(pid) :: integer

Get the size of the buffer

start()

Specs

start :: pid

Create a new queue

write(queue, new_data)

Specs

write(pid, binary) :: atom

Write to the buffer/queue binary data