Sinks#
Core#
- class discord.sinks.Filters(**kwargs)[source]#
Filters for
SinkNew in version 2.0.
- Parameters:
container -- Container of all Filters.
- class discord.sinks.Sink(*, filters=None)[source]#
A sink "stores" recorded audio data.
Can be subclassed for extra customizablilty.
Warning
It is recommended you use the officially provided sink classes, such as
WaveSink.just replace the following like so:
vc.start_recording( MySubClassedSink(), finished_callback, ctx.channel, )
New in version 2.0.
- Raises:
ClientException -- An invalid encoding type was specified.
ClientException -- Audio may only be formatted after recording is finished.
- class discord.sinks.AudioData(file)[source]#
Handles data that's been completely decrypted and decoded and is ready to be saved to file.
New in version 2.0.
- write(data)[source]#
Writes audio data.
- Raises:
ClientException -- The AudioData is already finished writing.
- cleanup()[source]#
Finishes and cleans up the audio data.
- Raises:
ClientException -- The AudioData is already finished writing.
- on_format(encoding)[source]#
Called when audio data is formatted.
- Raises:
ClientException -- The AudioData is still writing.
Sink Classes#
- class discord.sinks.WaveSink(*, filters=None)[source]#
A special sink for .wav(wave) files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
WaveSinkError -- Audio may only be formatted after recording is finished.
WaveSinkError -- Formatting the audio failed.
- class discord.sinks.MP3Sink(*, filters=None)[source]#
A special sink for .mp3 files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
MP3SinkError -- Audio may only be formatted after recording is finished.
MP3SinkError -- Formatting the audio failed.
- class discord.sinks.MP4Sink(*, filters=None)[source]#
A special sink for .mp4 files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
MP4SinkError -- Audio may only be formatted after recording is finished.
MP4SinkError -- Formatting the audio failed.
- class discord.sinks.M4ASink(*, filters=None)[source]#
A special sink for .m4a files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
M4ASinkError -- Audio may only be formatted after recording is finished.
M4ASinkError -- Formatting the audio failed.
- class discord.sinks.MKVSink(*, filters=None)[source]#
A special sink for .mkv files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
MKVSinkError -- Audio may only be formatted after recording is finished.
MKVSinkError -- Formatting the audio failed.
- class discord.sinks.MKASink(*, filters=None)[source]#
A special sink for .mka files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
MKASinkError -- Audio may only be formatted after recording is finished.
MKASinkError -- Formatting the audio failed.
- class discord.sinks.OGGSink(*, filters=None)[source]#
A special sink for .ogg files.
New in version 2.0.
- format_audio(audio)[source]#
Formats the recorded audio.
- Raises:
OGGSinkError -- Audio may only be formatted after recording is finished.
OGGSinkError -- Formatting the audio failed.