Functions for using the DAVE Protocol
Discord Audio & Video End-to-End Encryption (DAVE) Protocol Whitepaper
RustlerPrecompiled will fetch the required files at compile time.
The following OS's have binaries available:
aarch64-apple-darwinaarch64-unknown-linux-gnuaarch64-unknown-linux-muslarm-unknown-linux-gnueabihfriscv64gc-unknown-linux-gnux86_64-apple-darwinx86_64-pc-windows-gnux86_64-pc-windows-msvcx86_64-unknown-freebsdx86_64-unknown-linux-gnux86_64-unknown-linux-musl
If you have some wackadoo OS or you prefer to build from source with your installed Rust toolchain,
you can add Rustler to your project dependencies and set FORCE_DAVE_BUILD=true.
defp deps do
[
...
{:rustler, "~> 0.37", optional: true, runtime: false}
]
endMinimum set of functions required to get Discord Voice working are implemented. davey has some other
functionality that may be added later. Docs here are limited, so I would recommend looking at the DAVE whitepaper
or nostrum source code for integration and usage details.
Summary
Types
@type codec() :: :unknown | :opus | :av1 | :vp8 | :vp9 | :h264 | :h265
@type media_type() :: :audio | :video
@type proposals_operation_type() :: :append | :revoke
@type protocol_version() :: pos_integer()
@type session() :: reference()
@type session_status() :: :inactive | :pending | :awaiting_response | :active
Functions
@spec can_passthrough?(session(), non_neg_integer()) :: boolean()
@spec decrypt(session(), non_neg_integer(), media_type(), binary()) :: binary() | :error
@spec encrypt(session(), media_type(), codec(), binary()) :: binary() | :error
@spec epoch(session()) :: non_neg_integer()
@spec max_protocol_version() :: protocol_version()
@spec new_session(protocol_version(), non_neg_integer(), non_neg_integer()) :: session()
@spec process_proposals( session(), proposals_operation_type(), binary(), [non_neg_integer()] | nil ) :: commit_welcome() | :error
@spec protocol_version(session()) :: protocol_version()
@spec reinit(session(), protocol_version(), non_neg_integer(), non_neg_integer()) :: :ok
@spec reset(session()) :: :ok | :error
@spec status(session()) :: session_status()