Skip to content

Add play audio sample#3266

Merged
Misha-133 merged 7 commits into
discord-net:devfrom
josago97:dev
Jun 5, 2026
Merged

Add play audio sample#3266
Misha-133 merged 7 commits into
discord-net:devfrom
josago97:dev

Conversation

@josago97

Copy link
Copy Markdown
Contributor

Description

An example of audio playback in a voice channel has been added.

@Misha-133

Misha-133 commented May 4, 2026

Copy link
Copy Markdown
Member

Hey
Thanks for the PR
I genuinely do think having an actual example of voice API usage is beneficial, but I don't feel comfortable with having the sample download 3rd party binaries (and other resources)
I think it should be presented in form of an instruction, so it's up to the end user ro decide whether to download & install tools/libraries or not. Also that would allow it to stay portable across platforms.

We have an existing doc page that is lacking in that regard. It was never fully refined and is also using old language constructs, while more modern approaches exist.

I also would suggest using a package manager like winget on windows/ apt/yum/other ones on linux. It generally leads to better user experience not having to.

@josago97

josago97 commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Hello, I understand the concern about downloading and running third-party programs. My idea in creating this example is to make it as user-friendly as possible, like I've seen in other audio libraries, and to keep it always up-to-date. The binaries are obtained from their official sites: Ffmpeg is obtained from the public link on its official website, libdave is taken from the official Discord repository, and Opus is obtained from this repository. Therefore, they can be considered reliable, and these links are referenced in the Discord.NET documentation. Furthermore, anyone can view the code and see what will be downloaded.

I can modify it to support Linux systems when downloading the binaries, if possible.
I can also require user confirmation before anything is downloaded, so that everything is done with their permission.
Regarding using Winget, the problem I see is that it will install more things than necessary and may modify environment variables unnecessarily.

I await your instructions on what changes to make :)

@Misha-133

Copy link
Copy Markdown
Member

Hey
Sorry for a delayed response, I had some stuff happening IRL.

Regarding the PR. I'm not particularly familiar with the sites, so i did not recognize them; nor will a regular lib user.
Even if these are first party distributions, I think the sample should
a. explicitly prompt the user that it will download binaries from a 3rd party source (could be a "yes/no" question in console with a warning message listing the sources & packages)
b. have comments/xmldoc in code describing what each site is and having links to pages.

Also Linux is the primary platform the lib will likely be used on, so support for one in the sample would be appreciated :3

@josago97

josago97 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Done :3
In theory, it should be ready to work on Windows, Mac, and Linux. In practice, I've tested it working correctly on Windows and Linux (via WSL).

@Misha-133 Misha-133 merged commit 4d8b0bc into discord-net:dev Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants