### Install Development Tools Source: https://github.com/dolfies/discord-native-voice/blob/master/README.md Install development tools for the project using pip. ```sh python3 -m pip install -U .[dev] ``` -------------------------------- ### Install discord.py-self and discord-native-voice Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Install the necessary libraries using pip. Python 3.10 or higher is required. PyNaCl is not needed. FFmpeg is recommended for media handling. ```sh python -m pip install -U discord.py-self discord-native-voice ``` -------------------------------- ### Install discord.py-self and discord-native-voice Source: https://github.com/dolfies/discord-native-voice/blob/master/README.md Install the necessary libraries using pip. Python 3.10 or higher is required. ```sh # Linux/macOS python3 -m pip install -U discord.py-self discord-native-voice # Windows py -3 -m pip install -U discord.py-self discord-native-voice ``` -------------------------------- ### Configure Voice Client with Options Source: https://github.com/dolfies/discord-native-voice/blob/master/README.md Create a configured VoiceClient class with specific options like RTX, UDP QoS, and debug stats enabled before connecting. ```python from discord.ext.native_voice import VoiceClient ConfiguredVoiceClient = VoiceClient.with_config( rtx=False, udp_qos=True, enable_debug_stats=True, ) voice = await channel.connect(cls=ConfiguredVoiceClient, self_video=True) ``` -------------------------------- ### Create and play a live stream Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Create a StreamClient from an existing VoiceClient to go live. Use FFmpegMediaSource for desktop or screen capture. ```python3 from discord.ext.native_voice import FFmpegMediaSource, StreamClient, VoiceClient voice = await channel.connect(cls=VoiceClient) stream = await voice.create_stream(cls=StreamClient) # Simplified example, reality is slightly more complicated source = FFmpegMediaSource.from_desktop( 'H264', width=1920, height=1080, fps=30, bitrate=6_000_000, ) stream.play(source) ``` -------------------------------- ### BasicSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A basic implementation of a media sink. ```APIDOC ## BasicSink ### Description A basic implementation of a media sink. ### Class `discord.ext.native_voice.BasicSink` ### Members - `members` ``` -------------------------------- ### Connect with self-video enabled Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Connect to a voice channel and enable sending self-video by setting self_video=True. ```python3 voice = await channel.connect(cls=VoiceClient, self_video=True) ``` -------------------------------- ### Play Media File with Audio and Video Source: https://github.com/dolfies/discord-native-voice/blob/master/README.md Play a media file with audio and video using FFmpegMediaSource. Ensure the file path and codecs are correct. ```python from discord.ext.native_voice import FFmpegMediaSource, VoiceClient voice = await channel.connect(cls=VoiceClient, self_video=True) source = FFmpegMediaSource.from_file( 'clip.mp4', 'H264', width=1280, height=720, fps=30, bitrate=4_000_000, ) voice.play(source) ``` -------------------------------- ### Connect to a voice channel Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Connect to a voice channel using the custom VoiceClient. This is the initial step for all voice operations. ```python3 from discord.ext.native_voice import VoiceClient voice = await channel.connect(cls=VoiceClient) ``` -------------------------------- ### Connect with Native Voice Client Source: https://github.com/dolfies/discord-native-voice/blob/master/README.md Connect to a voice channel using the native voice client. Enable self-video if needed. ```python from discord.ext.native_voice import VoiceClient voice = await channel.connect(cls=VoiceClient, self_video=True) ``` -------------------------------- ### Play media from a file Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Play audio and video from a file using FFmpegMediaSource. Specify video parameters like resolution and bitrate. ```python3 from discord.ext.native_voice import FFmpegMediaSource, VoiceClient voice = await channel.connect(cls=VoiceClient, self_video=True) source = FFmpegMediaSource.from_file( 'clip.mp4', 'H264', width=1280, height=720, fps=30, bitrate=4_000_000, ) voice.play(source) ``` -------------------------------- ### MixedWaveSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink for writing mixed WAV audio files. ```APIDOC ## MixedWaveSink ### Description A media sink for writing mixed WAV audio files. ### Class `discord.ext.native_voice.MixedWaveSink` ### Members - `members` ``` -------------------------------- ### WaveSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink for writing WAV audio files. ```APIDOC ## WaveSink ### Description A media sink for writing WAV audio files. ### Class `discord.ext.native_voice.WaveSink` ### Members - `members` ``` -------------------------------- ### PCMAudio Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents PCM audio data. ```APIDOC ## PCMAudio ### Description Represents PCM audio data. ### Class `discord.ext.native_voice.PCMAudio` ### Members - `members` ``` -------------------------------- ### FFmpegAudio Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents audio data processed by FFmpeg. ```APIDOC ## FFmpegAudio ### Description Represents audio data processed by FFmpeg. ### Class `discord.ext.native_voice.FFmpegAudio` ### Members - `members` ``` -------------------------------- ### PerUserSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink that routes media based on user. ```APIDOC ## PerUserSink ### Description A media sink that routes media based on user. ### Class `discord.ext.native_voice.PerUserSink` ### Members - `members` ``` -------------------------------- ### PCMMediaSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source for raw PCM audio data. ```APIDOC ## PCMMediaSource ### Description Represents a source for raw PCM audio data. ### Class `discord.ext.native_voice.PCMMediaSource` ### Members - `members` ``` -------------------------------- ### QueueSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink that stores received media in a queue. ```APIDOC ## QueueSink ### Description A media sink that stores received media in a queue. ### Class `discord.ext.native_voice.QueueSink` ### Members - `members` ``` -------------------------------- ### VideoConfig Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Configuration for video streams. ```APIDOC ## VideoConfig ### Description Configuration for video streams. ### Class `discord.ext.native_voice.VideoConfig` ### Members - `members` ``` -------------------------------- ### Receive media packets Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Listen for incoming media packets using the listen method with a callback function. The callback receives MediaPacket objects. ```python3 from discord.ext.native_voice import MediaPacket, VoiceClient voice = await channel.connect(cls=VoiceClient) def on_packet(packet: MediaPacket) -> None: print(packet.media_type, packet.codec, packet.user_id) voice.listen(on_packet) ``` -------------------------------- ### MediaSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Abstract base class for all media sinks. Defines the fundamental interface for receiving media data. ```APIDOC ## MediaSink ### Description Abstract base class for all media sinks. Defines the fundamental interface for receiving media data. ### Class `discord.ext.native_voice.MediaSink` ### Members - `members` ``` -------------------------------- ### AsyncQueueSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst An asynchronous media sink that stores received media in a queue. ```APIDOC ## AsyncQueueSink ### Description An asynchronous media sink that stores received media in a queue. ### Class `discord.ext.native_voice.AsyncQueueSink` ### Members - `members` ``` -------------------------------- ### MultiSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink that distributes received media to multiple other sinks. ```APIDOC ## MultiSink ### Description A media sink that distributes received media to multiple other sinks. ### Class `discord.ext.native_voice.MultiSink` ### Members - `members` ``` -------------------------------- ### MediaSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Abstract base class for all media sources. Defines the fundamental interface for providing media data. ```APIDOC ## MediaSource ### Description Abstract base class for all media sources. Defines the fundamental interface for providing media data. ### Class `discord.ext.native_voice.MediaSource` ### Members - `members` - `inherited_members` ``` -------------------------------- ### FFmpegSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink that uses FFmpeg for processing. ```APIDOC ## FFmpegSink ### Description A media sink that uses FFmpeg for processing. ### Class `discord.ext.native_voice.FFmpegSink` ### Members - `members` ``` -------------------------------- ### MultiMediaSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source that combines multiple media streams. ```APIDOC ## MultiMediaSource ### Description Represents a source that combines multiple media streams. ### Class `discord.ext.native_voice.MultiMediaSource` ### Members - `supports_simulcast` - `on_media_sink_wants` - `members` ``` -------------------------------- ### SimulcastVideoSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source for simulcast video streams. ```APIDOC ## SimulcastVideoSource ### Description Represents a source for simulcast video streams. ### Class `discord.ext.native_voice.SimulcastVideoSource` ### Members - `supports_simulcast` - `on_media_sink_wants` - `members` ``` -------------------------------- ### SilenceFillSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink that fills gaps with silence. ```APIDOC ## SilenceFillSink ### Description A media sink that fills gaps with silence. ### Class `discord.ext.native_voice.SilenceFillSink` ### Members - `members` ``` -------------------------------- ### Watch another user's stream Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/quickstart.rst Watch another user's stream by accessing the stream object from the voice client and creating a StreamClient to watch it. ```python3 stream = voice.streams[0] stream_client = await stream.watch(cls=StreamClient) ``` -------------------------------- ### VideoTranscoderConfig Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Configuration for video transcoding. ```APIDOC ## VideoTranscoderConfig ### Description Configuration for video transcoding. ### Class `discord.ext.native_voice.VideoTranscoderConfig` ### Members - `members` ``` -------------------------------- ### AudioMediaSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source for audio media data. ```APIDOC ## AudioMediaSource ### Description Represents a source for audio media data. ### Class `discord.ext.native_voice.AudioMediaSource` ### Members - `members` ``` -------------------------------- ### FFmpegPCMAudio Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents PCM audio data processed by FFmpeg. ```APIDOC ## FFmpegPCMAudio ### Description Represents PCM audio data processed by FFmpeg. ### Class `discord.ext.native_voice.FFmpegPCMAudio` ### Members - `members` ``` -------------------------------- ### RTPExtension Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents an RTP extension header. ```APIDOC ## RTPExtension ### Description Represents an RTP extension header. ### Class `discord.ext.native_voice.RTPExtension` ### Members - `members` ``` -------------------------------- ### FFmpegMuxSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink that uses FFmpeg for multiplexing. ```APIDOC ## FFmpegMuxSink ### Description A media sink that uses FFmpeg for multiplexing. ### Class `discord.ext.native_voice.FFmpegMuxSink` ### Members - `members` ``` -------------------------------- ### MediaPlayerStats Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Statistics related to media player performance. ```APIDOC ## MediaPlayerStats ### Description Statistics related to media player performance. ### Class `discord.ext.native_voice.MediaPlayerStats` ### Members - `members` ``` -------------------------------- ### AudioFrameSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source for audio frames. ```APIDOC ## AudioFrameSource ### Description Represents a source for audio frames. ### Class `discord.ext.native_voice.AudioFrameSource` ### Members - `members` ``` -------------------------------- ### MediaSinkWants Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Object describing the wants of a media sink. ```APIDOC ## MediaSinkWants ### Description Object describing the wants of a media sink. ### Class `discord.ext.native_voice.MediaSinkWants` ### Members - `members` ``` -------------------------------- ### PCMDecodeSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink for decoding PCM audio data. ```APIDOC ## PCMDecodeSink ### Description A media sink for decoding PCM audio data. ### Class `discord.ext.native_voice.PCMDecodeSink` ### Members - `members` ``` -------------------------------- ### MediaPacket Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a packet of media data. ```APIDOC ## MediaPacket ### Description Represents a packet of media data. ### Class `discord.ext.native_voice.MediaPacket` ### Members - `members` ``` -------------------------------- ### FFmpegOpusAudio Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents Opus audio data processed by FFmpeg. ```APIDOC ## FFmpegOpusAudio ### Description Represents Opus audio data processed by FFmpeg. ### Class `discord.ext.native_voice.FFmpegOpusAudio` ### Members - `members` ``` -------------------------------- ### FFmpegSimulcastVideoSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents simulcast video data processed by FFmpeg. ```APIDOC ## FFmpegSimulcastVideoSource ### Description Represents simulcast video data processed by FFmpeg. ### Class `discord.ext.native_voice.FFmpegSimulcastVideoSource` ### Members - `members` ``` -------------------------------- ### VideoFrameSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source for video frames. ```APIDOC ## VideoFrameSource ### Description Represents a source for video frames. ### Class `discord.ext.native_voice.VideoFrameSource` ### Members - `members` ``` -------------------------------- ### CompositeMediaSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a composite media source, potentially combining different types of media. ```APIDOC ## CompositeMediaSource ### Description Represents a composite media source, potentially combining different types of media. ### Class `discord.ext.native_voice.CompositeMediaSource` ### Members - `on_media_sink_wants` - `members` ``` -------------------------------- ### VideoFrame Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a single video frame. ```APIDOC ## VideoFrame ### Description Represents a single video frame. ### Class `discord.ext.native_voice.VideoFrame` ### Members - `members` ``` -------------------------------- ### FFmpegMediaSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents media data processed by FFmpeg. ```APIDOC ## FFmpegMediaSource ### Description Represents media data processed by FFmpeg. ### Class `discord.ext.native_voice.FFmpegMediaSource` ### Members - `members` ``` -------------------------------- ### MediaFilter Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A general media filter. ```APIDOC ## MediaFilter ### Description A general media filter. ### Class `discord.ext.native_voice.MediaFilter` ### Members - `members` ``` -------------------------------- ### FFmpegVideoSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents video data processed by FFmpeg. ```APIDOC ## FFmpegVideoSource ### Description Represents video data processed by FFmpeg. ### Class `discord.ext.native_voice.FFmpegVideoSource` ### Members - `members` ``` -------------------------------- ### StreamClient Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a stream client connection, likely for handling media streams. It shares similar base functionalities with VoiceClient but may have specific stream-related methods. ```APIDOC ## StreamClient ### Description Represents a stream client connection for handling media streams. It inherits from a base client and provides methods for managing stream-related operations. ### Class `discord.ext.native_voice.StreamClient` ### Members - `supports_video` - `get_experiments` - `connect` - `cleanup` - `on_voice_state_update` - `on_voice_server_update` ``` -------------------------------- ### VideoProbeInfo Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Information obtained from probing video streams. ```APIDOC ## VideoProbeInfo ### Description Information obtained from probing video streams. ### Class `discord.ext.native_voice.VideoProbeInfo` ### Members - `members` ``` -------------------------------- ### MediaVolumeTransformer Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A transformer that adjusts the volume of media. ```APIDOC ## MediaVolumeTransformer ### Description A transformer that adjusts the volume of media. ### Class `discord.ext.native_voice.MediaVolumeTransformer` ### Members - `members` ``` -------------------------------- ### VoiceClient Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a voice client connection within the Discord native voice system. It inherits from a base client and provides methods for managing voice state and server updates. ```APIDOC ## VoiceClient ### Description Represents a voice client connection. This class provides methods for managing voice state and server updates. ### Class `discord.ext.native_voice.VoiceClient` ### Members - `supports_video` - `get_experiments` - `connect` - `cleanup` - `on_voice_state_update` - `on_voice_server_update` ``` -------------------------------- ### AudioSendStats Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Statistics related to sending audio. ```APIDOC ## AudioSendStats ### Description Statistics related to sending audio. ### Class `discord.ext.native_voice.AudioSendStats` ### Members - `members` ``` -------------------------------- ### MediaSinkVolumeTransformer Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A transformer that adjusts the volume of a media sink. ```APIDOC ## MediaSinkVolumeTransformer ### Description A transformer that adjusts the volume of a media sink. ### Class `discord.ext.native_voice.MediaSinkVolumeTransformer` ### Members - `members` ``` -------------------------------- ### Dynamically Update Index Links Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/_templates/genindex.html This JavaScript code iterates through table links, filters for discord-related hrefs, and updates the link's text content to a cleaner key. It also adjusts table column widths. ```html {% extends "basic/genindex.html" %} {% block body %} {{ super() }} let elements = document.querySelectorAll("table.indextable a"); // this is pretty finicky but it should work. for(let el of elements) { let key = el.getAttribute('href').split('#', 2)[1] if(!key.startsWith('discord.')) { continue; } if(key.startsWith('discord.ext.')) { key = key.substr(12); // discord.ext. } if(el.textContent.indexOf('()') !== -1) { key = key + '()' } el.textContent = key; } document.querySelectorAll("td").forEach(el => el.style.width = 'auto'); {% endblock %} ``` -------------------------------- ### EncodedVideoSink Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A media sink for receiving encoded video data. ```APIDOC ## EncodedVideoSink ### Description A media sink for receiving encoded video data. ### Class `discord.ext.native_voice.EncodedVideoSink` ### Members - `members` ``` -------------------------------- ### RTPSendStats Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Statistics related to sending RTP packets. ```APIDOC ## RTPSendStats ### Description Statistics related to sending RTP packets. ### Class `discord.ext.native_voice.RTPSendStats` ### Members - `members` ``` -------------------------------- ### ConditionalFilter Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A filter that applies conditions to media. ```APIDOC ## ConditionalFilter ### Description A filter that applies conditions to media. ### Class `discord.ext.native_voice.ConditionalFilter` ### Members - `members` ``` -------------------------------- ### RTCPReceiverReport Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents an RTCP receiver report. ```APIDOC ## RTCPReceiverReport ### Description Represents an RTCP receiver report. ### Class `discord.ext.native_voice.RTCPReceiverReport` ### Members - `members` ``` -------------------------------- ### UserFilter Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A filter that applies conditions based on user. ```APIDOC ## UserFilter ### Description A filter that applies conditions based on user. ### Class `discord.ext.native_voice.UserFilter` ### Members - `members` ``` -------------------------------- ### TimedFilter Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst A filter that applies conditions based on time. ```APIDOC ## TimedFilter ### Description A filter that applies conditions based on time. ### Class `discord.ext.native_voice.TimedFilter` ### Members - `members` ``` -------------------------------- ### EncodedVideoSource Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents a source for encoded video data. ```APIDOC ## EncodedVideoSource ### Description Represents a source for encoded video data. ### Class `discord.ext.native_voice.EncodedVideoSource` ### Members - `members` ``` -------------------------------- ### RTPPacket Source: https://github.com/dolfies/discord-native-voice/blob/master/docs/api.rst Represents an RTP packet. ```APIDOC ## RTPPacket ### Description Represents an RTP packet. ### Class `discord.ext.native_voice.RTPPacket` ### Members - `members` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.