스킵 구현

This commit is contained in:
2023-12-20 19:45:25 +09:00
parent 6503fd167b
commit 8a987320e0
775 changed files with 162601 additions and 135 deletions

View File

@@ -0,0 +1,7 @@
\page joinvc Join or Switch to the Voice Channel of the User Issuing a Command
When a user issues a command you may want to join their voice channel, e.g. in a music bot. If you are already on the same voice channel, the bot should do nothing (but be ready to instantly play audio) and if the user is on a different voice channel, the bot should switch to it. If the user is on no voice channel at all, this should be considered an error. This example shows how to do this.
\note Please be aware this example sends no audio, but indicates clearly in the comments where and how you should do so.
\include{cpp} join_voice.cpp

View File

@@ -0,0 +1,13 @@
\page stream-mp3-discord-bot Streaming MP3 Files
To stream MP3 files via D++ you need to link an additional dependency to your bot, namely `libmpg123`. It is relatively simple when linking this library to your bot to then decode audio to PCM and send it to the dpp::discord_voice_client::send_audio_raw function as shown below:
\include{cpp} mp3.cpp
To compile this program you must remember to specify `libmpg123` alongside `libdpp` in the build command, for example:
```bash
g++ -std=c++17 -o musictest musictest.cpp -lmpg123 -ldpp
```
\include{doc} install_prebuilt_footer.dox

View File

@@ -0,0 +1,25 @@
\page oggopus Streaming Ogg Opus file
This example shows how to stream an Ogg Opus file to a voice channel. This example requires some additional dependencies, namely `libogg` and `opusfile`.
\include{cpp} oggopus.cpp
You can compile this example using the following command
```bash
c++ /path/to/source.cc -ldpp -lopus -lopusfile -logg -I/usr/include/opus
```
## Using liboggz
You can use `liboggz` to stream an Ogg Opus file to discord voice channel.
`liboggz` provides higher level abstraction and useful APIs. Some features `liboggz` provides include: seeking and timestamp interpretation.
Read more on the [documentation](https://www.xiph.org/oggz/doc/).
\include{cpp} oggopus2.cpp
You can compile this example using the following command:
```bash
c++ /path/to/source.cc -ldpp -loggz
```

View File

@@ -0,0 +1,7 @@
\page record-user Record Yourself in a VC
DPP supports receiving audio. This example shows how to use it to record some user in a VC.
\note Voice receiving by bots is not officially supported by the Discord API. We cannot guarantee that this feature will work in the future.
\include{cpp} record_user.cpp

View File

@@ -0,0 +1,5 @@
\page soundboard Creating a Sound Board
This example script shows how to send a sound file to a voice channel. A few shortcuts are taken here, for more advanced techniques for connecting to a voice channel see the tutorial \ref joinvc .
\include{cpp} soundboard.cpp