Skip to content

Commit a12830c

Browse files
committed
add doc section about libdave
1 parent a74fe2d commit a12830c

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

docs/guides/toc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@
143143
- name: Bearer Tokens
144144
topicUid: Guides.BearerToken
145145
- name: Voice
146-
topicUid: Guides.Voice.SendingVoice
146+
items:
147+
- name: Connecting and Sending
148+
topicUid: Guides.Voice.SendingVoice
149+
- name: libdave Support
150+
topicUid: Guides.Voice.LibDave
147151
- name: Polls
148152
topicUid: Guides.Polls
149153
- name: Deployment

docs/guides/voice/libdave.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
uid: Guides.Voice.LibDave
3+
title: Using libdave e2ee
4+
---
5+
6+
# Setup
7+
8+
You'll first need a build of Discords' [libdave](https://github.com/discord/libdave) library as either `libdave.dll`, `libdave.so` or `libdave.o` in your apps executing directory.
9+
10+
Then, enable dave voice encryption in your socket config:
11+
12+
```cs
13+
var client = new DiscordSocketClient(new DiscordSocketConfig()
14+
{
15+
EnableVoiceDaveEncryption = true,
16+
...
17+
});
18+
```
19+
20+
That's it, `libdave` will be used when sending/receiving voice.
21+
22+
### libdave Log Sink
23+
24+
By default, `libdave` writes its logs to standard output, you can override that by specifying a custom log sink:
25+
```cs
26+
Discord.LibDave.Dave.SetLogSink(MyLogSink);
27+
28+
void MyLogSink(
29+
Discord.LibDave.LoggingSeverity severity,
30+
string filePath,
31+
int lineNumber,
32+
string message
33+
)
34+
{
35+
// do what you want with the logs
36+
Console.WriteLine($"[{severity} | LIBDAVE @ {file}#{line}]: {message}");
37+
}
38+
```

0 commit comments

Comments
 (0)